.bed
, .bim
, and
.fam
. This function reads these files and creates an object of
class "SnpMatrix"
read.plink(bed, bim, fam, na.strings = c("0", "-9"), sep = "." , select.subjects = NULL, select.snps = NULL)
.bed
; if it doesn't, then this extension will
be appended"SnpMatrix"
.
.fam
file,
containing the first six fields in a standard pedfile.
The row names will correspond with those of the SnpMatrix
.bim
file. the row
names correpond with the column names of the SnpMatrix
bed
argument does not contain a filename with the file
extension .bed
, then this extension is appended to the
argument. The remaining two arguments are optional; their default
values are obtained by replacing the .bed
filename extension by
.bim
and .fam
respectively. See the PLINK documentation
for the detailed specification of these files. The select.subjects
or select.snps
argument can be used
to read a subset of the data. Use of select.snps
requires that
the .bed
file is in SNP-major order (the default in
PLINK). Likewise, use of select.snps
requires that
the .bed
file is in individual-major order. Subjects are
selected by their numeric order in the PLINK files, while SNPs are
selected either by order or by name. Note that
the order of selected SNPs/subjects in the output objects
will be the same as
their order in the PLINK files.
Row names for the output SnpMatrix
object and for the
accompanying subject description dataframe are taken as the pedigree
identifiers, when these provide the required unique identifiers. When
these are duplicated, an attempt is made to use the pedigree-member
identifiers instead but, when these too are duplicated,
row names are obtained by concatenating, with a separator character, the
pedigree and pedigree-member identifiers.
write.plink
,
SnpMatrix-class
, XSnpMatrix-class