Description Usage Arguments Details Value Note Author(s) See Also Examples
Reads diallelic data in linkage "pedfile" format, with one line of data per sample (subject) containing six mandatory fields followed by pairs of fields, one pair for each locus, giving the two alleles observed.
1 | read.pedfile(file, n, snps, which, split = "\t| +", sep = ".", na.strings = "0", lex.order = FALSE)
|
file |
The input pedfile. This may be (but need not be) gzipped |
n |
(Optional) The number of lines of data to be read. If not supplied the pedfile is read once and rewound to determine how many lines it contains |
snps |
(Optional) Either a character vector giving the names of the loci,
or a single character variable giving the name of a locus
information file from which these can be read. This file is assumed
to be white-space delimited with one line per locus and no header
line. If this argument is not supplied, locus names are generated as
a numerical sequence, prefixed by |
which |
(Optional) If locus names are to be read from a file, this argument should specify which column contains the names. If not supplied, the first column giving unique locus names is used |
split |
A "regexp" specifying how the input pedfile will be split into fields. The default value specifies either a TAB character or one or more spaces |
sep |
The separator character used in constructing row and column names of
the output |
na.strings |
One or more strings to be set to |
lex.order |
If TRUE, then alleles will be allocated to internal |
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.
A list, comprising
genotypes |
The output genotype data as an object of class
|
fam |
A dataframe containing the first six fields in the
pedfile. The row names will correspond with those of the |
map |
A dataframe giving the alleles at each locus. If locus names
were obtained from a dataframe read from an existing file, then the
allele information is simply appended to this frame. Otherwise a new
dataframe is created. The row names will correspond with the column
names of the |
This function is written entirely in R and may not be particularly fast. However, it imposes no restrictions on the allele codes recognized.
Homozygous genotypes may be represented in the input file either (a)
by coding both alleles to the same value, or (b) setting the second
allele to "missing" (as specified by the missing.allele
argument). No special provision is made to read XSnpMatrix
objects; such data should first be read as a SnpMatrix
and then
coerced to an XSnpMatrix
using new
or as
.
David Clayton dc208@cam.ac.uk
SnpMatrix-class
, XSnpMatrix-class
1 2 3 | ##
## No example supplied yet
##
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.