Mercurial > repos > iuc > sra_tools
comparison macros.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 | |
| children | daa96f1e546c |
comparison
equal
deleted
inserted
replaced
| 22:fe99dc15b7af | 23:6669afa92957 |
|---|---|
| 1 <macros> | |
| 2 <token name="@TOOL_VERSION@">3.0.0</token> | |
| 3 <token name="@VERSION_SUFFIX@">0</token> | |
| 4 <token name="@PROFILE@">22.01</token> | |
| 5 <xml name="edam_ontology"> | |
| 6 <edam_topics> | |
| 7 <edam_topic>topic_0622</edam_topic> <!-- Genomics --> | |
| 8 <edam_topic>topic_0091</edam_topic> <!-- Bioinformatics --> | |
| 9 </edam_topics> | |
| 10 <edam_operations> | |
| 11 <edam_operation>operation_2422</edam_operation> <!-- Data retrieval --> | |
| 12 <edam_operation>operation_0335</edam_operation> <!-- Formatting --> | |
| 13 </edam_operations> | |
| 14 </xml> | |
| 15 <macro name="requirements"> | |
| 16 <requirements> | |
| 17 <requirement type="package" version="@TOOL_VERSION@">sra-tools</requirement> | |
| 18 <requirement type="package" version="2.6">pigz</requirement> | |
| 19 <requirement type="package" version="1.16.1">samtools</requirement> | |
| 20 <yield/> | |
| 21 </requirements> | |
| 22 </macro> | |
| 23 <token name="@ACCESSIONS_FROM_FILE@"> | |
| 24 grep '^[[:space:]]*[E|S|D]RR[0-9]\{1,\}[[:space:]]*$' | |
| 25 </token> | |
| 26 <token name="@COMPRESS@"><![CDATA[pigz -cqp \${GALAXY_SLOTS:-1}]]></token> | |
| 27 <token name="@CONFIGURE_RETRY@"><![CDATA[ | |
| 28 export SRA_PREFETCH_RETRIES=3 && | |
| 29 export SRA_PREFETCH_ATTEMPT=1 && | |
| 30 ]]></token> | |
| 31 <xml name="bio_tools"> | |
| 32 <xrefs> | |
| 33 <xref type="bio.tools">sra-tools</xref> | |
| 34 </xrefs> | |
| 35 </xml> | |
| 36 <token name="@COPY_CONFIGFILE@"><![CDATA[ | |
| 37 mkdir -p ~/.ncbi && | |
| 38 cp '$user_settings_mkfg' ~/.ncbi/user-settings.mkfg && | |
| 39 vdb-config -s "/repository/user/main/public/root=\$PWD" && | |
| 40 vdb-config -s "/repository/user/ad/public/root=\$PWD" && | |
| 41 vdb-config -s "/repository/user/default-path=\$PWD" && | |
| 42 vdb-config -s "/repository/user/main/public/root=\$PWD" && | |
| 43 vdb-config -s /http/timeout/read=10000 && | |
| 44 ]]></token> | |
| 45 <token name="@SET_ACCESSIONS@"><![CDATA[ | |
| 46 #if $input.input_select == "sra_file": | |
| 47 acc='${input.sra_file.name}' && | |
| 48 ln -s '${input.sra_file}' "\$acc" && | |
| 49 #else | |
| 50 #if $input.input_select == "file_list": | |
| 51 #if $input.file_list.is_of_type('sra_manifest.tabular'): | |
| 52 #set $column = $input.file_list.unsanitized.metadata.column_names.index('Run') + 1 | |
| 53 cut -f $column '$input.file_list'| tail -n +2 > accessions && | |
| 54 #else | |
| 55 @ACCESSIONS_FROM_FILE@ '$input.file_list' > accessions && | |
| 56 #end if | |
| 57 #elif $input.input_select == "accession_number": | |
| 58 echo '${input.accession}' | sed -r 's/(\,|\;|__cn__)/\n/g' > accessions && | |
| 59 #end if | |
| 60 for acc in \$(cat ./accessions); | |
| 61 do ( | |
| 62 echo "Downloading accession: \$acc..." && | |
| 63 #end if | |
| 64 ]]></token> | |
| 65 <macro name="configfile_hack"> | |
| 66 <configfiles> | |
| 67 <configfile name="user_settings_mkfg"><![CDATA[ | |
| 68 /LIBS/GUID = "3cdc38d0-711a-49ce-9536-f544eaf69eec" | |
| 69 /config/default = "false" | |
| 70 /libs/temp_cache = "." | |
| 71 /tools/prefetch/download_to_cache = "false" | |
| 72 ]]></configfile> | |
| 73 </configfiles> | |
| 74 </macro> | |
| 75 <macro name="sanitize_query"> | |
| 76 <sanitizer> | |
| 77 <valid initial="string.printable"> | |
| 78 <remove value=" "/> | |
| 79 <remove value="'" /> | |
| 80 </valid> | |
| 81 <mapping initial="none"> | |
| 82 <add source=" " target=""/> | |
| 83 <add source="'" target="'"'"'"/> | |
| 84 </mapping> | |
| 85 </sanitizer> | |
| 86 </macro> | |
| 87 <macro name="input_conditional"> | |
| 88 <conditional name="input"> | |
| 89 <param name="input_select" type="select" label="select input type"> | |
| 90 <option value="accession_number">SRR accession</option> | |
| 91 <option value="file_list">List of SRA accession, one per line</option> | |
| 92 <option value="sra_file">SRA archive in current history</option> | |
| 93 </param> | |
| 94 <when value="accession_number"> | |
| 95 <param name="accession" type="text" label="Accession" multiple="true" help="Must start with SRR, DRR or ERR, e.g. SRR925743, ERR343809"> | |
| 96 <expand macro="sanitize_query"/> | |
| 97 <validator type="empty_field" message="An accession is required"/> | |
| 98 </param> | |
| 99 </when> | |
| 100 <when value="sra_file"> | |
| 101 <param format="sra" name="sra_file" type="data" label="sra archive"/> | |
| 102 </when> | |
| 103 <when value="file_list"> | |
| 104 <param format="txt" name="file_list" type="data" label="sra accession list"/> | |
| 105 </when> | |
| 106 </conditional> | |
| 107 </macro> | |
| 108 <macro name="alignments"> | |
| 109 <param name="alignments" type="select" value="both" label="Output aligned or unaligned reads" help="Output reads according to their alignment status." argument="--aligned and --unaligned"> | |
| 110 <option value="both">both</option> | |
| 111 <option value="aligned">aligned only</option> | |
| 112 <option value="unaligned">unaligned only</option> | |
| 113 </param> | |
| 114 </macro> | |
| 115 <macro name="minMapq"> | |
| 116 <param name="minMapq" type="integer" min="0" max="42" label="Minimum mapping quality" optional="true" help="Minimum mapping quality an alignment has to have, to be dumped." argument="--min-mapq"/> | |
| 117 </macro> | |
| 118 <macro name="region"> | |
| 119 <param format="text" name="region" type="text" label="aligned region" optional="true" | |
| 120 help="Filter by position on genome. Can be either accession.version (ex: NC_000001.10), chromosome name (ex:chr1 or 1) or 1-based coordinates (ex: chr1:1-101)." argument="--aligned-region"/> | |
| 121 </macro> | |
| 122 <macro name="matepairDist"> | |
| 123 <param name="matepairDist" type="text" label="mate-pair distance (from-to|unknown)" optional="true" | |
| 124 help="Filter by distance between matepairs. Use unknown to find matepairs split between the references. Use from-to (inclusive) to limit matepair distance on the same reference" argument="--matepair-distance"/> | |
| 125 </macro> | |
| 126 <macro name="citation"> | |
| 127 <citations> | |
| 128 <citation type="doi">10.1093/nar/gkq1019</citation> | |
| 129 <citation type="bibtex"> | |
| 130 @misc{github_sratools, | |
| 131 author = {NCBI}, | |
| 132 title = {sra-tools}, | |
| 133 publisher = {GitHub}, | |
| 134 journal = {GitHub repository}, | |
| 135 url = {https://github.com/ncbi/sra-tools}, | |
| 136 }</citation> | |
| 137 </citations> | |
| 138 </macro> | |
| 139 <token name="@HOW_TO_USE_IT@"> | |
| 140 **How to use it?** | |
| 141 | |
| 142 There are three ways in which you can download data: | |
| 143 | |
| 144 1. Plain text input of accession number(s) | |
| 145 2. Providing a list of accessions from file | |
| 146 3. Extracting data from an already uploaded SRA dataset | |
| 147 | |
| 148 Below we discuss each in detail. | |
| 149 | |
| 150 ------ | |
| 151 | |
| 152 **Plain text input of accession number(s)** | |
| 153 | |
| 154 When you type an accession number (e.g., `SRR1582967`) into **Accession** box and click **Execute** the tool will fetch the data for you. You can also provide a list of multiple accession numbers (e.g. `SRR3141592, SRR271828, SRR112358`). | |
| 155 | |
| 156 ----- | |
| 157 | |
| 158 **Providing a list of accessions from file** | |
| 159 | |
| 160 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: | |
| 161 | |
| 162 1. Upload it into your history using Galaxy's upload tool | |
| 163 2. Once the list of accessions is uploaded choose *List of SRA accessions, one per line* from **select input type** dropdown | |
| 164 3. Choose uploaded file within the **sra accession list** field | |
| 165 4. Click **Execute** | |
| 166 | |
| 167 ----- | |
| 168 | |
| 169 **Extract data from an already uploaded SRA dataset** | |
| 170 | |
| 171 If an SRA dataset is already present in the history, the sequencing data can be extracted in a human-readable data format (fastq, sam, bam) by setting **select input type** drop-down to *SRA archive in current history*. | |
| 172 </token> | |
| 173 <token name="@ACCESSION_LIST_HOWTO@"> | |
| 174 ----- | |
| 175 | |
| 176 **How to generate accession lists** | |
| 177 | |
| 178 1. Go to **SRA Run Selector** by clicking this link_ | |
| 179 2. Find the study you are interested in by typing a search term within the **Search** box. This can be a word (e.g., *mitochondria*) or an accession you have gotten from a paper (e.g., *SRR1582967*). | |
| 180 3. Once you click on the study of interest you will see the number of datasets in this study within the **Related SRA data** box | |
| 181 4. Click on the Runs number | |
| 182 5. On the page that would open you will see **Accession List** button | |
| 183 6. Clicking of this button will produce a file that you will need to upload into Galaxy and use as the input to this tool. | |
| 184 </token> | |
| 185 <token name="@SRATOOLS_ATTRRIBUTION@"> | |
| 186 For credits, information, support and bug reports, please refer ato https://github.com/galaxyproject/tools-iuc. | |
| 187 </token> | |
| 188 </macros> |
