comparison sam_dump.xml @ 23:6669afa92957 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sra-tools commit cbb1499906c801443d72bdf313d86f0182aca010
author iuc
date Sun, 22 Jan 2023 17:51:28 +0000
parents fe99dc15b7af
children
comparison
equal deleted inserted replaced
22:fe99dc15b7af 23:6669afa92957
1 <tool id="sam_dump" name="Download and Extract Reads in BAM" version="@VERSION@+galaxy0" profile="18.01"> 1 <tool id="sam_dump" name="Download and Extract Reads in BAM" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
2 <description>format from NCBI SRA</description> 2 <description>format from NCBI SRA</description>
3 <macros>
4 <import>macros.xml</import>
5 </macros>
6 <expand macro="edam_ontology"/>
3 <expand macro="bio_tools"/> 7 <expand macro="bio_tools"/>
4 <macros> 8 <expand macro="requirements"/>
5 <import>sra_macros.xml</import> 9 <version_command>sam-dump --version | tr -d $'\n'</version_command>
6 </macros> 10 <command detect_errors="exit_code"><![CDATA[
7 <expand macro="requirements">
8 <requirement type="package" version="1.10">samtools</requirement>
9 </expand>
10 <version_command>sam-dump --version</version_command>
11 <command detect_errors="exit_code">
12 <![CDATA[
13 @COPY_CONFIGFILE@ 11 @COPY_CONFIGFILE@
14 @SET_ACCESSIONS@ 12 @SET_ACCESSIONS@
15 13
16 ## Do not use prefetch if region is specified, to avoid downloading 14 ## Do not use prefetch if region is specified, to avoid downloading
17 ## the complete sra file. 15 ## the complete sra file.
18 16
19 #if $input.input_select == "file": 17 #if $input.input_select == "sra_file":
20 sam-dump --log-level fatal '${input.file.name}' 18 sam-dump --log-level fatal --accession '\$acc'
21 #else: 19 #else:
22 #if ( str( $adv.region ) == "" ): 20 #if ( str( $adv.region ) == "" ):
23 prefetch -X 200000000 "\$acc" && 21 prefetch -X 200000000 "\$acc" &&
24 #end if 22 #end if
25 sam-dump --log-level fatal --disable-multithreading 23 sam-dump --log-level fatal --disable-multithreading
43 --unaligned-spots-only 41 --unaligned-spots-only
44 #end if 42 #end if
45 #if (str( $adv.primary ) == "yes") and (str ( $adv.alignments != "unaligned") ): 43 #if (str( $adv.primary ) == "yes") and (str ( $adv.alignments != "unaligned") ):
46 --primary 44 --primary
47 #end if 45 #end if
48 #if $input.input_select == "file": 46 "\$acc"
49 '$input.file'
50 #elif $input.input_select == "accession_number":
51 "\$acc"
52 #elif $input.input_select=="file_list":
53 "\$acc"
54 #end if
55 47
56 #if str( $outputformat ) == "bam": 48 #if str( $outputformat ) == "bam":
57 | samtools view -Sb - 2> /dev/null 49 | samtools view -Sb - 2> /dev/null > "\$acc.bam"
50 #elif str( $outputformat ) == "sam":
51 > "\$acc.sam"
58 #end if 52 #end if
59 #if $input.input_select == "file": 53
60 > '$output_file' 54 #if $input.input_select != "sra_file":
61 #elif $input.input_select == "accession_number": 55 ); done;
62 > '$output_accession' )
63 #end if 56 #end if
64 57 echo "Done with all accessions."
65 #if $input.input_select=="file_list":
66 #if str( $outputformat ) == "bam":
67 > "\$acc.bam"
68 #elif str( $outputformat ) == "sam":
69 > "\$acc.sam"
70 #end if
71 ) ; done
72 #end if
73
74 ]]> 58 ]]>
75 </command> 59 </command>
76 <expand macro="configfile_hack"/> 60 <expand macro="configfile_hack"/>
77 <inputs> 61 <inputs>
78 <expand macro="input_conditional"/> 62 <expand macro="input_conditional"/>
91 </param> 75 </param>
92 <expand macro="minMapq"></expand> 76 <expand macro="minMapq"></expand>
93 </section> 77 </section>
94 </inputs> 78 </inputs>
95 <outputs> 79 <outputs>
96 <collection name="output_collection" type="list" label="SAM/BAM data (fastq-dump)"> 80 <collection name="output_collection" type="list" label="sam-dump: Downloaded SAM/BAM data">
97 <filter>input['input_select'] == "file_list"</filter> 81 <discover_datasets pattern="(?P&lt;designation&gt;.+)\.bam" directory="." ext='bam'/>
98 <discover_datasets pattern="(?P&lt;designation&gt;.+)\.bam" directory="." ext='bam'/> 82 <discover_datasets pattern="(?P&lt;designation&gt;.+)\.sam" directory="." ext='sam'/>
99 <discover_datasets pattern="(?P&lt;designation&gt;.+)\.sam" directory="." ext='sam'/>
100 </collection> 83 </collection>
101 <data name="output_accession" format="bam" label="${input.accession} (sam-dump)">
102 <filter>input['input_select'] == "accession_number"</filter>
103 <change_format>
104 <when input="outputformat" value="sam" format="sam"/>
105 </change_format>
106 </data>
107 <data name="output_file" format="bam" label="${input.file.name} (sam-dump)">
108 <filter>input['input_select'] == "file"</filter>
109 <change_format>
110 <when input="outputformat" value="sam" format="sam"/>
111 </change_format>
112 </data>
113 </outputs> 84 </outputs>
114 <tests> 85 <tests>
115 <test> 86 <test>
116 <param name="input_select" value="accession_number"/> 87 <param name="input_select" value="accession_number"/>
117 <param name="accession" value="SRR925743"/> 88 <param name="accession" value="SRR925743"/>
118 <param name="outputformat" value="sam"/> 89 <param name="outputformat" value="sam"/>
119 <param name="region" value="17:41243452-41277500"/> 90 <param name="region" value="17:41243452-41277500"/>
120 <output name="output_accession" file="sam_dump_result.sam" compare="contains" ftype="sam"/> 91 <output_collection name="output_collection" type="list" count="1">
92 <element name="SRR925743" file="SRR925743_sam_dump_result.sam" compare="contains" ftype="sam"/>
93 </output_collection>
94 </test>
95 <test>
96 <param name="input_select" value="accession_number"/>
97 <param name="accession" value="SRR925743,SRR522874"/>
98 <param name="outputformat" value="sam"/>
99 <param name="region" value="17:41243452-41277500"/>
100 <output_collection name="output_collection" type="list" count="2">
101 <element name="SRR522874" file="SRR522874_sam_dump_result.sam" compare="contains" ftype="sam"/>
102 <element name="SRR925743" file="SRR925743_sam_dump_result.sam" compare="contains" ftype="sam"/>
103 </output_collection>
121 </test> 104 </test>
122 </tests> 105 </tests>
123 <help><![CDATA[ 106 <help><![CDATA[
124 107
125 **What it does?** 108 **What it does?**
126 109
127 This tool extracts data (in BAM_ format) from the Short Read Archive (SRA) at the National Center for Biotechnology Information (NCBI). It is based on the sam-dump_ utility of the SRA Toolkit. 110 This tool extracts data (in BAM_ format) from the Short Read Archive (SRA) at the National Center for Biotechnology Information (NCBI). It is based on the sam-dump_ utility of the SRA Toolkit and returns a collection of NGS data containing one file for each accession number provided.
128 111
129 **How to use it?**
130 112
131 There are three ways in which you can download data: 113 @HOW_TO_USE_IT@
132
133 1. Data for single accession
134 2. Multiple datasets using a list of accessions
135 3. Extract data from already uploaded SRA dataset
136
137 Below we discuss each in detail.
138
139 ------
140
141 **Uploading data for a single accession**
142
143 When you type a single accession number (e.g., `SRR1582967`) into **Accession** box and click **Execute** the tool will fetch data for you. As a result you will get a single BAM (or SAM) dataset in the history.
144
145 -----
146
147 **Uploading multiple datasets using a list of accessions**
148
149 A more realistic scenario is when you want to upload a number of datasets at once. To do this you need a list of accession, where there is only one accession per line (see below for information on how to generate such a file). Once you have this file:
150
151 1. Upload it into your history using Galaxy's upload tool
152 2. Once the list of accessions is uploaded choose *List of SRA accessions, one per line* from **select input type** dropdown
153 3. Choose uploaded file within the **sra accession list** field
154 4. Click **Execute**
155
156 .. class:: warningmark
157
158 BAM datasets produced by this option will be saved in Galaxy's history as a collection_ - a single history element containing multiple datasets.
159
160 -----
161
162 **Extract data from already uploaded SRA dataset**
163
164 If a SRA dataset is present in the history, it can be converted into BAM dataset by setting **select input type** drop-down to *SRA archive in current history*. Just like in the case of extracting data for single accession number a single BAM dataset will be generated in the history.
165 114
166 @ACCESSION_LIST_HOWTO@ 115 @ACCESSION_LIST_HOWTO@
167 116
168 ----- 117 -----
169 118
119 .. _sam-dump: https://github.com/ncbi/sra-tools
170 .. _BAM: https://samtools.github.io/hts-specs/SAMv1.pdf 120 .. _BAM: https://samtools.github.io/hts-specs/SAMv1.pdf
171 .. _sam-dump: https://trace.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?view=toolkit_doc&f=sam-dump
172 .. _collection: https://galaxyproject.org/tutorials/collections/ 121 .. _collection: https://galaxyproject.org/tutorials/collections/
173 .. _link: https://trace.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?view=studies 122 .. _link: https://trace.ncbi.nlm.nih.gov/Traces/index.html?view=run_browser&display=reads
174 123
175 @SRATOOLS_ATTRRIBUTION@ 124 @SRATOOLS_ATTRRIBUTION@
176 ]]></help> 125 ]]></help>
177 <expand macro="citation"/> 126 <expand macro="citation"/>
178 </tool> 127 </tool>