Commit 2e4401c1 authored by zhanxw's avatar zhanxw

Merge branch 'master' of https://github.com/zhanxw/rvtests

parents d2b292b9 72ab2236
......@@ -546,6 +546,13 @@ To generate empirical kinship (`--inVcf`) on both autosomal region and X chromos
NOTE: you need to provide a pedigree file (PED) in the above case, as `vcf2kinship` needs the sex information of samples to construct kinship for sex chromosome.
For modern genetic datasets, genotype data is often stored by chromosomes, with each chromosome stored in a separate VCF file. In this case, kinship matrix can be first calcualted separately for each chromosome, and then combined using the python script [combineKinship.py](https://github.com/zhanxw/rvtests/tree/master/misc). Specifically, if you generated two kinship matrices for chr1 chr2 (chr1.kinship, and chr2.kinship), you can run the python script to combine them, i.e.
```
python combineKinship.py -o prefix chr1.kinship chr2.kinship
```
The resulting kinship matrix is equivalent to the kinship matrix calculated using the merged vcf files.
# Resources
## UCSC RefFlat Genes
......
#!/usr/bin/env python
import sys, os, re
try:
from XiaoweiLib import myopen
except:
sys.path = [re.sub(r'^/home/zhanxw/', '/net/fantasia/home/zhanxw/', x) for x in sys.path]
sys.path.append('/net/nfsb/fantasia/home/zhanxw/mylib/Python/')
from XiaoweiLib import myopen
# convenient functions
def myopen(fn):
import gzip
f = gzip.open(fn)
try:
f.read(2)
f.close()
return gzip.open(fn)
except:
f.close()
return open(fn)
def usage():
print("%s -o prefix in1.kinship in2.kinship ..." % sys.argv[0] )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment