lociInfo | R Documentation |
lociInfo object store specific information of a set of SNP markers including QTLs
This class is useful for setting the Haplotype class. (see:
haplotype
)
genoMap
[data.frame] Coordinate of all SNPs.
3 columns:
lociNames
: SNP&QTL's IDs
chr
: Chromosome holding the SNP
pos
: SNP position on the chromosome
specie
[specie class] Specie of the SNPs (see:specie)
posGeneticDist
[logical] Position is based on genetic distance or not (physical distance). If you simulate genome data, this argument will automatically be TRUE. If this argument is FALSE, 'specie$recombRateOneVal' will be TRUE.
seedSimGeno
[numeric] Seed for simulating marker genotype
founderHaplo
[matrix] Haplotype of founders (n \times m
matrix) by simulation (for real data, founderHaplo = NULL)
genoMapList
[list] Named list of dataframes with the coordinate of all SNPs. for each chromosomes
ids
[list] Named list of the SNP ids for all chromosomes
recombBetweenMarkersList
[list] Named list of matrix representing recombination between markers for each chromosome
new()
Create a new lociInfo object.
lociInfo$new( genoMap = NULL, specie, posGeneticDist = TRUE, seedSimGeno = NA, lociNames = NULL, founderNames = NULL )
genoMap
[data.frame] Coordinate of all SNPs. (needed for real data)
3 columns:
chr
: Chromosome holding the SNP
pos
: SNP position on the chromosome
lociNames
: SNP's IDs
specie
[specie class] Specie of the SNPs (see:specie)
posGeneticDist
[logical] Position is based on genetic distance or not (physical distance). If you simulate genome data, this argument will automatically be TRUE. If this argument is FALSE, 'specie$recombRateOneVal' will be TRUE.
seedSimGeno
[numeric] Random seed for simulation of marker genotype (optional)
lociNames
[character] Names of the markers used for simulated marker genotype (optional)
founderNames
[character] Names of the founders. It should be equal to ploidy * effective population size (optional)
A new 'lociInfo' object.
mySimInfo <- simInfo$new(simName = "Simulation Example", simGeno = TRUE, simPheno = TRUE, nSimGeno = 1, nSimPheno = 3, nCoreMax = 4, nCorePerGeno = 1, nCorePerPheno = 3, saveDataFileName = NULL) ### create specie information mySpec <- specie$new(nChr = 3, lChr = c(100, 150, 200), specName = "Example 1", ploidy = 2, mutRate = 10^-8, recombRate = 10^-7, recombRateOneVal = FALSE, chrNames = c("C1", "C2", "C3"), nLoci = 100, effPopSize = 100, simInfo = mySimInfo, verbose = TRUE) ### create SNP information myLoci <- lociInfo$new(genoMap = NULL, specie = mySpec, seedSimGeno = NA, lociNames = NULL, founderNames = NULL) print(myLoci)
nLoci()
Get the number of SNPs per chromosomes
lociInfo$nLoci(chr = NA)
chr
[str or numeric] chromosome id
myLoci$nLoci() myLoci$nLoci(c("C2","C3"))
getInfo()
Get information about specific SNPs
lociInfo$getInfo(lociNames)
lociNames
[str] loci ids
myLoci$getInfo("Loci_1") myLoci$getInfo(c("Loci_1", "Loci_3"))
computeRecombBetweenMarkers()
Compute named list of matrix representing recombination between markers for each chromosome
lociInfo$computeRecombBetweenMarkers()
print()
Display summary information about the object: specie, number of SNP, SNP coordinates.
lociInfo$print(fh = TRUE, fl = TRUE, rown = 6, coln = 6, rowst = 1, colst = 1)
fh
From head. If this argument is TRUE, first part (row) of data will be shown (like head() function). If FALSE, last part (row) of your data will be shown (like tail() function).
fl
From left. If this argument is TRUE, first part (column) of data will be shown (like head() function). If FALSE, last part (column) of your data will be shown (like tail() function).
rown
The number of rows shown in console.
coln
The number of columns shown in console.
rowst
The start point for the direction of row.
colst
The start point for the direction of column.
plot()
plot chromosome map using the plotly package
lociInfo$plot(alpha = 0.01)
alpha
transparency see plot_ly
myLoci$plot(alpha = 0.1)
clone()
The objects of this class are cloneable with this method.
lociInfo$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------
## Method `lociInfo$new`
## ------------------------------------------------
mySimInfo <- simInfo$new(simName = "Simulation Example",
simGeno = TRUE,
simPheno = TRUE,
nSimGeno = 1,
nSimPheno = 3,
nCoreMax = 4,
nCorePerGeno = 1,
nCorePerPheno = 3,
saveDataFileName = NULL)
### create specie information
mySpec <- specie$new(nChr = 3,
lChr = c(100, 150, 200),
specName = "Example 1",
ploidy = 2,
mutRate = 10^-8,
recombRate = 10^-7,
recombRateOneVal = FALSE,
chrNames = c("C1", "C2", "C3"),
nLoci = 100,
effPopSize = 100,
simInfo = mySimInfo,
verbose = TRUE)
### create SNP information
myLoci <- lociInfo$new(genoMap = NULL,
specie = mySpec,
seedSimGeno = NA,
lociNames = NULL,
founderNames = NULL)
print(myLoci)
## ------------------------------------------------
## Method `lociInfo$nLoci`
## ------------------------------------------------
myLoci$nLoci()
myLoci$nLoci(c("C2","C3"))
## ------------------------------------------------
## Method `lociInfo$getInfo`
## ------------------------------------------------
myLoci$getInfo("Loci_1")
myLoci$getInfo(c("Loci_1", "Loci_3"))
## ------------------------------------------------
## Method `lociInfo$plot`
## ------------------------------------------------
myLoci$plot(alpha = 0.1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.