Ejemplo n.º 1
0
Archivo: Quade.py Proyecto: mablt/Quade
    def __call__(self):
        """ Main function of the script """

        start_time = time()

        print ("Start parsing files: {} chunks to be parsed".format(len(self.seq_R1)))
        # For double indexing
        if self.idx2:
            self.double_index_parser()
        # For simple indexing
        else:
            self.simple_index_parser()

        # Flush remaining content in sample buffers
        Sample.FLUSH_ALL()

        # Write a report
        print ("Generate_a csv report")
        with open ("Quade_report.csv", "wb") as report:
            report.write ("Program {}\tDate {}\n\n".format(self.VERSION,str(datetime.today())))
            for descr, value in Sample.REPORT():
                report.write ("{}\t{}\n".format(descr, value))

        print ("Done in {}s".format(round(time()-start_time, 3)))
        return(0)