Mercurial > repos > iuc > sra_tools
comparison sam_dump.xml @ 1:069a879beef7 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sra-tools commit 8550e0c7389533bebc75d7a93b89a3e59fe77bcd
| author | iuc |
|---|---|
| date | Tue, 17 May 2016 13:55:57 -0400 |
| parents | 20da3b075bbf |
| children | 6aa2efbe5920 |
comparison
equal
deleted
inserted
replaced
| 0:20da3b075bbf | 1:069a879beef7 |
|---|---|
| 1 <tool id="sam_dump" name="Extract reads" version="1.2.5"> | 1 <tool id="sam_dump" name="Extract reads" version="1.3.0"> |
| 2 <description>in SAM or BAM format from NCBI SRA.</description> | 2 <description>in SAM or BAM format from NCBI SRA.</description> |
| 3 <macros> | 3 <macros> |
| 4 <import>sra_macros.xml</import> | 4 <import>sra_macros.xml</import> |
| 5 </macros> | 5 </macros> |
| 6 <expand macro="requirements"/> | 6 <expand macro="requirements"/> |
| 7 <version_command>sam-dump --version</version_command> | 7 <version_command>sam-dump --version</version_command> |
| 8 <command> | 8 <command> |
| 9 <![CDATA[ | 9 <![CDATA[ |
| 10 #if $input.input_select=="file_list": | |
| 11 for acc in `cat $input.file_list` ; | |
| 12 do | |
| 13 #elif $input.input_select=="accession_number": | |
| 14 acc="$input.accession" && | |
| 15 #end if | |
| 16 | |
| 17 #if $input.input_select=="file_list" or $input.input_select=="accession_number": | |
| 18 [ ""\$acc" =~ ^[E|S|D]RR[0-9]{1,}$" ] && ( | |
| 19 #end if | |
| 20 | |
| 21 | |
| 22 | |
| 10 ## Need to set the home directory to the current working directory, | 23 ## Need to set the home directory to the current working directory, |
| 11 ## else the tool tries to write to home/.ncbi and fails when used | 24 ## else the tool tries to write to home/.ncbi and fails when used |
| 12 ## with a cluster manager. | 25 ## with a cluster manager. |
| 13 export HOME=\$PWD && | 26 export HOME=\$PWD && |
| 14 vdb-config --restore-defaults && | 27 vdb-config --restore-defaults && |
| 16 ## Do not use prefetch if region is specified, to avoid downloading | 29 ## Do not use prefetch if region is specified, to avoid downloading |
| 17 ## the complete sra file. | 30 ## the complete sra file. |
| 18 #if ( str( $adv.region ) == "" ): | 31 #if ( str( $adv.region ) == "" ): |
| 19 ASCP_PATH=`command -v ascp` && | 32 ASCP_PATH=`command -v ascp` && |
| 20 ASCP_KEY=`dirname \$ASCP_PATH`/asperaweb_id_dsa.openssh || true && | 33 ASCP_KEY=`dirname \$ASCP_PATH`/asperaweb_id_dsa.openssh || true && |
| 21 prefetch --ascp-path "\$ASCP_PATH|\$ASCP_KEY" "$input.accession" && | 34 prefetch --ascp-path "\$ASCP_PATH|\$ASCP_KEY" "\$acc" && |
| 22 ## Duplicate vdb-config, in case settings changed between prefetch and | 35 ## Duplicate vdb-config, in case settings changed between prefetch and |
| 23 ## dump command. | 36 ## dump command. |
| 24 vdb-config -s "/repository/user/main/public/root=\$PWD" && | 37 vdb-config -s "/repository/user/main/public/root=\$PWD" && |
| 25 #end if | 38 #end if |
| 26 sam-dump --log-level fatal --disable-multithreading | 39 sam-dump --log-level fatal --disable-multithreading |
| 48 --primary | 61 --primary |
| 49 #end if | 62 #end if |
| 50 #if $input.input_select == "file": | 63 #if $input.input_select == "file": |
| 51 "$input.file" | 64 "$input.file" |
| 52 #elif $input.input_select == "accession_number": | 65 #elif $input.input_select == "accession_number": |
| 53 "$input.accession" | 66 "\$acc" |
| 67 #elif $input.input_select=="file_list": | |
| 68 "\$acc" | |
| 54 #end if | 69 #end if |
| 70 | |
| 55 #if str( $outputformat ) == "bam": | 71 #if str( $outputformat ) == "bam": |
| 56 | samtools view -Sb - 2> /dev/null | 72 | samtools view -Sb - 2> /dev/null |
| 57 #end if | 73 #end if |
| 58 #if $input.input_select == "file": | 74 #if $input.input_select == "file": |
| 59 > "$output_file" | 75 > "$output_file" |
| 60 #elif $input.input_select == "accession_number": | 76 #elif $input.input_select == "accession_number": |
| 61 > "$output_accession" | 77 > "$output_accession" ) |
| 62 #end if | 78 #end if |
| 79 | |
| 80 #if $input.input_select=="file_list": | |
| 81 #if str( $outputformat ) == "bam": | |
| 82 > "\$acc.bam" | |
| 83 #elif str( $outputformat ) == "sam": | |
| 84 > "\$acc.sam" | |
| 85 #end if | |
| 86 ) ; done | |
| 87 #end if | |
| 88 | |
| 89 | |
| 63 ]]> | 90 ]]> |
| 64 </command> | 91 </command> |
| 65 <inputs> | 92 <inputs> |
| 66 <expand macro="input_conditional"/> | 93 <expand macro="input_conditional"/> |
| 67 <param name="outputformat" type="select" label="select output format"> | 94 <param name="outputformat" type="select" label="select output format"> |
| 84 </param> | 111 </param> |
| 85 <expand macro="minMapq"></expand> | 112 <expand macro="minMapq"></expand> |
| 86 </section> | 113 </section> |
| 87 </inputs> | 114 </inputs> |
| 88 <outputs> | 115 <outputs> |
| 116 <collection name="output_collection" type='list'> | |
| 117 <filter>input['input_select'] == "file_list"</filter> | |
| 118 <discover_datasets pattern="(?P<designation>.+)\.bam" directory="." ext='bam'/> | |
| 119 <discover_datasets pattern="(?P<designation>.+)\.sam" directory="." ext='sam'/> | |
| 120 </collection> | |
| 89 <data name="output_accession" format="bam" label="${input.accession}.${outputformat}"> | 121 <data name="output_accession" format="bam" label="${input.accession}.${outputformat}"> |
| 90 <filter>input['input_select'] == "accession_number"</filter> | 122 <filter>input['input_select'] == "accession_number"</filter> |
| 91 <change_format> | 123 <change_format> |
| 92 <when input="outputformat" value="sam" format="sam"/> | 124 <when input="outputformat" value="sam" format="sam"/> |
| 93 </change_format> | 125 </change_format> |
