Description Objects from the Class Slots Extends Methods Author(s) See Also Examples
This class extends the SnpMatrix-class
to
deal with SNPs on the X and Y chromosomes and mitocondrial SNPs.
Objects can be created by calls of the form new("XSnpMatrix", x,
diploid)
.
Such objects have an additional slot
to objects of class
"SnpMatrix"
consisting of a logical array of the same length as the number of
rows. This array indicates whether genotypes in that row are diploid
(TRUE
) or haploid (FALSE
as, for example, SNPs on the X
chromosome for males).
.Data
:Object of class "matrix"
and storage mode
"raw"
diploid
:Object of class "logical"
indicating
sex of samples
Class "SnpMatrix"
, directly, with explicit coerce.
Class "matrix"
, by class "SnpMatrix"
.
Class "structure"
, by class "SnpMatrix"
.
Class "array"
, by class "SnpMatrix"
.
Class "vector"
, by class "SnpMatrix", with explicit coerce.
Class "vector"
, by class "SnpMatrix", with explicit coerce.
signature(x = "XSnpMatrix", i = "ANY", j = "ANY",
drop = "missing")
: subset extraction
signature(x = "XSnpMatrix", i = "ANY", j = "ANY", "XSnpMatrix")
: subset
assignment operation to replace part of an object
signature(from = "XSnpMatrix", to =
"character")
: map to codes 0, 1, 2, or NA
signature(from = "SnpMatrix", to =
"XSnpMatrix")
:
maps a SnpMatrix to an XSnpMatrix. Ploidy is inferred from the
genotype data since haploid genotypes should always be coded as
homozygous. After inferring ploidy, heterozygous calls for haploid
genotpes are set to NA
signature(object = "XSnpMatrix")
: map to codes
"A/A", "A/B", "B/B", "A", "B" or ""
signature(object = "XSnpMatrix")
: returns
the distribution of ploidy, together with
summaries of the data frames returned by
row.summary
and col.summary
David Clayton dc208@cam.ac.uk
1 2 3 4 5 6 7 8 9 10 11 12 13 | data(testdata)
summary(Xchromosome)
# display the first 10 snps of the first 10 samples
print(as(Xchromosome[1:10,1:10],'character'))
# convert the empty strings (no-calls) explicitly to "NC" before
# writing to an (anonymous and temporary) csv file
csvfile <- tempfile()
write.csv(file=csvfile, gsub ('^$', 'NC',
as(Xchromosome[1:10,1:10], 'character')
), quote=FALSE)
unlink(csvfile)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.