Reading PLINK Single Nucleotide Polymorphism data
read.PLINK reads a data file exported by the PLINK
software with extension '.raw' and converts it into a
object. Optionally, information about SNPs can be read from a ".map" file,
either by specifying the argument
extract.PLINKmap to add information to an existing
1 2 3 4
an optional object of the class
an optional character string indicating the path to a ".map"
file, which contains information about the SNPs (chromosome, position). If
provided, this information is processed by
logical stating whether a conversion messages should be printed (TRUE,default) or not (FALSE).
an integer indicating the number of genomes to be read at a time; larger values require more RAM but decrease the time needed to read the data.
a logical indicating whether multiple cores -if available-
should be used for the computations (TRUE, default), or not (FALSE);
requires the package
other arguments to be passed to other functions - currently not used.
The function reads data by chunks of several genomes (minimum 1, no maximum)
at a time, which allows one to read massive datasets with negligible RAM
requirements (albeit at a cost of computational time). The argument
chunkSize indicates the number of genomes read at a time. Increasing
this value decreases the computational time required to read data in, while
increasing memory requirements.
See details for the documentation about how to export data using PLINK to the '.raw' format.
=== Exporting data from PLINK ===
Data need to be exported from PLINK using the option "–recodeA" (and NOT
"–recodeAD"). The PLINK command should therefore look like:
--file data --recodeA. For more information on this topic, please look at
this webpage: http://pngu.mgh.harvard.edu/~purcell/plink/dataman.shtml
- read.PLINK: an object of the class
- extract.PLINKmap: if a
"genlight" is provided as argument
x, this object incorporating the new information about SNPs in the
@other slot (with new components 'chromosome' and 'position');
otherwise, a list with two components containing chromosome and position
Thibaut Jombart email@example.com
?genlight for a description of the class
read.snp: read SNPs in adegenet's '.snp' format.
fasta2genlight: extract SNPs from alignments with fasta
- other import function in adegenet:
- another function
read.plink is available in the package
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.