Mercurial > repos > galaxytrakr > aws_sra
view aws_sra.xml @ 23:d7f68b3cde39 draft
planemo upload for repository https://github.com/CFSAN-Biostatistics/galaxytrakr-tools commit e9adf514c1b6b341c9e5bf8cc5a41c79b738d48e
| author | galaxytrakr |
|---|---|
| date | Mon, 23 Mar 2026 23:55:36 +0000 |
| parents | 5ecb94ab82c3 |
| children | 7dbb60c48056 |
line wrap: on
line source
<tool id="aws_sra" name="NCBI SRA AWS Fetch" version="0.4.0+gt+0.2" profile="23.0"> <description>Fetches one or more SRA runs from AWS S3 and converts them to FASTQ</description> <requirements> <requirement type="package" version="2.34.8">awscli</requirement> <requirement type="package" version="3.2.1">sra-tools</requirement> <requirement type="package" version="2.8">pigz</requirement> </requirements> <version_command>fasterq-dump --version</version_command> <command detect_errors="aggressive"><![CDATA[ ## Create a clean list of accessions from the user input echo "$accession" | sed 's/,/\n/g; s/ \+/\n/g' | grep . > accessions.txt && ## Loop over each clean accession for acc in $(cat accessions.txt); do echo "Processing accession: $acc" && ## 1. Create unique directories for this accession mkdir -p sra_cache_${acc} fastq_out_${acc} && ## 2. Download the file from S3 using aws s3 cp aws s3 cp --no-sign-request "s3://sra-pub-run-odp/sra/${acc}/${acc}" ./sra_cache_${acc}/ && ## 3. Convert with fasterq-dump fasterq-dump --outdir ./fastq_out_${acc} --temp . --threads \${GALAXY_SLOTS:-4} --split-files ./sra_cache_${acc}/${acc} && ## 4. Compress with pigz pigz -p \${GALAXY_SLOTS:-4} ./fastq_out_${acc}/*.fastq && ## 5. Move outputs for collection discovery #if str($layout) == 'paired' mv ./fastq_out_${acc}/${acc}_1.fastq.gz '$output_r1.files_path/${acc}_1.fastq.gz' && mv ./fastq_out_${acc}/${acc}_2.fastq.gz '$output_r2.files_path/${acc}_2.fastq.gz' #else mv ./fastq_out_${acc}/${acc}.fastq.gz '$output_r1.files_path/${acc}.fastq.gz' #end if && ## 6. Clean up rm -rf sra_cache_${acc} fastq_out_${acc} done ]]></command> <inputs> <param name="accession" type="text" multiple="true" label="SRA Accession(s)" help="Provide one or more accession numbers (separated by commas, spaces, or newlines). This field accepts a dataset list of accessions in a workflow."/> <param name="layout" type="select" label="Read layout" help="This setting is applied to all accessions."> <option value="paired" selected="true">Paired-end (R1 + R2)</option> <option value="single">Single-end</option> </param> </inputs> <outputs> <collection name="output_r1" type="list" label="FASTQ Reads (R1) for ${accession}"> <discover_datasets pattern="(?P<designation>.+)_1\.fastq\.gz" format="fastqsanger.gz" /> </collection> <collection name="output_r2" type="list" label="FASTQ Reads (R2) for ${accession}"> <discover_datasets pattern="(?P<designation>.+)_2\.fastq\.gz" format="fastqsanger.gz" /> <filter>layout == 'paired'</filter> </collection> </outputs> <tests> <test expect_num_outputs="2"> <param name="accession" value="SRR13333333"/> <param name="layout" value="paired"/> <output_collection name="output_r1" type="list" count="1"> <element name="SRR13333333_1" ftype="fastqsanger.gz" has_text="@SRR13333333"/> </output_collection> <output_collection name="output_r2" type="list" count="1"> <element name="SRR13333333_2" ftype="fastqsanger.gz" has_text="@SRR13333333"/> </output_collection> </test> </tests> <help><![CDATA[ **NCBI SRA AWS Fetch** Fetches one or more SRA runs from the public `sra-pub-run-odp` S3 bucket and converts them to gzip-compressed FASTQ using `fasterq-dump`. This tool uses `aws s3 cp` for direct downloads within the AWS environment. ]]></help> <citations> <citation type="bibtex"> @misc{ncbi_sra_aws, title = {{NCBI} {SRA} on {AWS} Open Data}, author = {{National Center for Biotechnology Information}}, howpublished = {\\url{https://registry.opendata.aws/ncbi-sra/}}, note = {Accessed via AWS S3 without credentials} } </citation> <citation type="bibtex"> @article{sra_toolkit, title = {The {NCBI} {SRA} and portable data in biology}, author = {Leinonen, Rasko and Sugawara, Hideaki and Shumway, Martin and {International Nucleotide Sequence Database Collaboration}}, journal = {Nucleic Acids Research}, volume = {39}, number = {suppl\\\_1}, pages = {D19--D21}, year = {2011}, doi = {10.1093/nar/gkq1019} } </citation> </citations> </tool>
