Tools for data conversion and results visualization for fineRADstructure (http://cichlid.gurdon.cam.ac.uk/fineRADstructure.html)
Type python finerad_input.py -h
to show the help:
usage: finerad_input.py [-h] -i FILENAME [-t DATA_TYPE] [-n MINSAMPLE]
[-o OUTFILE]
Converts haplotype data from Stacks, pyrad or ipyrad into a haplotype matrix
for analysis with fineRADstructure
(http://cichlid.gurdon.cam.ac.uk/fineRADstructure.html)
optional arguments:
-h, --help show this help message and exit
-i FILENAME, --input FILENAME
Name of the haplotypes.tsv file from Stacks, the
.alleles file from pyrad, or the .alleles.loci file
from ipyrad to be converted.
-t DATA_TYPE, --type DATA_TYPE
Source of the input file, options: stacks, pyrad,
ipyrad, default=guess
-n MINSAMPLE, --minsample MINSAMPLE
Minimum number of samples in a locus, default=2
-o OUTFILE, --output OUTFILE
Name for the output file, default=input name +
.minsample + .finerad
Example 1: Convert the .alleles.loci
matrix from ipyrad and exclude loci with less than 8 samples:
python finerad_input.py --input example_data.alleles.loci --minsample 8
984 loci for 12 samples written to example_data.alleles.loci.min8.finerad
Example 2: Convert the .haplotypes.tsv
matrix from Stacks, exclude loci with 4 samples or less and specify name of output matrix:
python finerad_input.py -i batch_1.haplotypes.tsv -n 4 --output stacks_finerad_min4.finerad
152181 loci for 37 samples written to stacks_finerad_min4.finerad
Example 3: Convert the .alleles
matrix from pyrad with default options:
python finerad_input.py -i pyrad_data.alleles
13007 loci for 170 samples written to pyrad_data.alleles.min2.finerad
-
Malinsky, M., E. Trucchi, D. Lawson & D. Falush. 2018. RADpainter and fineRADstructure: population inference from RADseq data. Molecular Biology and Evolution 35(5):1284-1290, doi:10.1093/molbev/msy023
-
A description of
fineRADstructure
and links to other relevant papers is available at: http://cichlid.gurdon.cam.ac.uk/fineRADstructure.html -
fineRADstructure
code is available at: https://github.com/millanek/fineRADstructure
- Code: Edgardo M. Ortiz