LD scores
snp_ld_scores(
Gna,
ind.row = rows_along(Gna),
ind.col = cols_along(Gna),
size = 500,
infos.pos = NULL,
ncores = 1
)bed_ld_scores(
obj.bed,
ind.row = rows_along(obj.bed),
ind.col = cols_along(obj.bed),
size = 500,
infos.pos = NULL,
ncores = 1
)
A vector of LD scores. For each variant, this is the sum of squared correlations with the neighboring variants (including itself).
A FBM.code256
(typically <bigSNP>$genotypes
).
You can have missing values in these data.
An optional vector of the row indices (individuals) that
are used. If not specified, all rows are used.
Don't use negative indices.
An optional vector of the column indices (SNPs) that are used.
If not specified, all columns are used.
Don't use negative indices.
For one SNP, window size around this SNP to compute correlations.
Default is 500
. If not providing infos.pos
(NULL
, the default), this is
a window in number of SNPs, otherwise it is a window in kb (physical distance).
In case you provide infos.pos
in centimorgans (genetic distance),
you should divide this by 1000 because it is internally multiplied by 1000
(i.e. use 3 / 1000
for 3 cM).
Vector of integers specifying the physical position
on a chromosome (in base pairs) of each SNP.
Typically <bigSNP>$map$physical.pos
.
Number of cores used. Default doesn't use parallelism.
You may use bigstatsr::nb_cores()
.
Object of type bed, which is the mapping of some bed file.
Use obj.bed <- bed(bedfile)
to get this object.
test <- snp_attachExtdata()
G <- test$genotypes
(ld <- snp_ld_scores(G, ind.col = 1:1000))
Run the code above in your browser using DataLab