view STACKS_denovomap.xml @ 2:c9e10e0d6c10

fix discard file
author cmonjeau
date Mon, 24 Aug 2015 15:39:12 +0000
parents d6ba40f6c824
children
line wrap: on
line source

<tool id="STACKSdenovomap" name="STACKS : De novo map"  force_history_refresh="True">
  <description>Run the STACKS denovo_map.pl wrapper</description>

<configfiles>
<configfile name="parent_sequences">
#if str( $options_usage.options_usage_selector ) == "genetic"
#for $input in $options_usage.parent_sequence:
${input.display_name}::${input}
#end for
#end if
</configfile>
<configfile name="progeny_sequences">
#if str( $options_usage.options_usage_selector ) == "genetic" and str( $options_usage.options_progeny.options_progeny_selector ) == "yes"
#for $input in $options_usage.options_progeny.progeny_sequence:
${input.display_name}::${input}
#end for
#end if
</configfile>
<configfile name="individual_samples">
#if str( $options_usage.options_usage_selector ) == "population"
#for $input in $options_usage.individual_sample:
${input.display_name}::${input}
#end for
#end if
</configfile>
</configfiles> 
 
<requirements>
    <requirement type="package" version="1.18">stacks</requirement>
</requirements>

<command interpreter="python">
STACKS_denovomap.py
#if str( $options_usage.options_usage_selector ) == "genetic"
-p $parent_sequences
-b $options_usage.paired
#if str( $options_usage.options_progeny.options_progeny_selector ) == "yes"
-r $progeny_sequences
#end if
#else
-s $individual_samples
#if str( $options_usage.options_popmap.popmap_selector) == "yes"
-O $options_usage.options_popmap.popmap
#end if
#end if
-m $advanced_options.minident
-P $advanced_options.minidentprogeny
-M $advanced_options.mismatchbetlociproc
-N $advanced_options.mismatchsecond
-n $advanced_options.mismatchbetlocibuild
-t $advanced_options.remove_hightly
-H $advanced_options.disable_calling
## snp_model
#if str( $snp_options.select_model.model_type) == "bounded"
--bound_low $snp_options.select_model.boundlow
--bound_high $snp_options.select_model.boundhigh
--alpha $snp_options.select_model.alpha
#else
--alpha $snp_options.select_model.alpha
#end if
## outputs
--catalogsnps $catalogsnps
--catalogalleles $catalogalleles
--catalogtags $catalogtags
--logfile $output
--compress_output $output_compress
##additionnal outputs
--total_output $total_output
--tags_output $tags_output
--snps_output $snps_output
--alleles_output $alleles_output
--matches_output $matches_output

</command>

<inputs>
	<conditional name="options_usage">
		<param name="options_usage_selector" type="select" label="Select your usage">
			<option value="genetic" selected="true">Genetic map</option>
			<option value="population">Population</option>
		</param>
		<when value="genetic">
			<param name="parent_sequence" format="fastq,fasta,zip,tar.gz" type="data" multiple="true" label="Files containing parent sequences" help="FASTQ/FASTA/ZIP/TAR.GZ files containing parent sequences from a mapping cross" />
			<param name="paired" type="boolean" checked="false" default="false" label="Paired-end fastq files?" help="be careful, all files must have a paired-end friend"/>
			<conditional name="options_progeny">
			<param name="options_progeny_selector" type="select" label="Use progeny files">
				<option value="yes" selected="true">Yes</option>
				<option value="no">No</option>
			</param>
			<when value="yes">
				<param name="progeny_sequence" format="fastq,fasta,zip,tar.gz" type="data" multiple="true" label="Files containing progeny sequences" help="FASTQ/FASTA/ZIP/TAR.GZ files containing progeny sequences from a mapping cross" />
			</when>
			<when value="no">
			</when>
			</conditional>
		</when>
		<when value="population">
			<param name="individual_sample" format="fastq,fasta,zip,tar.gz" type="data" multiple="true" label="Files containing an individual sample from a population" help="FASTQ/FASTA/ZIP/TAR.GZ files contiaining an individual sample from a population" />
			<conditional name="options_popmap">
				<param name="popmap_selector" type="select" label="Analyzing one or more populations?" >
					<option value="no" selected="true">No</option>		
					<option value="yes">Yes</option>
				</param>
				<when value="no"></when>
				<when value="yes">
					<param name="popmap" type="data" format="tabular,txt" label="Specify a population map" help="If analyzing one or more populations, specify a population map" />
				</when>
			</conditional>

		</when>
	</conditional>
	<!-- stack assembly options -->
	<section name="advanced_options" title="advanced_options" expanded="False">
		<param name="minident" type="integer" value="-1" label="Minimum number of identical raw reads required to create a stack" help="leave -1 if you don't use the parameter" />
		<param name="minidentprogeny" type="integer" value="-1" label="Minimum number of identical raw reads required to create a stack (progeny)" help="leave -1 if you don't use the parameter" />
		<param name="mismatchbetlociproc" type="integer" value="2" label="Number of mismatches allowed between loci when processing a single individual"/>
		<param name="mismatchsecond" type="integer" value="-1" label="Number of mismatches allowed when aligning secondary reads" help="leave -1 if you don't use the parameter" />
		<param name="mismatchbetlocibuild" type="integer" value="0" label="specify the number of mismatches allowed between loci when building the catalog"/>
		<param name="remove_hightly" type="boolean" checked="false" default="false" label="remove, or break up, highly repetitive RAD-Tags in the ustacks program" />
		<param name="disable_calling" type="boolean" checked="false" default="false" label="disable calling haplotypes from secondary reads" />
	</section>
        <!-- SNP Model options -->
	<section name="snp_options" title="SNP_Model_Options" expanded="False">
		<conditional name="select_model">
			<param name="model_type" type="select" label="Choose the model">
	                        <option value="snp" selected="true">SNP</option>
                                <option value="bounded">Bounded</option>
			</param>
                        <when value="snp">
                        	<param name="alpha" type="float" value="0.05" min="0.001" max="0.1" label="chi square significance level required to call a heterozygote or homozygote" help="either 0.1, 0.05 (default), 0.01, or 0.001" />
			</when>
                        <when value="bounded">
				<param name="boundlow" type="float" value="0.0" min="0.0" max="1.0" label="lower bound for epsilon, the error rate" help="between 0 and 1.0"/>
				<param name="boundhigh" type="float" value="1.0" min="0.0" max="1.0" label="upper bound for epsilon, the error rate" help="between 0 and 1.0" />
				<param name="alpha" type="float" value="0.05" min="0.001" max="0.1" label="chi square significance level required to call a heterozygote or homozygote" help="either 0.1, 0.05 (default), 0.01, or 0.001" />
			</when>
		</conditional>
	</section>
	<!-- Output options -->
	<param name="output_compress" type="select" label="Output type" help="please see below for details">
		<option value="default" selected="true">No compression</option>		
		<option value="categories">Compressed by categories</option>
		<option value="total">Compressed all outputs</option>
	</param>
</inputs>
<outputs>

    <data format="txt" name="output" label="result.log with ${tool.name} on ${on_string}" />
    <data format="txt" name="additional" label="additional file with ${tool.name}" hidden="true">
          <discover_datasets pattern="__designation_and_ext__" directory="galaxy_outputs" visible="true" />
    </data> 
    <data format="tabular" name="catalogsnps" label="catalog.snps with ${tool.name} on ${on_string}" />
    <data format="tabular" name="catalogalleles" label="catalog.alleles with ${tool.name} on ${on_string}" />
    <data format="tabular" name="catalogtags" label="catalog.tags with ${tool.name} on ${on_string}" />


    <!-- additionnal output archives -->
    <data format="zip" name="total_output" label="total_output.zip with ${tool.name} on ${on_string}" >
	<filter>output_compress == "total"</filter>
    </data>
    <data format="zip" name="tags_output" label="tags_output.zip with ${tool.name} on ${on_string}" >
	<filter>output_compress == "categories"</filter>
    </data>
    <data format="zip" name="snps_output" label="snps_output.zip with ${tool.name} on ${on_string}" >
	<filter>output_compress == "categories"</filter>
    </data>
    <data format="zip" name="alleles_output" label="alleles_output.zip with ${tool.name} on ${on_string}" >
	<filter>output_compress == "categories"</filter>
    </data>
    <data format="zip" name="matches_output" label="matches_output.zip with ${tool.name} on ${on_string}" >
	<filter>output_compress == "categories"</filter>
    </data>

</outputs>
<stdio>
<exit_code range="1" level="fatal" description="Error in Stacks Denovo execution" />
</stdio> 
<help>

.. class:: infomark

**What it does**

This program will run each of the Stacks components: first, running ustacks on each of the samples specified, building loci and calling SNPs in each. Second, cstacks will be run to create a catalog of all loci that were marked as 'parents' or 'samples' on the command line, and finally, sstacks will be executed to match each sample against the catalog. A bit more detail on this process can be found in the FAQ. The denovo_map.pl program will also load the results of each stage of the analysis: individual loci, the catalog, and matches against the catalog into the database (although this can be disabled). After matching, the program will build a database index to speed up access (index_radtags.pl) and enable web-based filtering. 

--------

**Created by:**

Stacks was developed by Julian Catchen with contributions from Angel Amores, Paul Hohenlohe, and Bill Cresko

--------

**Example:**

Input files:

FASTQ, FASTA, zip, tar.gz

- Population map::

    indv_01    1
    indv_02    1
    indv_03    1
    indv_04    2
    indv_05    2
    indv_06    2


Output files:

- XXX.tags.tsv file::

    Column    Name                     Description
    1         Sql ID                   This field will always be "0", however the MySQL database will assign an ID when it is loaded.
    2         Sample ID                Each sample passed through Stacks gets a unique id for that sample.
    3         Stack ID                 Each stack formed gets an ID.
    4         Chromosome               If aligned to a reference genome using pstacks, otherwise it is blank.
    5         Basepair                 If aligned to ref genome using pstacks.
    6         Strand                   If aligned to ref genome using pstacks.
    7         Sequence Type            Either 'consensus', 'primary' or 'secondary', see the Stacks paper for definitions of these terms.
    8         Sequence ID              The individual sequence read that was merged into this stack.
    9         Sequence                 The raw sequencing read.
    10        Deleveraged Flag         If "1", this stack was processed by the deleveraging algorithm and was broken down from a larger stack.
    11        Blacklisted Flag         If "1", this stack was still confounded depsite processing by the deleveraging algorithm.
    12        Lumberja ckstack Flag    If "1", this stack was set aside due to having an extreme depth of coverage.

Notes: For the tags file, each stack will start in the file with a consensus sequence for the entire stack followed by the flags for that stack. Then, each individual read that was merged into that stack will follow. The next stack will start with another consensus sequence.


- XXX.snps.tsv file::

    Column    Name                     Description
    1         Sql ID                   This field will always be "0", however the MySQL database will assign an ID when it is loaded.
    2         Sample ID                
    3         Stack ID                 
    4         SNP Column               
    5         Likelihood ratio         From the SNP-calling model.
    6         Rank_1                   Majority nucleotide.
    7         Rank_2                   Alternative nucleotide.

Notes: If a stack has two SNPs called within it, then there will be two lines in this file listing each one.


- XXX.alleles.tsv file::

    Column    Name                     Description
    1         Sql ID                   This field will always be "0", however the MySQL database will assign an ID when it is loaded.
    2         Sample ID                
    3         Stack ID                 
    4         Haplotype                The haplotype, as constructed from the called SNPs at each locus.
    5         Percent                  Percentage of reads that have this haplotype
    6         Count                    Raw number of reads that have this haplotype


- XXX.matches.tsv file::

    Column    Name                     Description
    1         Sql ID                   This field will always be "0", however the MySQL database will assign an ID when it is loaded.
    2         Batch ID                
    3         Catalog ID                 
    4         Sample ID               
    5         Stack ID         
    6         Haplotype 
    7         Stack Depth	

Notes: Each line in this file records a match between a catalog locus and a locus in an individual, for a particular haplotype. The Batch ID plus the Catalog ID together represent a unique locus in the entire population, while the Sample ID and the Stack ID together represent a unique locus in an individual sample.


- batch_X.sumstats.tsv Summary Statistics Output::

	Batch ID			The batch identifier for this data set.
	Locus ID			Catalog locus identifier.
	Chromosome			If aligned to a reference genome.
	Basepair			If aligned to a reference genome. This is the alignment of the whole catalog locus. The exact basepair reported is aligned to the location of the RAD site (depending on whether alignment is to the positive or negative strand).
	Column				The nucleotide site within the catalog locus.
	Population ID			The ID supplied to the populations program, as written in the population map file.
	P Nucleotide			The most frequent allele at this position in this population.
	Q Nucleotide			The alternative allele.
	Number of Individuals 		Number of individuals sampled in this population at this site.
	P 				Frequency of most frequent allele.
	Observed Heterozygosity		The proportion of individuals that are heterozygotes in this population.
	Observed Homozygosity 		The proportion of individuals that are homozygotes in this population.
	Expected Heterozygosity		Heterozygosity expected under Hardy-Weinberg equilibrium.
	Expected Homozygosity 		Homozygosity expected under Hardy-Weinberg equilibrium.
	pi				An estimate of nucleotide diversity.
	Smoothed pi			A weighted average of p depending on the surrounding 3s of sequence in both directions.
	Smoothed pi P-value 		If bootstrap resampling is enabled, a p-value ranking the significance of p within this population.
	FIS 				The inbreeding coefficient of an individual (I) relative to the subpopulation (S).
	Smoothed FIS 			A weighted average of FIS depending on the surrounding 3s of sequence in both directions.
	Smoothed FIS P-value		If bootstrap resampling is enabled, a p-value ranking the significance of FIS within this population.
	Private allele 			True (1) or false (0), depending on if this allele is only occurs in this population.

- batch_X.fst_Y-Z.tsv Pairwise FST Output::

	Batch ID 			The batch identifier for this data set.
	Locus ID 			Catalog locus identifier.
	Population ID 1 		The ID supplied to the populations program, as written in the population map file.
	Population ID 2 		The ID supplied to the populations program, as written in the population map file.
	Chromosome 			If aligned to a reference genome.
	Basepair 			If aligned to a reference genome. This is the alignment of the whole catalog locus. The exact basepair reported is aligned to the location of the RAD site (depending on whether alignment is to the positive or negative strand).
	Column 				The nucleotide site within the catalog locus.
	Overall pi 			An estimate of nucleotide diversity across the two populations.
	FST 				A measure of population differentiation.
	FET p-value 			P-value describing if the FST measure is statistically significant according to Fisher's Exact Test.
	Odds Ratio 			Fisher's Exact Test odds ratio
	CI High 			Fisher's Exact Test confidence interval.
	CI Low 				Fisher's Exact Test confidence interval.
	LOD Score 			Logarithm of odds score.
	Expected Heterozygosity		Heterozygosity expected under Hardy-Weinberg equilibrium.
	Expected Homozygosity 		Homozygosity expected under Hardy-Weinberg equilibrium.
	Corrected FST 			FST with either the FET p-value, or a window-size or genome size Bonferroni correction.
	Smoothed FST 			A weighted average of FST depending on the surrounding 3s of sequence in both directions.
	Smoothed FST P-value 		If bootstrap resampling is enabled, a p-value ranking the significance of FST within this pair of populations.


Instructions to add the functionality of archives management in Galaxy on the `eBiogenouest HUB wiki &lt;https://www.e-biogenouest.org/wiki/ManArchiveGalaxy&gt;`_ .

--------

**Output type:**

- Output type details::

	No compression 			All files will be added in the current history.
	Compressed by categories	Files will be compressed by categories (snps, allele, matches and tags) into 4 zip archives. These archives and batch files will be added in the current history.
	Compressed all outputs 		All files will be compressed in an unique zip archive. Batch files will be added in the current history with the archive.


--------

**Project links:**

`STACKS website &lt;http://creskolab.uoregon.edu/stacks/&gt;`_ .

`STACKS manual &lt;http://creskolab.uoregon.edu/stacks/stacks_manual.pdf&gt;`_ .

`STACKS google group &lt;https://groups.google.com/forum/#!forum/stacks-users&gt;`_ .

--------

**References:**

-J. Catchen, P. Hohenlohe, S. Bassham, A. Amores, and W. Cresko. Stacks: an analysis tool set for population genomics. Molecular Ecology. 2013.

-J. Catchen, S. Bassham, T. Wilson, M. Currey, C. O'Brien, Q. Yeates, and W. Cresko. The population structure and recent colonization history of Oregon threespine stickleback determined using restriction-site associated DNA-sequencing. Molecular Ecology. 2013.

-J. Catchen, A. Amores, P. Hohenlohe, W. Cresko, and J. Postlethwait. Stacks: building and genotyping loci de novo from short-read sequences. G3: Genes, Genomes, Genetics, 1:171-182, 2011.

-A. Amores, J. Catchen, A. Ferrara, Q. Fontenot and J. Postlethwait. Genome evolution and meiotic maps by massively parallel DNA sequencing: Spotted gar, an outgroup for the teleost genome duplication. Genetics, 188:799'808, 2011.

-P. Hohenlohe, S. Amish, J. Catchen, F. Allendorf, G. Luikart. RAD sequencing identifies thousands of SNPs for assessing hybridization between rainbow trout and westslope cutthroat trout. Molecular Ecology Resources, 11(s1):117-122, 2011.

-K. Emerson, C. Merz, J. Catchen, P. Hohenlohe, W. Cresko, W. Bradshaw, C. Holzapfel. Resolving postglacial phylogeography using high-throughput sequencing. Proceedings of the National Academy of Science, 107(37):16196-200, 2010.

--------

**Integrated by:**

Yvan Le Bras and Cyril Monjeaud 

GenOuest Bio-informatics Core Facility

UMR 6074 IRISA INRIA-CNRS-UR1 Rennes (France)

support@genouest.org

</help>
<citations>
    <citation type="doi">10.1111/mec.12354</citation>
    <citation type="doi">10.1111/mec.12330</citation>
    <citation type="doi">10.1534/g3.111.000240</citation>
    <citation type="doi">10.1534/genetics.111.127324</citation>
    <citation type="doi">10.1111/j.1755-0998.2010.02967.x</citation>
    <citation type="doi">10.1073/pnas.1006538107</citation>

    <citation type="bibtex">@INPROCEEDINGS{JOBIM2013,
    author = {Le Bras, Y. and ROULT, A. and Monjeaud, C. and Bahin, M. and Quenez, O. and Heriveau, C. and Bretaudeau, A. and Sallou, O. and Collin, O.},
    title = {Towards a Life Sciences Virtual Research Environment: An e-Science initiative in Western France},
    booktitle = {JOBIM 2013 Proceedings},
    year = {2013},
    url = {https://www.e-biogenouest.org/resources/128},
    pages = {97-106}
    }</citation>
</citations>
</tool>