
Last chance! 50% off unlimited learning
Sale ends in
RADdata
is used internally to generate objects of the S3 class
“RADdata” by polyRAD functions for importing read depth data.
It is also available at the user level for cases where the data for import are
not already in a format supported by polyRAD.
RADdata(alleleDepth, alleles2loc, locTable, possiblePloidies, contamRate,
alleleNucleotides)
An integer matrix, with taxa in rows and alleles in columns. Taxa names should
be included as row names. Each value indicates the number of reads for a given
allele in a given taxon. There should be no NA
values; use zero to
indicate no reads.
An integer vector with one value for each column of alleleDepth
. The
number indicates the identity of the locus to which the allele belongs. A
locus can have any number of alleles assigned to it (including zero).
A data frame, where locus names are row names. There must be at least as
many rows as the highest value of alleles2loc
; each number in
alleles2loc
corresponds to a row index in locTable
. No columns
are required, although if provided a column named “Chr” will be used for
indicating chromosome identities and a column named “Pos” will be used
for indicating physical position.
A list, where each item in the list is an integer vector (or a numeric vector
that can be converted to integer). Each vector indicates an inheritance
pattern that SNPs in the dataset might obey. 2
indicates diploid,
4
indicates autotetraploid, c(2, 2)
indicates allotetraploid,
etc.
A number ranging from zero to one (although in practice probably less than 0.01) indicating the expected sample cross-contamination rate.
A character vector with one value for each column of
alleleDepth
, indicating the DNA sequence for that allele. Typically
only the sequence at variable sites is provided, although intervening
non-variable sequence can also be provided.
An object of the S3 class “RADdata”. The following slots are available
using the $
operator:
Identical to the argument provided to the function.
Identical to the argument provided to the function.
Identical to the argument provided to the function.
The possiblePloidies
argument, converted to
integer.
A matrix with taxa in rows and loci in columns, with read
depth summed across all alleles for each locus. Column names are locus
numbers rather than locus names. See GetLocDepth
for retrieving
the same matrix but with locus names as column names.
A numeric matrix with taxa in rows and
alleles in columns. It is calculated as AddGenotypeLikelihood
).
A numeric matrix with taxa in rows and alleles in columns.
Calculated as
An integer matrix with taxa in rows and alleles in
columns. For each allele, the number of reads from the locus that do NOT
belong to that allele. Calculated as
Identical to the argument provided to the function.
The object additionally has several attributes (see attr):
A character vector listing all taxa names, in the same order as
the rows of alleleDepth
.
An integer indicating the number of taxa.
An integer indicating the number of loci in locTable
.
Identical to the argument provided to the function.
Data import functions that internally call RADdata
:
readHMC
, readTagDigger
,
VCF2RADdata
, readStacks
,
readTASSELGBSv2
# NOT RUN {
# create the dataset
mydepth <- matrix(sample(100, 16), nrow = 4, ncol = 4,
dimnames = list(paste("taxon", 1:4, sep = ""),
paste("loc", c(1,1,2,2), "_", c(0,1,0,1), sep = "")))
mydata <- RADdata(mydepth, c(1L,1L,2L,2L),
data.frame(row.names = c("loc1", "loc2"), Chr = c(1,1),
Pos = c(2000456, 5479880)),
list(2, c(2,2)), 0.001, c("A", "G", "G", "T"))
# inspect the dataset
mydata
mydata$alleleDepth
mydata$locDepth
mydata$depthRatio
# the S3 class structure is flexible; other data can be added
mydata$GPS <- data.frame(row.names = attr(mydata, "taxa"),
Lat = c(43.12, 43.40, 43.05, 43.27),
Long = -c(70.85, 70.77, 70.91, 70.95))
mydata$GPS
# If you have NA in your alleleDepth matrix to indicate zero reads,
# perform the following before running the RADdata constructor:
mydepth[is.na(mydepth)] <- 0L
# }
Run the code above in your browser using DataLab