def writeMutationLog():
if sort_log_by == 1:
startSort = sorted(mutation_log, key=itemgetter(0))
else:
startSort = sorted(mutation_log, key=itemgetter(5))
print "\tWriting mutation log file: " + mut_log_outfile
try:
outfile = open(mut_log_outfile,"w")
outfile.write("START\tEND\tTYPE\tBEFORE\tAFTER\n")
for line in startSort:
outfile.write(str(line[0]) + "\t" + str(line[1]) + "\t" + line[2] + "\t" + line[3] + "\t" + line[4] + "\n")
except Exception, e:
print "Error writing mutation log. "
print e
sys.exit()
finally:
outfile.close()
##############
# writeGenome: This function will write a provided annotation file and genome file.
# The isMut parameter is a flag to modify the filename for mutated variants of the simulated genome.
##############
评论列表
文章目录