def setUp(self): test_identifier1 = 3 test_indices1 = [3734, 4034] test_score1 = 0.9 test_parent_id1 = 2 self.test_exon0 = Exon(identifier=test_identifier1, indices=test_indices1, score=test_score1, parent_id=test_parent_id1) self.extra_identifiers = [4, 5, 6, 7] self.extra_scores = [0.9, 0.9, 0.9, 0.9] self.extra_indices = [[4092, 4332], [4399, 5185], [5249, 6565], [6630, 7436]] self.test_exon1 = Exon(identifier=test_identifier1, indices=test_indices1, score=test_score1, parent_id=test_parent_id1) for ind_pair in self.extra_indices: self.test_exon1.add_indices(ind_pair) for ident in self.extra_identifiers: self.test_exon1.add_identifier(ident) for score in self.extra_scores: self.test_exon1.add_score(score)
def process_exon_line(self, line): """Extracts arguments from a line and adds them to a Exon, or makes a new one.""" kwargs = self.extract_exon_args(line) if not kwargs: return parent_id = kwargs['parent_id'] if parent_id not in self.mrnas: self.orphans.append(line) return parent_mrna = self.mrnas[parent_id] if parent_mrna.exon: self.update_exon(line, parent_mrna.exon) else: parent_mrna.exon = Exon(**kwargs)