Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
[sratoolkit] Add maxSize option to set -X option of prefetch in case …
Browse files Browse the repository at this point in the history
…files to download exceed 20 Gb (default limit)
  • Loading branch information
dweemx committed Jul 7, 2021
1 parent 227b578 commit b5c7bae
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/pipelines.rst
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ NOTES:
- If you're a VSC user, you might want to add the ``vsc`` profile.
- The final output (FASTQ files) will available in ``out/data/sra``
- If you're downloading 10x Genomics scATAC-seq data, make sure to set ``params.sratoolkit.includeTechnicalReads = true`` and properly set ``params.utils.sra_normalize_fastqs.fastq_read_suffixes``. In the case of downloading the scATAC-seq samples of SRP254409, ``fastq_read_suffixes`` would be set to ``["R1", "R2", "I1", "I2"]``.

- The download of SRA files is by default limited to 20 Gb. If this limit needs to be increased please set ``params.sratoolkit.maxSize`` accordingly. This limit can be removed by setting the parameter to arbitrarily high number (e.g.: 9999999999999).

Now we can run it with the following command:

Expand Down
6 changes: 5 additions & 1 deletion src/sratoolkit/processes/downloadFastQ.nf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ process DOWNLOAD_FASTQS_FROM_SRA_ACC_ID {
rm \${SRA_FILE_LOCK}
fi
# Fetch SRA file
prefetch -v -p 1 ${sraId}
prefetch \
-v \
-p 1 \
${params.sratoolkit?.maxSize ? '--max-size '+ params.sratoolkit.maxSize: ''} \
${sraId}
# Convert SRA file to FASTQ files
fasterq-dump \
-S \
Expand Down
2 changes: 1 addition & 1 deletion src/sratoolkit/processes/fixAndCompressFastQ.nf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ process FIX_AND_COMPRESS_SRA_FASTQ {
echo "Removing all uncompressed FASTQ files"
for FASTQ in *.fastq; do
echo "Removing uncompressed FASTQ file \${FASTQ}..."
rm "$(readlink -f \${FASTQ})"
rm "\$(readlink -f \${FASTQ})"
done
echo "Done."
"""
Expand Down
2 changes: 2 additions & 0 deletions src/sratoolkit/sratoolkit.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ params {
// --include-technical option (fasterq-dump)
// This option should be set to 'true' if data you're downloading is e.g.: 10x Genomics scATAC-seq
includeTechnicalReads = false
// --max-size (prefetch), maximum file size to download in KB (exclusive). Default: 20G
maxSize = 20000000
}
}

Expand Down

0 comments on commit b5c7bae

Please sign in to comment.