fuji246 fuji246 综合讨论组

Import AncestryDNA Data失败

我在 MyHeritage做过检测,有raw数据,把那个转换成​AncestryDNA的数据格式,但是上传到wegene失败,看那个raw数据格式就是简单的csv数据,我也参考过github上面的格式转换的项目,但是不知道为什么上传到wegene会失败。
 

f = open('MyHeritage_raw_dna_data.csv')
f1 = open('MyHeritage_raw_dna_data.txt', 'w')
i = 0
for line in f.readlines():
    #print(line)
    if line == "" or line[0] == '#':
        continue
    elif 'RSID,CHROMOSOME,POSITION,RESULT' in line:
        f1.write('rsid\tchromosome\tposition\tallele1\tallele2\n')
    else:
        rsid, chromosome, position, result = map(lambda x: x[1:-1], line.strip().split(','))
        allele1 = result[0] if result[0] != '-' else 0
        allele2 = result[1] if result[1] != '-' else 0
        f1.write('%s\t%s\t%s\t%s\t%s\n' % (rsid, chromosome, position, allele1, allele2))
        i += 1

print('export complete, total %d records' % i)

f1.close()
f.close()
 
2018-04-21 • IP属地美国
按热门排序    按默认排序

1 个回复

MyHeritage的格式如下:
 # MyHeritage DNA raw data. 
# This file was generated on 2018-03-08 00:50:25 
# For each SNP, we provide the identifier, chromosome number, base pair position and genotype.The genotype is reported on the forward (+) strand with respect to the human reference build 37. 
# THIS INFORMATION IS FOR YOUR PERSONAL USE AND IS INTENDED FOR GENEALOGICAL RESEARCH 
# ONLY. IT IS NOT INTENDED FOR MEDICAL OR HEALTH PURPOSES. PLEASE BE AWARE THAT THE 
# DOWNLOADED DATA WILL NO LONGER BE PROTECTED BY OUR SECURITY MEASURES.
RSID,CHROMOSOME,POSITION,RESULT
"rs4477212","1","82154","AA"
"rs3094315","1","752566","--"
"rs3131972","1","752721","GG"
"rs12562034","1","768448","--"

要回复问题请先登录注册