Esempio n. 1
0
def main():
    args = get_arguments()
    config = utils.get_config()
    print config["count"]
    phamgene.check_protein_db(config["count"])
    # --Phamerated and only one gene
    if args.gene_number != -1 and args.phage is not None and args.unphamed is False:
        gene = report.GeneReport(args.phage, args.gene_number, True)
        print gene
        gene.get_pham()
        gene.make_report()
        final_file, s = gene.merge_report()

    # --Unphameratored Phage with only one gene
    elif args.given_start > -1 and args.phage is not None and args.unphamed is True:
        # given start and stop coordinates and orientation
        one_or_all = 'One'
        given_start = args.given_start
        given_stop = args.given_stop
        given_orientation = args.given_orientation
        gene_name = args.phage + '_' + str(args.gene_number)
        gene = report.GeneReport(args.phage,
                                 args.gene_number,
                                 fasta_file=args.fasta)
        gene.make_unpham_gene(given_start, given_stop, given_orientation)
        print gene
        gene.make_report()
        final_file, s = gene.merge_report()

    # --Phameratored or Unphameratored Phages with all genes
    elif args.pham_no == -1 and args.phage is not None and args.unphamed is False:
        phage = report.PhageReport(args.phage, gui=None)
        final_file, short_final = phage.final_report()

    elif args.pham_no == -1 and args.phage is not None and args.unphamed is True:
        phage = report.UnPhamPhageReport(args.phage,
                                         fasta_file=args.fasta,
                                         profile_file=args.profile,
                                         gui=None)
        final_file, short_final = phage.final_report()
    elif args.phage is None:
        pham = report.PhamReport(args.pham_no)
        if args.save_json is True:
            final_file, short_final = pham.final_report(save_json=True)
        else:
            final_file, short_final = pham.final_report()
Esempio n. 2
0
 def starterate(self, button):
     db = self.db_connect()
     phamgene.check_protein_db(self.config_info['count'])
     phage_name = self.find_phage_in_db(db, str(self.info['phage']))
     print 'uiStarterate.starterate new phage, name is ', self.info['phage']
     print 'uiStarterate.starterate phamerated is ', self.info['phamerated']
     print 'uiStarterate.starterate self.info.all is ', self.info['all']
     if phage_name == None and self.info["phamerated"] and not self.info["pham"]:
         self.phameratored_exception(self.info["phage"])
         return
     elif self.info["phamerated"]:
         self.info["phage"] = phage_name
     self.progress_label = Gtk.Label('Starterator is starting')
     self.progress_bar = Gtk.ProgressBar()
     self.box.pack_start(self.progress_label, False, False, 0)
     self.box.pack_start(self.progress_bar, False, False, 0)
     self.show_all()
     self.starterate_thread = StarteratorThread(self, db, self.config_info, self.info)
     self.starterate_thread.start()
Esempio n. 3
0
 def starterate(self, button):
     db = self.db_connect()
     phamgene.check_protein_db(self.config_info['count'])
     phage_name = self.find_phage_in_db(db, str(self.info['phage']))
     print 'uiStarterate.starterate new phage, name is ', self.info['phage']
     print 'uiStarterate.starterate phamerated is ', self.info['phamerated']
     print 'uiStarterate.starterate self.info.all is ', self.info['all']
     if phage_name == None and self.info[
             "phamerated"] and not self.info["pham"]:
         self.phameratored_exception(self.info["phage"])
         return
     elif self.info["phamerated"]:
         self.info["phage"] = phage_name
     self.progress_label = Gtk.Label('Starterator is starting')
     self.progress_bar = Gtk.ProgressBar()
     self.box.pack_start(self.progress_label, False, False, 0)
     self.box.pack_start(self.progress_bar, False, False, 0)
     self.show_all()
     self.starterate_thread = StarteratorThread(self, db, self.config_info,
                                                self.info)
     self.starterate_thread.start()
Esempio n. 4
0
def main():
    args = get_arguments()
    config = utils.get_config()
    print config["count"]
    phamgene.check_protein_db(config["count"])
    # --Phamerated and only one gene
    if args.gene_number != -1 and args.phage != None and args.unphamed == False:
        gene = report.GeneReport(args.phage, args.gene_number, True)
        print gene
        gene.get_pham()
        gene.make_report()
        final_file, s = gene.merge_report()

    # --Unphameratored Phage with only one gene
    elif args.given_start > -1 and args.phage != None and args.unphamed == True:
        # given start and stop coordinates and orientation
        one_or_all = 'One'
        given_start = args.given_start
        given_stop = args.given_stop
        given_orientation = args.given_orientation
        gene_name = args.phage + '_' + str(args.gene_number)
        gene = report.GeneReport(args.phage, args.gene_number, fasta_file=args.fasta)
        gene.make_unpham_gene(given_start, given_stop, given_orientation)
        print gene
        gene.make_report()
        final_file, s = gene.merge_report()

    # --Phameratored or Unphameratored Phages with all genes
    elif args.pham_no == -1 and args.phage != None and args.unphamed == False:
        phage = report.PhageReport(args.phage, gui=None)
        final_file, short_final = phage.final_report()

    elif args.pham_no == -1 and args.phage != None and args.unphamed == True:
        phage = report.UnPhamPhageReport(args.phage, fasta_file=args.fasta, profile_file=args.profile, gui=None)
        final_file, short_final = phage.final_report()
    elif args.phage == None:
        pham = report.PhamReport(args.pham_no)
        final_file, short_final = pham.final_report()