LD calculation#
GWAS low-rank LD matrix#
Options#
- --block-info param-ref4cM_v37.pos#
- --make-block-ldm#
- --ldm ldblockFolder#
- --merge-block-ldm-info#
- --make-ldm-eigen#
- --make-eigen#
Examples#
Way 1. Generate low-rank LD matrix from blockwise full LD matrix
##Step 1. generate full LD matrices for each LD block
BayesOmics64 --bfile test --make-block-ldm
--block-info ref4cMFile --out ldblockFolder
## Step 2. after all chromosomes/blocks are done,
## run the command below to merge info files across blocks
BayesOmics64 --ldm ldblockFolder --merge-block-ldm-info \
--out ldblockFolder
## Step 3. Do eigen-decomposition for each block one by one,
## and store the result in binary format block***.eigen.bin in folder ldm
BayesOmics64 --ldm ldblockFolder --make-ldm-eigen \
--out ldblockFolder
If you want to learn more about way 1 process, go to SBayesRC tutorial website for details.
Way 2. Generate low-rank LD matrix from genotype directly
BayesOmics64 --bfile test --make-eigen \
--block-info ref4cMFile \
--out test
This option will generate three files: a text file that contains ld block information (test.eigen.ldblock.info), a text file that contains SNP information (test.eigen.ldblock.snp.info) and a binary file that contains the full LD matrix data (test.eigen.ldblock.bin).
xQTL low-rank LD matrix#
Options#
LD martrix for molecular region
- --make-eigen-gene test_besd#
- --add-gene-n geneSampleSize.txt#
The content of **geneSampleSize.txt:
ENSG00000183628 10000
ENSG00000100034 10000
......
Columns are gene ensgid id and sample size.
If you have individual sample size for each gene, you can use –add-gene-n flag to add it. if per gene sample size is missing, you can also add total sample size to besd format file by using SMR software, and BayesOmics will use total sample size for each gene. If both total and per gene sample size are missing, BayesOmics will use estimated gene sample size in the analysis.
Examples#
make a low rank LD matrix for gene
BayesOmics64 --bfile test --beqtl-summary mybesd \
--var-prop 0.9995 --make-eigen-gene test_besd \
--out test
To accelerate this process, we provide an flag --keep-one-gene
to do LD eigen-decompostion for each gene in parallel and then merge them into corresponding chromosome file.
## genearte low-rank gene LD for given gene
BayesOmics64 --bfile test \
--beqtl-summary mybesd \
--var-prop 0.9995 \
--keep-one-gene geneID \
--make-eigen-gene --out test
## merge multiple low rank gene LDs based on configure file
BayesOmics64 --eigen-list multi_eigen.txt \
--merge-eigen-gene \
--out test
- --merge-eigen-gene multi_eigen.txt#
multi_grm.txt (full paths can be specified if the LD matrix files are in different directories)
test_chr1
test_chr2
test_chr3
......
test_chr22