read.PLINK
reads a data file exported by the PLINK
software with extension '.raw' and converts it into a
map.file
in read.PLINK
, or using extract.PLINKmap
to add information to an existing 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.
read.PLINK(file, map.file=NULL, quiet=FALSE, chunkSize=1000,
multicore=require("multicore"), n.cores=NULL, ...)extract.PLINKmap(file, x=NULL)
read.PLINK
a character string giving the path
to the file to convert, with the extension ".raw"; for
extract.PLINKmap
, a character string giving the path to a
file with extension ".map".extract.PLINKmap
and stored in the @other
multicore
to be installed
(see details).multicore
is TRUE, the number of cores to be
used in the computations; if NULL, then the maximum number of cores
available on the computer is used.x
, as returned by
locNames(x)
; if not - extract.PLINKmap: if a 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 information.
plink --file data --recodeA
. For more information on this
topic, please look at this webpage:
=== Using multiple cores ===
Most recent machines have one or several processors with multiple
cores. R processes usually use one single core. The package
multicore
allows for parallelizing some computations on
multiple cores, which decreases drastically computational time.
To use this functionality, you need to have the last version of the
multicore
package installed. To install it, type:
install.packages("multicore",,"http://rforge.net/",type="source")
DO NOT use the version on CRAN, which is slightly outdated.
?genlight
for a description of the class - read.snp
: read SNPs in adegenet's '.snp' format.
- fasta2genlight
: extract SNPs from alignments with
fasta format.
- other import function in adegenet: import2genind
,
df2genind
, read.genetix
read.fstat
, read.structure
,
read.genepop
.
- another function read.plink
is available in the package
snpMatrix
.