setFixedBias | R Documentation |
Set fixed allele read biases of valid markers
setFixedBias(object, bias, ...)
## S4 method for signature 'GbsrGenotypeData'
setFixedBias(object, bias)
object |
A GbsrGenotypeData object. |
bias |
A numeric vector of fixed allele read biases to be assigned to
valid markers. The length of |
... |
Unused. |
Since the bias set by setFixedBias()
function is the reference allele read
bias. Thus, the values 0 and 1 mean that the marker only gives alternative
and reference allele reads, respectively.
Set these fixed biases if some of your markers are dominant markers.
A GbsrGenotypeData object after adding dominant marker information
# Create a GDS file from a sample VCF file.
vcf_fn <- system.file("extdata", "sample.vcf", package = "GBScleanR")
gds_fn <- tempfile("sample", fileext = ".gds")
gbsrVCF2GDS(vcf_fn = vcf_fn, out_fn = gds_fn, force = TRUE)
# Load data in the GDS file and instantiate a [GbsrGenotypeData] object.
gds <- loadGDS(gds_fn)
# Set fixed allele read biases.
# Initialize the bias vector to be assinged.
bias <- rep(NA, nmar(gds))
# As an example, select 20 markers randomly and assign 0 or 1 to them.
# Since the bias set by setFixedBias() function is the reference allele read
# bias. Thus, the values 0 and 1 means that the marker only gives alternative
# and reference allele reads, respectively.
# Set these fixed biases if some of your markers are dominant markers.
bias[sample(seq_along(bias), 20)] <- sample(c(0, 1), 20, replace = TRUE)
gds <- setFixedBias(gds, bias = bias)
# Close the connection to the GDS file
closeGDS(gds)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.