Skip to content

Commit 55b5e6e

Browse files
committedApr 30, 2020
fix wget download by using srapath
1 parent 4d147a1 commit 55b5e6e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

‎distiller.nf

+4-3
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ def sraDownloadTruncateCmd(sra_query, library, run, truncate_fastq_reads=0,
165165
srr_end = (sra_query =~ /end=(\d+)/)[0][1]
166166
}
167167

168-
wget_url = "ftp://ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByRun/sra/SRR/SRR${srrnum.take(3)}/${srr}/${srr}.sra"
169168
if ((srr_start > 0) || (srr_end != -1)) {
170169
cmd = """
171170
${fastqDumpCmd(srr, library, run, srr_start, srr_end, threads)}
@@ -174,8 +173,10 @@ def sraDownloadTruncateCmd(sra_query, library, run, truncate_fastq_reads=0,
174173
}
175174
else {
176175
cmd = """
177-
if wget --spider ${wget_url} 2>/dev/null; then
178-
wget ${wget_url} -qO ${srr}.sra
176+
URL=\$(srapath ${srr})
177+
if wget --spider \$URL 2>/dev/null; then
178+
echo 'Dowloading from ', \$URL
179+
wget \$URL -qO ${srr}.sra
179180
${fastqDumpCmd(srr+'.sra', library, run, 0, -1, threads)}
180181
rm ${srr}.sra
181182
else

0 commit comments

Comments
 (0)
Please sign in to comment.