Mercurial > repos > iuc > snpeff
diff snpEff_create_db.xml @ 15:479c4f2f4826 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/snpeff commit 999eca8a05f17ae567f99b8ca3394f2105491173
author | iuc |
---|---|
date | Mon, 09 Jul 2018 13:22:58 -0400 |
parents | f0ee2b470481 |
children | 65ae79bddc69 |
line wrap: on
line diff
--- a/snpEff_create_db.xml Tue Jun 12 17:31:21 2018 -0400 +++ b/snpEff_create_db.xml Mon Jul 09 13:22:58 2018 -0400 @@ -1,5 +1,5 @@ -<tool id="snpEff_build_gb" name="SnpEff build:" version="@wrapper_version@.galaxy2"> - <description> database from Genbank record</description> +<tool id="snpEff_build_gb" name="SnpEff build:" version="@wrapper_version@.galaxy3"> + <description> database from Genbank or GFF record</description> <macros> <import>snpEff_macros.xml</import> </macros> @@ -14,22 +14,42 @@ <expand macro="version_command" /> <command><![CDATA[ - #if str( $fasta.fasta_selector ) == "yes": - python3 '$__tool_directory__/gbk2fa.py' '${input_gbk}' '${output_fasta}' - #if $fasta.remove_version: - '${fasta.remove_version}' + #if str( $input_type.input_type_selector ) == "gb": + #if str( $input_type.fasta ) == "yes": + python3 '$__tool_directory__/gbk2fa.py' '${input_type.input_gbk}' '${output_fasta}' + #if $input_type.remove_version: + '${input_type.remove_version}' + #end if + && #end if - && #end if mkdir -p '${snpeff_output.files_path}'/'${genome_version}' && - ln -s '${input_gbk}' '${snpeff_output.files_path}'/'${genome_version}'/genes.gbk && + #if str( $input_type.input_type_selector ) == "gb": + #if $input_type.input_gbk.is_of_type("genbank"): + ln -s '${input_type.input_gbk}' '${snpeff_output.files_path}'/'${genome_version}'/genes.gbk && + #elif $input_type.input_gbk.is_of_type("genbank.gz"): + ln -s '${input_type.input_gbk}' '${snpeff_output.files_path}'/'${genome_version}'/genes.gbk.gz && + #end if + #elif str( $input_type.input_type_selector ) == "gff": + #if $input_type.input_fasta.is_of_type("fasta"): + ln -s '${input_type.input_fasta}' '${snpeff_output.files_path}'/'${genome_version}'/sequences.fa && + #elif $input_type.input_fasta.is_of_type("fasta.gz"): + ln -s '${input_type.input_fasta}' '${snpeff_output.files_path}'/'${genome_version}'/sequences.fa.gz && + #end if + ln -s '${input_type.input_gff}' '${snpeff_output.files_path}'/'${genome_version}'/genes.gff && + #end if snpEff @java_options@ build -v -configOption '${genome_version}'.genome='${genome_version}' -configOption '${genome_version}'.codonTable='${codon_table}' - -genbank -dataDir '${snpeff_output.files_path}' '${genome_version}' && + #if str( $input_type.input_type_selector ) == "gb": + -genbank + #elif str( $input_type.input_type_selector ) == "gff": + -gff3 + #end if + -dataDir '${snpeff_output.files_path}' '${genome_version}' && echo "${genome_version}.genome : ${genome_version}" >> '${snpeff_output.files_path}'/snpEff.config && echo "${genome_version}.codonTable : ${codon_table}" >> '${snpeff_output.files_path}'/snpEff.config @@ -38,7 +58,24 @@ <param name="genome_version" type="text" value="" label="Name for the database" help="for E. coli K12 you may want to use 'EcK12' etc."> <validator type="regex" message="A genome version name is required">\S+</validator> </param> - <param name="input_gbk" type="data" format="genbank,genbank.gz" label="Genbank dataset to build database from" help="This Genbank file will be used to generate snpEff database"/> + <conditional name="input_type"> + <param name="input_type_selector" type="select" display="radio" label="Input annotations are in" help="Specify format for annotations you are using to create SnpEff database"> + <option value="gb" selected="true">GenBank</option> + <option value="gff">GFF</option> + </param> + <when value="gb"> + <param name="input_gbk" type="data" format="genbank,genbank.gz" label="Genbank dataset to build database from" help="This Genbank file will be used to generate snpEff database"/> + <param name="fasta" type="select" display="radio" label="Parse Genbank into Fasta" help="This will generate an additional dataset containing all sequences from Genbank file in FASTA format"> + <option value="yes" selected="true">Yes</option> + <option value="no">No</option> + </param> + <param type="boolean" name="remove_version" truevalue="--remove_version" falsevalue="" checked="true" label="Remove sequence version label?" help="Genbank sequences have vesion numbers such as B000564.2. This option removes them leaving only B000564" argument="--remove_version"/> + </when> + <when value="gff"> + <param name="input_gff" type="data" format="gff3" label="GFF dataset to build database from" help="This GFF file will be used to generate snpEff database"/> + <param name="input_fasta" type="data" format="fasta,fasta.gz" label="Genome in FASTA format" help="This dataset is required for generating SnpEff database. See help section below."/> + </when> + </conditional> <param name="codon_table" type="select" label="Select genetic code for this sequence" help="If this sequence uses non-standard genetic code, select one from these options"> <option selected="true" value="Standard">Standard</option> <option value="Vertebrate_Mitochondrial">Vertebrate_Mitochondrial</option> @@ -66,61 +103,121 @@ <option value="Scenedesmus_obliquus_Mitochondrial">Scenedesmus_obliquus_Mitochondrial</option> <option value="Thraustochytrium_Mitochondrial">Thraustochytrium_Mitochondrial</option> </param> - <conditional name="fasta"> - <param name="fasta_selector" type="select" display="radio" label="Parse Genbank into Fasta" help="This will generate an additional dataset containing all sequences from Genbank file in FASTA format"> - <option value="yes" selected="true">Yes</option> - <option value="no">No</option> - </param> - <when value="yes"> - <param type="boolean" name="remove_version" truevalue="--remove_version" falsevalue="" checked="true" label="Remove sequence version label?" help="Genbank sequences have vesion numbers such as B000564.2. This option removes them leaving only B000564" argument="--remove_version"/> - </when> - <when value="no"/> - </conditional> </inputs> <outputs> <data name="snpeff_output" format="snpeffdb" label="@snpeff_version@ database for ${genome_version}"/> <data name="output_fasta" format="fasta" label="Fasta sequences for ${genome_version}"> - <filter>fasta['fasta_selector'] == 'yes'</filter> + <filter>input_type['input_type_selector'] == 'gb'</filter> + <filter>input_type['fasta'] == 'yes'</filter> </data> </outputs> <tests> <test> <param name="genome_version" value="pBR322"/> + <param name="input_type_selector" value="gb"/> <param name="input_gbk" value="pBR322.gbk" /> <output name="snpeff_output"> <assert_contents> <has_text text="pBR322" /> </assert_contents> </output> - <output name="output_fasta" value="pBR322.fna"/> + <output name="output_fasta" value="pBR322_test1.fna"/> + </test> + <test> + <param name="genome_version" value="pBR322"/> + <param name="input_type_selector" value="gb"/> + <param name="input_gbk" value="pBR322.gbk.gz" /> + <output name="snpeff_output"> + <assert_contents> + <has_text text="pBR322" /> + </assert_contents> + </output> + <output name="output_fasta" value="pBR322_test1.fna"/> + </test> + <test> + <param name="genome_version" value="pBR322"/> + <param name="input_type_selector" value="gff"/> + <param name="input_fasta" value="pBR322_test2.fna" /> + <param name="input_gff" value="pBR322.gff3" /> + <output name="snpeff_output"> + <assert_contents> + <has_text text="pBR322" /> + </assert_contents> + </output> + </test> + <test> + <param name="genome_version" value="pBR322"/> + <param name="input_type_selector" value="gff"/> + <param name="input_fasta" value="pBR322_test2.fna.gz" /> + <param name="input_gff" value="pBR322.gff3" /> + <output name="snpeff_output"> + <assert_contents> + <has_text text="pBR322" /> + </assert_contents> + </output> </test> </tests> <help><![CDATA[ **What it does** -This tool uses `"snpEff build -genbank"` command to create a snpEff database from a Genbank dataset. If **Parse Genbank into Fasta** is selected (the default behavior) the tool will also convert Genbank dataset into a single FASTA dataset. +This tool uses `"snpEff build -genbank"` or `"snpEff build -gff3"` commands to create a snpEff database. + +------ +.. class:: infomark + +**Working with Genbank files** Using Genbank data for creating databases has several advantages: - #. Genbank files contains annotations (such as locations of genes) together with sequences. This was one ensures that these two are in sync with each other - #. When you are analyzing small genomes it is much more convenient to create a database on the fly and use it. + #. Genbank files contain annotations (such as locations of genes) together with sequences. This ensures that these two are in sync with each other. + #. When you are analyzing small genomes (or not so small) it is much more convenient to create a database on the fly and use it. + + .. class:: warningmark + + SnpEff errors out on highly fragmented genomes containing multiple scaffolds. This is because a single gene may be split between multiple scaffolds causing SnpEff to crash. If this is happening use GFF route described below. + +------- + +**Genbank usage scenario** + +Suppose you have a series of Illumina reads from an experiment involving *E. coli* K-12 MG1655. You want to map these reads to the reference genome of K-12 MG1655, call variants, and annotate them using snpEff. This tool enables you to follow the following analysis steps: + + #. Go to `NCBI <http://www.ncbi.nlm.nih.gov>`_ page for K-12 MG1655 genome (note that all NCBI genomes have similar list of files associated with them). + #. Copy URL for file with extension `gbff.gz` + #. Paste the URL into upload tool and set datatype to `genbank.gz`. + #. Use this tool to generate a snpEff database and FASTA sequences from the dataset you've uploaded during the previous step. + #. Use your Illumina reads to map against FASTA dataset generated in the previous step using BWA-MEM. + #. Call variants using **Freebayes**. + #. Annotate vcf output of Freebayes with **SnpEff eff** using database generated at step 2 (using *Custom* option for **Genome source** parameter). + +In this scenario Genbank dataset is used twice. First, it is used to produce FASTA sequences that are using by BWA to map against. Second, it is used to create snpEff database. This guarantees that you will not have any issues related to reference sequence naming. ------- .. class:: infomark -**The usage scenario** +**Working with GFF files** + +Alternatively you can create a SnpEff database from `GFF3 <https://en.wikipedia.org/wiki/General_feature_format>`_ files downloaded from NCBI or any other source. Using GFF dataset for building SnpEff database requires two inputs: -Suppose you have a series of Illumina reads from an experiment involving *E. coli* K-12 MG1655. You want to map these reads to the reference genome of K-12 MG1655, call variants, and annotate them using snpEff. This tool enables you to follow the following analysis steps: + #. The GFF file itself + #. A genome in FASTA format + +The GFF file contains coordinates of various features, but does not contain underlying sequences. This is why a FASTA file needs to be provided as well. + +------ - #. Download genome from `NCBI <https://www.ncbi.nlm.nih.gov>`_ into Galaxy. - #. Use this tool to generate a snpEff database and FASTA sequences from the file you downloaded at step 1. - #. Use your Illumina reads to map against FASTA dataset generated in the previous step using BWA-MEM. - #. Call variants using **Freebayes**. - #. Annotate vcf output of Freebayes with **SnpEff eff** using database generated at step 2 (using *Custom* option for **Genome source** parameter). +**GFF usage scenario** + +The following example also uses *E. coli* K-12 MG1655: -In this scenario Genbank dataset is used twice. First, it is used to produce FASTA sequences that are using by BWA to map against. Second, it is used to create snpEff database. This guarantees that you will not have any issues related to reference sequence naming. +#. Go to `NCBI <http://www.ncbi.nlm.nih.gov>`_ page for K-12 MG1655 genome. +#. Copy URLs for files with `gff.gz` and `fna.gz` extensions. The first file contains annotations in GFF3 format. The second file contains entire genome as a FASTA record. +#. Paste URLs into upload tool and set datatypes to `gff3` and `fasta.gz` for annotations and genome, respectively. +#. Use this tool to generate a snpEff database from the GFF dataset. +#. Map your reads against the FASTA dataset and continue as described in the above example. + @snpeff_in_galaxy_info@ @external_documentation@