def ref_dict_gen(self,FILEPATH=os.getcwd()):
## this function output the reference chromosome into a dict
if '/' in self.filename:
complete_path=self.filename
else:
complete_path=FILEPATH + '/' + self.filename
reader=csv.reader(open(complete_path,'rU'),delimiter=self.SEP_CHAR,quoting=csv.QUOTE_NONE)
row=reader.next()
ref_dict= dict()
while row[0][0]=="@":
if row[0][1:3]=="SQ":
ref_name=row[1][3:]
ref_length=int(row[2][3:])
ref_dict[ref_name]=ref_length
row=reader.next()
return ref_dict
评论列表
文章目录