import pandas as pd
df = pd.read_csv("labuladuo_loci.txt")
quanshe = pd.read_table("北京犬舍.vcf")
loci_list = quanshe['ID'].values.tolist()
vareity_list = quanshe.columns.tolist()
score = {}
for variety in variety_list:
score[variety] = 0
quanshe.set_index(["ID"], inplace=True)
df.set_index(["ID"], inplace=True)
vareity_list.pop(2)
for locus in loci_list:
for variety in vareity_list:
if(quanshe.loc[locus,variety]==df.loc[locus,"ID"]):
score[variety] = score[variety] + 1
03-05
1339
09-23
1万+
08-18
4万+