tidy_genomic_data: added a check to throw an error when pop.levels != the pop.id in strata
genomic_converterincluding all thevcf2...function can now use phase/unphase genotypes. Some pyRAD vcf (e.g. v.3.0.64) have a mix of GT format with/and|. e.g. missing GT =./.and genotyped individuals =0|0. I'm not sure it follows VCF specification, but stackr can now read those vcf files.vcf2dadiis more user-friendly for scientist with in- and out-group metadata, using STACKS or not.
- Bug fix: combined use of
if (getRversion() >= "2.15.1") utils::globalVariables("variable")and@inheritParamswas not showing all the argument description.
- Update that makes my coding life easier.
- Several internal functions to convert from a tidy dataframe to:
vcf,plink,genind,genlight,gtypes,hierfstat,genepop,structureandbetadivare now separate modules available to users (look forwrite_...with the outputformat) - New function
genomic_converter: If you want the to convert from the supported input file formats to many output formats, at once, this is the function. With the new functiongenomic_converter, import and imputations are only done once, saving time if you were generating different output WITH imputations. - Change: all the
vcf2...functions (excepvcf2dadi) are now a shorcut ofgenomic_converter. This is particularly interesting and faster if you were generating different output WITH imputations. This makes the functionsvcf2...andgenomic_convertereasier to debug for me and more stable for users. - Deprecated: the
haplo2...functions are all deprecated and replaced bygenomic_converter, except haplo2colony that requires so many arguments that it would be too complicated, for now, to integrate withgenomic_converter. - New feature: when arguments
pop.select,blacklist.idandimputation.methodare used, the REF and ALT alleles are now re-computed to account for the filters and imputations.
- bug fix in
tidy_genomic_data - bug fix between stackr -> devtools -> github -> travis, [this page helped] (http://itsalocke.com/using-travis-make-sure-use-github-pat/)
- bug fix in
tidy_genomic_datawhile using data.table::melt.data.table instead of tidyr::gather, and forgot to (i) add variable.factor = FALSE when melting the vcf and (ii) use as_data_frame at the end of the melting to be able to continue working with dplyr verbs.
- Added a
NEWS.mdfile to track changes to the package. - New function:
individuals2strata. Several functions in stackr and [assigner] (https://github.com/thierrygosselin/assigner) requires astrataargument, i.e. a data frame with the individuals and associated groupings. You can do it manually, however, if your individuals have a consistent naming scheme (e.g. SPECIES-POPULATION-MATURITY-YEAR-ID = CHI-QUE-ADU-2014-020), use this function to rapidly create a strata file. - New function:
tidy_genomic_data. Transform common genomic dataset format in a tidy data frame. Used internally in stackr and [assigner] (https://github.com/thierrygosselin/assigner) and might be of interest for users. - New function:
read_long_tidy_wide. Read genomic data frames in long/tidy and wide format. Used internally in stackr and [assigner] (https://github.com/thierrygosselin/assigner) and might be of interest for users. - New function:
stackr_imputations_module. Map-independent imputation of missing genotype using Random Forest or the most frequent category. Impute genotypes or alleles. Used internally in stackr and [assigner] (https://github.com/thierrygosselin/assigner) and might be of interest for users. - New function:
find_duplicate_idCompute pairwise genome similarity to highligh potential duplicate individuals.
- dart2df_genind_plink: swiss army knife tool to prepare DArT output file (wide
or binary format) for population genetics analysis. Import, filter and transform
a DArT output file to different format: tidy data frame of genotypes, genind object
and/or PLINK
tped/tfamformat. Map-independent imputation also available.
-
vcf2plink: to easily convert a VCF file created in STACKS to a PLINK input file (tped/tfam format). This function comes with the commonly used arguments in stackr: map-independent imputation, whitelist, blacklist, common marker filtering, etc.
-
data_pruning: to prune your dataset with whitelist, blacklist of individuals, erase genotypes, use common markers and other filtering (see function argument while waiting for the upcomming documentation).
- updated the vcf_imputation function for the commonly used arguments in stackr.
- vcf2dadi: to easily convert a VCF file created in STACKS to a dadi input file. This function comes with the commonly used arguments in stackr: map-independent imputation, whitelist, blacklist, common marker filtering, etc.
- vcf2genepop: to easily convert a VCF file created in STACKS to a genepop input file. This function comes with the commonly used arguments in stackr: map-dependent imputation, whitelist, blacklist, etc. For the haplotype version, see haplo2genepop.
- 'read_stacks_vcf' can now use a whitelist or blacklist of loci that works with CHROM and/or SNP and/or LOCUS.
- 'filter_maf', 'filter_fis', 'filter_het' and 'filter_genotype_likelihood' now works by haplotypes or SNP.
Introducing several new functions:
- vcf2betadiv: to easily convert a VCF file created in STACKS to a betadiv input file.
- vcf2genind: same as haplo2genind but works with SNP instead of haplotypes.
- vcf2hierfstat: same as haplo2hierfstat but works with SNP instead of haplotypes.
Introducing haplo2gsi_sim function.
- Conversion of STACKS haplotypes file into a gsi_sim data input file.
- Markers can be subsampled.
- Map-independent imputations using Random Forest or the most frequent allele are options also available for this function.
- [gsi_sim] (https://github.com/eriqande/gsi_sim) is a tool developed by Eric C. Anderson for doing and simulating genetic stock identification.
Introducing haplo2fstat function. Conversion of STACKS haplotypes file into a hierfstat object and fstat file. Access all the functions in the R package [hierfstat] (https://github.com/jgx65/hierfstat).
Map-independent imputations of a VCF file created by STACKS. Two options are available for imputations: using Random Forest or the most frequent allele.
Before imputations, the VCF file can be filtered with:
- a whitelist of loci (to keep only specific loci...)
- a blacklist of individuals (to remove individuals or entire populations...)
- also, a list of genotypes with bad coverage and/or genotype likelihood can be supplied to erase the genotypes before imputations (for more details look at the function: blacklist_erase_genotype).
The summary_haplotypes function now outputs:
- Putative paralogs, consensus, monomorphic and polymorphic loci
- The haplotype statistics for the observed and expected homozygosity and heterozygosity
- Wright’s inbreeding coefficient (Fis)
- Proxy measure of the realized proportion of the genome that is identical by descent (IBDG). The FH measure is based on the excess in the observed number of homozygous genotypes within an individual relative to the mean number of homozygous genotypes expected under random mating (Keller et al., 2011; Kardos et al., 2015).
- Nucleotide diversity (Pi), considering the consensus loci in the catalog (i.e. reads with no variation between population). It's Nei & Li (1979) function, adapted to the GBS reality.
Keller MC, Visscher PM, Goddard ME. 2011. Quantification of inbreeding due to distant ancestors and its detection using dense single nucleotide polymorphism data. Genetics, 189, 237–249.
Kardos M, Luikart G, Allendorf FW. 2015. Measuring individual inbreeding in the age of genomics: marker-based measures are better than pedigrees. Heredity, 115, 63–72.
Nei M, Li WH. 1979. Mathematical model for studying genetic variation in terms of restriction endonucleases. Proceedings of the National Academy of Sciences of the United States of America, 76, 5269–5273.
The haplo2colony function
- Converts the file to the required COLONY input file
- Can filter the haplotypes file with a whitelist of loci and a blacklist of individuals
- Can impute the data with Random Forest or the most frequent category
- Use the print.all.colony.opt to output all COLONY options to the file. This however requires manual curation of the file to work directly with COLONY.