Mercurial > repos > iuc > snpeff
comparison snpeff_get_chr_names.xml @ 18:dd3622f501f3 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/snpeff commit 680a6111d751031f02233715a529a336ad4b2bf4
author | iuc |
---|---|
date | Fri, 07 Sep 2018 10:30:41 -0400 |
parents | |
children | 36dc3690a82c |
comparison
equal
deleted
inserted
replaced
17:65ae79bddc69 | 18:dd3622f501f3 |
---|---|
1 <tool id="snpEff_get_chr_names" name="SnpEff chromosome-info:" version="@wrapper_version@.galaxy1"> | |
2 <description>list chromosome names/lengths</description> | |
3 <macros> | |
4 <import>snpEff_macros.xml</import> | |
5 </macros> | |
6 <requirements> | |
7 <expand macro="requirement" /> | |
8 </requirements> | |
9 <expand macro="stdio" /> | |
10 <expand macro="version_command" /> | |
11 <command><![CDATA[ | |
12 snpEff dump | |
13 #if $snpDb.genomeSrc == 'cached': | |
14 -dataDir ${snpDb.genomeVersion.fields.path} | |
15 $snpDb.genomeVersion | |
16 #elif $snpDb.genomeSrc == 'history': | |
17 -dataDir '${snpDb.snpeff_db.extra_files_path}' | |
18 '${snpDb.snpeff_db.metadata.genome_version}' | |
19 #elif $snpDb.genomeSrc == 'custom': | |
20 -dataDir '${snpDb.snpeff_db.extra_files_path}' | |
21 -configOption '${snpDb.snpeff_db.metadata.genome_version}'.genome='${snpDb.snpeff_db.metadata.genome_version}' | |
22 '${snpDb.snpeff_db.metadata.genome_version}' | |
23 #else | |
24 -download | |
25 '$snpDb.genome_version' | |
26 #end if | |
27 | awk '/# Chromosomes/{y=1;next}y' | grep "#" | grep -E "[0-9]" | awk 'BEGIN {err=1;} {c=$0;sub(/^[^a-zA-Z0-9_]+/, "", c) && err=0; sub(/[^a-zA-Z0-9_]+/, "\t", c) && err=0; sub(/[^0-9]*$/, "", c) && err=0; print c } END {exit err}' > '$chr_names' | |
28 ]]></command> | |
29 <inputs> | |
30 <conditional name="snpDb"> | |
31 <param name="genomeSrc" type="select" label="Genome source"> | |
32 <!-- These options are referenced in the help section of SnpEff download tool. If you change them, change help of SnpEff download as well --> | |
33 <option value="cached">Locally installed snpEff database</option> | |
34 <option value="history">Downloaded snpEff database in your history</option> | |
35 <option value="named">Download on demand</option> | |
36 <option value="custom">Custom snpEff database in your history</option> | |
37 </param> | |
38 <when value="cached"> | |
39 <param name="genomeVersion" type="select" label="Genome"> | |
40 <help>This can only be used on built-in databases manually configured by your galaxy admin.</help> | |
41 <options from_data_table="snpeffv_genomedb"> | |
42 <filter type="static_value" name="snpeff_version" value="@snpeff_version@" column="1"/> | |
43 <filter type="unique_value" column="2" /> | |
44 </options> | |
45 </param> | |
46 </when> | |
47 <when value="history"> | |
48 <param name="snpeff_db" type="data" format="snpeffdb" label="@snpeff_version@ Genome Data"> | |
49 <help>This can only be used on databases in your history that were downloaded using the snpEff download tool.</help> | |
50 <options options_filter_attribute="metadata.snpeff_version" > | |
51 <filter type="add_value" value="@snpeff_version@" /> | |
52 </options> | |
53 <validator type="expression" message="This version of SnpEff will only work with @snpeff_version@ genome databases">value is not None and value.metadata.snpeff_version == "@snpeff_version@"</validator> | |
54 </param> | |
55 </when> | |
56 <when value="named"> | |
57 <param name="genome_version" type="text" value="" label="Snpff Genome Version Name (e.g. GRCh38.76)"> | |
58 <help>The list of available databases can be obtained with 'SnpEff databases' tool. If the database name is not found, locate a database here and download it in your history.</help> | |
59 <validator type="regex" message="A genome version name is required">\S+</validator> | |
60 </param> | |
61 </when> | |
62 <when value="custom"> | |
63 <param name="snpeff_db" type="data" format="snpeffdb" label="@snpeff_version@ Genome Data"> | |
64 <help>This can only be used on databases in your history that were created using the snpEff build tool.</help> | |
65 <options options_filter_attribute="metadata.snpeff_version" > | |
66 <filter type="add_value" value="@snpeff_version@" /> | |
67 </options> | |
68 <validator type="expression" message="This version of SnpEff will only work with @snpeff_version@ genome databases">value is not None and value.metadata.snpeff_version == "@snpeff_version@"</validator> | |
69 </param> | |
70 </when> | |
71 </conditional> | |
72 </inputs> | |
73 <outputs> | |
74 <data format="tabular" name="chr_names" label="Chromosome names and sizes"/> | |
75 </outputs> | |
76 <tests> | |
77 <test> | |
78 <param name="genomeSrc" value="named"/> | |
79 <param name="genome_version" value="Bacillus_subtilis_subsp_subtilis_str_168"/> | |
80 <output name="chr_names"> | |
81 <assert_contents> | |
82 <has_text text="Chromosome" /> | |
83 <has_text text="4215606" /> | |
84 </assert_contents> | |
85 </output> | |
86 </test> | |
87 <test expect_failure="True"> | |
88 <param name="genomeSrc" value="named"/> | |
89 <param name="genome_version" value="should_not_match"/> | |
90 </test> | |
91 </tests> | |
92 <help><![CDATA[ | |
93 | |
94 **What it does** | |
95 | |
96 This tool outputs a tab-delimited file of chromosome names and their lengths, as they are in the selected genome/SnpEff database. The output can be used to validate and rename chromosomes in VCF files in order to annotate its records. | |
97 | |
98 Note, make sure that the genome you select from the snpEff database precisely matches the one used in your analysis. As a cursory check, you can use the chromosome lengths in this output to match those in your reference, however the lengths can match, but the version may still differ. | |
99 | |
100 Known issue: this strategy will not work if more than 1 chromosome in the same genome has the same length. | |
101 | |
102 ------- | |
103 | |
104 .. class:: infomark | |
105 | |
106 **The usage scenario** | |
107 | |
108 Suppose you want to use snpEff to annotate a VCF file that was generated using an mouse reference with a different chromosome naming convention than in the snpEff database. To do this you can: | |
109 | |
110 #. Use `SnpEff databases` to find the precise genome name for mouse data (e.g. "mm10") as it appears in the snpEff database. | |
111 #. List the chromosome names using this tool. Either select a built-in genome, one in your history, or select "Download on demand" and enter the genome version obtained in the previous step (which only actually downloads if snpEff doesn't already have it). | |
112 #. Check that the chromosomes in the SnpEff database are the same as the reference you used (e.g. as a cursory check, ensure the chromosome lengths reported from the SnpEff database match those of your reference). | |
113 #. Edit your vcf file to replace the chromosome names with the ones the SnpEff database uses. | |
114 #. Use **SnpEff eff** and supply the edited VCF file. | |
115 | |
116 ]]></help> | |
117 <expand macro="citations" /> | |
118 </tool> |