
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()
?
?
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()
?
1 個回復
?# 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","--"
贊同來自:
要回復問題請先登錄或注冊