view add_fst_column.xml @ 20:8a4b8efbc82c

Removed unicode from Fst_column.c
author miller-lab
date Tue, 23 Oct 2012 14:38:04 -0400
parents f04f40a36cc8
children d6b961721037
line wrap: on
line source

<tool id="gd_add_fst_column" name="Per-SNP FSTs" version="1.1.0">
  <description>: Compute a fixation index score for each SNP</description>

  <command interpreter="python">
    add_fst_column.py "$input" "$p1_input" "$p2_input" "$data_source" "$min_reads" "$min_qual" "$retain" "$discard_fixed" "$biased" "$output"
    #for $individual, $individual_col in zip($input.dataset.metadata.individual_names, $input.dataset.metadata.individual_columns)
        #set $arg = '%s:%s' % ($individual_col, $individual)
        "$arg"
    #end for
  </command>

  <inputs>
    <param name="input" type="data" format="gd_snp" label="SNP table" />
    <param name="p1_input" type="data" format="gd_indivs" label="Population 1 individuals" />
    <param name="p2_input" type="data" format="gd_indivs" label="Population 2 individuals" />

    <param name="data_source" type="select" format="integer" label="Data source">
      <option value="0" selected="true">sequence coverage</option>
      <option value="1">estimated genotype</option>
    </param>

    <param name="min_reads" type="integer" min="0" value="0" label="Minimum total read count for a population" />
    <param name="min_qual" type="integer" min="0" value="0" label="Minimum individual genotype quality" />

    <param name="retain" type="select" label="Special treatment">
      <option value="0" selected="true">Skip row</option>
      <option value="1">Set FST = -1</option>
    </param>

    <param name="discard_fixed" type="select" label="Apparently fixed SNPs">
      <option value="0">Retain SNPs that appear fixed in the two populations</option>
      <option value="1" selected="true">Delete SNPs that appear fixed in the two populations</option>
    </param>

    <param name="biased" type="select" label="FST estimator">
      <option value="0" selected="true">Wright's original definition</option>
      <option value="1">The Weir-Cockerham estimator</option>
      <option value="2">The Reich-Patterson estimator</option>
    </param>

  </inputs>

  <outputs>
    <data name="output" format="gd_snp" metadata_source="input" />
  </outputs>

  <tests>
    <test>
      <param name="input" value="test_in/sample.gd_snp" ftype="gd_snp" />
      <param name="p1_input" value="test_in/a.gd_indivs" ftype="gd_indivs" />
      <param name="p2_input" value="test_in/b.gd_indivs" ftype="gd_indivs" />
      <param name="data_source" value="0" />
      <param name="min_reads" value="3" />
      <param name="min_qual" value="0" />
      <param name="retain" value="0" />
      <param name="discard_fixed" value="1" />
      <param name="biased" value="0" />
      <output name="output" file="test_out/add_fst_column/add_fst_column.gd_snp" />
    </test>
  </tests>

  <help>

**What it does**

The user specifies a SNP table and two "populations" of individuals, both previously defined using the Galaxy tool to specify individuals from a SNP table. No individual can be in both populations. Other choices are as follows.

Data source. The allele frequencies of a SNP in the two populations can be estimated either by the total number of reads of each allele, or by adding the frequencies inferred from genotypes of individuals in the populations.

After specifying the data source, the user sets lower bounds on amount of data required at a SNP. For estimating the Fst using read counts, the bound is the minimum count of reads of the two alleles in a population. For estimations based on genotype, the bound is the minimum reported genotype quality per individual.

The user specifies whether the SNPs that violate the lower bound should be ignored or the Fst set to -1.

The user specifies whether SNPs where both populations appear to be fixed for the same allele should be retained or discarded.

Finally, the user chooses which definition of Fst to use: Wright's original definition, the Weir-Cockerham unbiased estimator, or the Reich-Patterson estimator.

A column is appended to the SNP table giving the Fst for each retained SNP.

References:

Sewall Wright (1951) The genetical structure of populations. Ann Eugen 15:323-354.

B. S. Weir and C. Clark Cockerham (1984) Estimating F-statistics for the analysis of population structure. Evolution 38:1358-1370.

Weir, B.S. 1996. Population substructure. Genetic data analysis II, pp. 161-173. Sinauer Associates, Sundand, MA.

David Reich, Kumarasamy Thangaraj, Nick Patterson, Alkes L. Price, and Lalji Singh (2009) Reconstructing Indian population history. Nature 461:489-494, especially Supplement 2.  

Their effectiveness for computing FSTs when there are many SNPs but few individuals is discussed in the followoing paper.

Eva-Maria Willing, Christine Dreyer, Cock van Oosterhout (2012) Estimates of genetic differentiation measured by FST do not necessarily require large sample sizes when using many SNP markers. PLoS One 7:e42649.

  </help>
</tool>