Commit 2aba7eee authored by Marwan ELKREWI's avatar Marwan ELKREWI
Browse files

Update Heterozygosity_rare_male.md

parent 07db3cae
......@@ -64,12 +64,14 @@ import numpy as np
import matplotlib.pyplot as plt
import scipy
import os
loss_new_notsimple=pd.read_csv("head_asex_raremale_cov5_filtered2_clean_chr1.vcf",sep="\t")
loss_new_notsimple[['GTs','PLs','DPs','SPs','ADs','GPs','GQs']]=loss_new_notsimple['asexsister_Aibi_Aligned.sortedByCoord.out.bam'].str.split(':',expand=True)
loss_new_notsimple[['GTb','PLb','DPb','SPb','ADb','GPb','GQb']]=loss_new_notsimple['raremale_Aibi_Aligned.sortedByCoord.out.bam'].str.split(':',expand=True)
loh=pd.read_csv("head_asex_raremale_cov5_filtered2_clean_chr1.vcf",sep="\t")
loh[['GTs','PLs','DPs','SPs','ADs','GPs','GQs']]=loh['asexsister_Aibi_Aligned.sortedByCoord.out.bam'].str.split(':',expand=True)
loh[['GTb','PLb','DPb','SPb','ADb','GPb','GQb']]=loss_new_notsimple['raremale_Aibi_Aligned.sortedByCoord.out.bam'].str.split(':',expand=True)
col_n=['scaffold','LG','Location','Support','Match']
akaz_vs_asin=pd.read_csv("AkazScaf_AsinChromLocation.txt",sep="\t",header=None,names=col_n)
akaz_vs_asin_2=akaz_vs_asin[(akaz_vs_asin['LG']=="1") & (akaz_vs_asin['Support']>=1)]
merged= pd.merge(left=akaz_vs_asin_2, right=loss_new_notsimple, left_on='scaffold', right_on='CHROM').sort_values(by=['Location'])
loss_new_notsimple_3=merged[((merged['GTs']=='0/1') & (merged['GTb']=='0/0')) | ((merged['GTs']=='0/1') & (merged['GTb']=='1/1'))]
merged= pd.merge(left=akaz_vs_asin_2, right=loh, left_on='scaffold', right_on='CHROM').sort_values(by=['Location'])
loh_3=merged[((merged['GTs']=='0/1') & (merged['GTb']=='0/0')) | ((merged['GTs']=='0/1') & (merged['GTb']=='1/1'))]
x1,y1,_=plt.hist(loh_3['Location'],bins=np.arange(0,102000000,500000)) #histogram of SNPs that lost heterozygosity
x2,y2,_=plt.hist(merged['Location'],bins=np.arange(0,102000000,500000)) #histogram of all SNPs
```
Supports Markdown
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