def make_gene(self): """ makes the gene which is a SeqRecord from Biopython. In this case the "gene" should include all the sequence upstream of the annotated start all the way to the first in frame stop codon. """ phage = new_phage(phage_id=self.phage_id) self.phage_name = phage.get_name() gene_no = self.db_id.split("_")[-1] gene_no = gene_no.split(" ")[0] self.gene_id = self.phage_name + "_" + gene_no self.gene_id = self.gene_id.replace('-', "_") checkDraft = re.compile('_draft', re.IGNORECASE) if checkDraft.search(self.gene_id) is not None: self.draftStatus = True else: self.draftStatus = False phage_sequence = phage.get_sequence() if self.orientation == 'R': temp_start = self.stop self.stop = self.start self.start = temp_start sequence, self.ahead_of_start = find_upstream_stop_site( self.start, self.stop, self.orientation, phage_sequence) gene = SeqRecord(sequence, id=self.gene_id , name=self.gene_id, description="|%i-%i| %s" %(self.start, self.stop, self.orientation)) return gene
def __init__(self, name, is_phamerated, fasta_file=None, profile_file=None, gui=None, event=None): self.name = name self.phage = new_phage(name=name) self.genes = {} self.is_phamerated = is_phamerated self.intermediate_dir = utils.INTERMEDIATE_DIR self.final_dir = utils.FINAL_DIR self.fasta = fasta_file self.profile = profile_file self.unphamerated_genes = {} self.config = config self.gui = gui self.current_pham = [0, 0] self.total_phams = None self.event = event
def make_gene(self): """ makes the gene """ phage = new_phage(phage_id=self.phage_id) self.phage_name = phage.get_name() gene_no = self.db_id.split("_")[-1] gene_no = gene_no.split(" ")[0] self.gene_id = self.phage_name + "_" + gene_no self.gene_id = self.gene_id.replace('-', "_") phage_sequence = phage.get_sequence() if self.orientation == 'R': temp_start = self.stop self.stop = self.start self.start = temp_start sequence, self.ahead_of_start = find_upstream_stop_site( self.start, self.stop, self.orientation, phage_sequence) gene = SeqRecord(sequence, id=self.gene_id , name=self.gene_id, description="|%i-%i| %s" %(self.start, self.stop, self.orientation)) return gene
def make_gene(self): """ makes the gene which is a SeqRecord from Biopython. In this case the "gene" should include all the sequence upstream of the annotated start all the way to the first in frame stop codon. """ phage = new_phage(phage_id=self.phage_id) self.phage_name = phage.get_name() gene_no = self.db_id.split("_")[-1] gene_no = gene_no.split(" ")[0] self.gene_id = self.phage_name + "_" + gene_no self.gene_id = self.gene_id.replace('-', "_") self.cluster = phage.cluster if self.cluster == None: self.cluster = "singleton" self.cluster_hash = sum( [pow(ord(elem), i + 1) for i, elem in enumerate(self.cluster)]) status = phage.get_status() if status == 'final': # values of 'draft' or 'gbk' considered draft quality by starterator self.draftStatus = False else: self.draftStatus = True phage_sequence = phage.get_sequence() if self.orientation == 'R': temp_start = self.stop self.stop = self.start self.start = temp_start sequence, self.ahead_of_start = find_upstream_stop_site( self.start, self.stop, self.orientation, phage_sequence) self.ahead_of_start_coord = self.start - self.ahead_of_start gene = SeqRecord(sequence, id=self.gene_id, name=self.gene_id, description="|%i-%i| %s" % (self.start, self.stop, self.orientation)) return gene
def get_phams(self): self.phage_ = phage.new_phage(name=self.name) self._phams = self.phage_.get_phams() self.seq_length = self.phage_.length()
def prepare_report(self): self.phage_ = phage.new_phage(name=self.name) self.genes = self.phage_.get_genes()