def get_concat_reference_sequence(self):
"""Return a concatenated reference sequence.
Return value:
- (None,None) if this contig isn't annotated with a V and a J segment.
Otherwise a tuple (seqs, annos) where annos is a list of Annotation objects
in the order that they should appear in a VDJ sequence and seqs is a list
of corresponding sequences from the input fasta.
"""
v_region = self.get_region_hits(VDJ_V_FEATURE_TYPES)
j_region = self.get_region_hits(VDJ_J_FEATURE_TYPES)
if not v_region or not j_region:
return (None, None)
seqs = []
ordered_annos = []
for region_defs in VDJ_ORDERED_REGIONS:
regions = self.get_region_hits(region_defs)
if regions:
seqs.append(regions[0].feature.sequence)
ordered_annos.append(regions[0])
return (seqs, ordered_annos)
评论列表
文章目录