Commit 07db3cae authored by Marwan ELKREWI's avatar Marwan ELKREWI
Browse files

Update Heterozygosity_rare_male.md

parent b374613e
......@@ -57,12 +57,19 @@ We then clean the vcf file by removing the extra information on top:
```
grep -v "##" head_asex_raremale_cov5_filtered2.vcf > head_asex_raremale_cov5_filtered2_clean_kaz_genome.vcf
```
To identify the heterozygous SNPs, we use the following python commands:
To identify the SNPs that lost heterozygosity on Chromosome 1, we use the following python commands (the file AkazScaf_AsinChromLocation.txt was produced using the steps described [here](https://git.ist.ac.at/bvicoso/zsexasex2021/-/blob/master/bestlocation.md):
```
import pandas as pd
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)
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'))]
```
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