bed_cprodVec {bigsnpr} | R Documentation |
Cross-product with a vector
Description
Cross-product between a "bed" object and a vector.
Missing values are replaced by 0 (after centering), as if they
had been imputed using parameter center
.
Usage
bed_cprodVec(
obj.bed,
y.row,
ind.row = rows_along(obj.bed),
ind.col = cols_along(obj.bed),
center = rep(0, length(ind.col)),
scale = rep(1, length(ind.col)),
ncores = 1
)
Arguments
obj.bed |
Object of type bed, which is the mapping of some bed file.
Use |
y.row |
A vector of same size as |
ind.row |
An optional vector of the row indices (individuals) that
are used. If not specified, all rows are used. |
ind.col |
An optional vector of the column indices (SNPs) that are used.
If not specified, all columns are used. |
center |
Vector of same length of |
scale |
Vector of same length of |
ncores |
Number of cores used. Default doesn't use parallelism. You may use nb_cores. |
Value
X^T \cdot y
.
Examples
bedfile <- system.file("extdata", "example.bed", package = "bigsnpr")
obj.bed <- bed(bedfile)
y.row <- rep(1, nrow(obj.bed))
str(bed_cprodVec(obj.bed, y.row))