% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/AllGenerics.R, R/Methods-GbsrGenotypeData.R
\name{getFixedBias}
\alias{getFixedBias}
\alias{getFixedBias,GbsrGenotypeData-method}
\title{Get fixed allele read biases}
\usage{
getFixedBias(object, valid = TRUE, chr = NULL, ...)

\S4method{getFixedBias}{GbsrGenotypeData}(object, valid, chr)
}
\arguments{
\item{object}{A \link{GbsrGenotypeData} object.}

\item{valid}{A logical value. See details.}

\item{chr}{A integer or string to specify chromosome to get information.}

\item{...}{Unused.}
}
\value{
A numeric vector of fixed allele read biases.

A \link{GbsrGenotypeData} object after adding dominant marker information
}
\description{
Get fixed allele read biases of markers
}
\details{
If \code{valid = TRUE}, A logical vector for the markers which are labeled \code{TRUE} in
the "valid" column of the "marker" slot will be returned. If you need check
the dominant markers in all markers, set \code{valid = FALSE}. \code{\link[=validMar]{validMar()}} tells you
which markers are valid.
}
\examples{
# 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)

fixed_bias <- getFixedBias(gds)

# Close the connection to the GDS file
closeGDS(gds)

}
\seealso{
\code{\link[=setFixedBias]{setFixedBias()}}
}
