in app/source/dragen/src/dragen_qs.py [0:0]
def download_inputs(self):
if not self.input_dir:
self.input_dir = self.DEFAULT_DATA_FOLDER + 'inputs/'
# -- fastq list file download
if self.fastq_list_url:
filename = self.fastq_list_url.split('?')[0].split('/')[-1]
target_path = self.input_dir + str(filename)
s3_valid, s3_bucket, s3_key = get_s3_bucket_key(self.fastq_list_url)
if s3_valid:
self.download_s3_object(s3_bucket, s3_key, target_path)
else:
# Try to download using http
self.exec_url_download(self.fastq_list_url, self.input_dir)
self.new_args[self.fastq_list_index] = target_path
# -- tumor_fastq list file download
if self.tumor_fastq_list_url:
filename = self.tumor_fastq_list_url.split('?')[0].split('/')[-1]
target_path = self.input_dir + str(filename)
s3_valid, s3_bucket, s3_key = get_s3_bucket_key(self.tumor_fastq_list_url)
if s3_valid:
self.download_s3_object(s3_bucket, s3_key, target_path)
else:
# Try to download using http
self.exec_url_download(self.tumor_fastq_list_url, self.input_dir)
self.new_args[self.tumor_fastq_list_index] = target_path
# -- VC target bed download
if self.vc_tgt_bed_url:
filename = self.vc_tgt_bed_url.split('?')[0].split('/')[-1]
target_path = self.input_dir + str(filename)
s3_valid, s3_bucket, s3_key = get_s3_bucket_key(self.vc_tgt_bed_url)
if s3_valid:
self.download_s3_object(s3_bucket, s3_key, target_path)
else:
# Try to download using http
self.exec_url_download(self.vc_tgt_bed_url, self.input_dir)
self.new_args[self.vc_tgt_bed_index] = target_path
# -- VC Depth file download
if self.vc_depth_url:
filename = self.vc_depth_url.split('?')[0].split('/')[-1]
target_path = self.input_dir + str(filename)
s3_valid, s3_bucket, s3_key = get_s3_bucket_key(self.vc_depth_url)
if s3_valid:
self.download_s3_object(s3_bucket, s3_key, target_path)
else:
# Try to download using http
self.exec_url_download(self.vc_depth_url, self.input_dir)
self.new_args[self.vc_depth_index] = target_path
# --cnv-normals-list file download
if self.cnv_normals_list_url:
filename = self.cnv_normals_list_url.split('?')[0].split('/')[-1]
target_path = self.input_dir + str(filename)
s3_valid, s3_bucket, s3_key = get_s3_bucket_key(self.cnv_normals_list_url)
if s3_valid:
self.download_s3_object(s3_bucket, s3_key, target_path)
else:
# Try to download using http
self.exec_url_download(self.cnv_normals_list_url, self.input_dir)
self.new_args[self.cnv_normals_list_index] = target_path
# --cnv-target-bed file download
if self.cnv_target_bed_url:
filename = self.cnv_target_bed_url.split('?')[0].split('/')[-1]
target_path = self.input_dir + str(filename)
s3_valid, s3_bucket, s3_key = get_s3_bucket_key(self.cnv_target_bed_url)
if s3_valid:
self.download_s3_object(s3_bucket, s3_key, target_path)
else:
# Try to download using http
self.exec_url_download(self.cnv_target_bed_url, self.input_dir)
self.new_args[self.cnv_target_bed_index] = target_path
# --dbsnp file download
if self.dbsnp_url:
filename = self.dbsnp_url.split('?')[0].split('/')[-1]
target_path = self.input_dir + str(filename)
s3_valid, s3_bucket, s3_key = get_s3_bucket_key(self.dbsnp_url)
if s3_valid:
self.download_s3_object(s3_bucket, s3_key, target_path)
else:
# Try to download using http
self.exec_url_download(self.dbsnp_url, self.input_dir)
self.new_args[self.dbsnp_index] = target_path
# --cosmic file download
if self.cosmic_url:
filename = self.cosmic_url.split('?')[0].split('/')[-1]
target_path = self.input_dir + str(filename)
s3_valid, s3_bucket, s3_key = get_s3_bucket_key(self.cosmic_url)
if s3_valid:
self.download_s3_object(s3_bucket, s3_key, target_path)
else:
# Try to download using http
self.exec_url_download(self.cosmic_url, self.input_dir)
self.new_args[self.cosmic_index] = target_path
# --qc-cross-cont-vcf file download
if self.qc_cross_cont_vcf_url:
filename = self.qc_cross_cont_vcf_url.split('?')[0].split('/')[-1]
target_path = self.input_dir + str(filename)
s3_valid, s3_bucket, s3_key = get_s3_bucket_key(self.qc_cross_cont_vcf_url)
if s3_valid:
self.download_s3_object(s3_bucket, s3_key, target_path)
else:
# Try to download using http
self.exec_url_download(self.qc_cross_cont_vcf_url, self.input_dir)
self.new_args[self.qc_cross_cont_vcf_index] = target_path
# --qc-coverage-region-1 file download
if self.qc_coverage_region_1_url:
filename = self.qc_coverage_region_1_url.split('?')[0].split('/')[-1]
target_path = self.input_dir + str(filename)
s3_valid, s3_bucket, s3_key = get_s3_bucket_key(self.qc_coverage_region_1_url)
if s3_valid:
self.download_s3_object(s3_bucket, s3_key, target_path)
else:
# Try to download using http
self.exec_url_download(self.qc_coverage_region_1_url, self.input_dir)
self.new_args[self.qc_coverage_region_1_index] = target_path
# --qc-coverage-region-2 file download
if self.qc_coverage_region_2_url:
filename = self.qc_coverage_region_2_url.split('?')[0].split('/')[-1]
target_path = self.input_dir + str(filename)
s3_valid, s3_bucket, s3_key = get_s3_bucket_key(self.qc_coverage_region_2_url)
if s3_valid:
self.download_s3_object(s3_bucket, s3_key, target_path)
else:
# Try to download using http
self.exec_url_download(self.qc_coverage_region_2_url, self.input_dir)
self.new_args[self.qc_coverage_region_2_index] = target_path
# --qc-coverage-region-3 file download
if self.qc_coverage_region_3_url:
filename = self.qc_coverage_region_3_url.split('?')[0].split('/')[-1]
target_path = self.input_dir + str(filename)
s3_valid, s3_bucket, s3_key = get_s3_bucket_key(self.qc_coverage_region_3_url)
if s3_valid:
self.download_s3_object(s3_bucket, s3_key, target_path)
else:
# Try to download using http
self.exec_url_download(self.qc_coverage_region_3_url, self.input_dir)
self.new_args[self.qc_coverage_region_3_index] = target_path
return