comparison fsd.py @ 44:a76af7fd9fca draft

planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
author mheinzl
date Wed, 14 Aug 2019 13:03:14 -0400
parents f72593bcc8ee
children 6651e76baca1
comparison
equal deleted inserted replaced
43:f72593bcc8ee 44:a76af7fd9fca
549 549
550 pdf.savefig(fig) 550 pdf.savefig(fig)
551 plt.close() 551 plt.close()
552 552
553 # write same information to a csv file 553 # write same information to a csv file
554 count = numpy.bincount(integers) # original counts of family sizes 554 count = numpy.bincount(data_o) # original counts of family sizes
555 output_file.write("\nDataset:{}{}\n".format(sep, name_file)) 555 output_file.write("\nDataset:{}{}\n".format(sep, name_file))
556 output_file.write("max. family size:{}{}\n".format(sep, max(integers))) 556 output_file.write("max. family size:{}{}\n".format(sep, max(data_o)))
557 output_file.write("absolute frequency:{}{}\n".format(sep, count[len(count) - 1])) 557 output_file.write("absolute frequency:{}{}\n".format(sep, count[len(count) - 1]))
558 output_file.write("relative frequency:{}{:.3f}\n\n".format(sep, float(count[len(count) - 1]) / sum(count))) 558 output_file.write("relative frequency:{}{:.3f}\n\n".format(sep, float(count[len(count) - 1]) / sum(count)))
559 559
560 output_file.write("median family size:{}{}\n".format(sep, numpy.median(numpy.array(integers)))) 560 output_file.write("median family size:{}{}\n".format(sep, numpy.median(numpy.array(data_o))))
561 output_file.write("mean family size:{}{}\n\n".format(sep, numpy.mean(numpy.array(integers)))) 561 output_file.write("mean family size:{}{}\n\n".format(sep, numpy.mean(numpy.array(data_o))))
562 562
563 output_file.write("{}singletons:{}{}{}family size > 20:{}{}{}{}length of dataset:\n".format(sep, sep, sep, sep, sep, sep, sep, sep)) 563 output_file.write("{}singletons:{}{}{}family size > 20:{}{}{}{}length of dataset:\n".format(sep, sep, sep, sep, sep, sep, sep, sep))
564 output_file.write("{}nr. of tags{}rel. freq of tags{}rel.freq of PE reads{}nr. of tags{}rel. freq of tags{}nr. of PE reads{}rel. freq of PE reads{}total nr. of tags{}total nr. of PE reads\n".format(sep, sep, sep, sep, sep, sep, sep, sep, sep)) 564 output_file.write("{}nr. of tags{}rel. freq of tags{}rel.freq of PE reads{}nr. of tags{}rel. freq of tags{}nr. of PE reads{}rel. freq of PE reads{}total nr. of tags{}total nr. of PE reads\n".format(sep, sep, sep, sep, sep, sep, sep, sep, sep))
565 output_file.write("{}{}{}{}{:.3f}{}{:.3f}{}{}{}{:.3f}{}{}{}{:.3f}{}{}{}{}\n\n".format( 565 output_file.write("{}{}{}{}{:.3f}{}{:.3f}{}{}{}{:.3f}{}{}{}{:.3f}{}{}{}{}\n\n".format(
566 name_file, sep, singl.astype(int), sep, singl / len(data), sep, float(singl)/sum(data_o), sep, 566 name_file, sep, singl.astype(int), sep, singl / len(data), sep, float(singl)/sum(data_o), sep,