def protein_relation(self):
     if self._protein_relation is None:
         peptide = self.peptide
         self._protein_relation = PeptideProteinRelation(
             peptide.start_position, peptide.end_position,
             peptide.protein_id, peptide.hypothesis_id)
     return self._protein_relation
 def convert(self):
     inst = FragmentCachingGlycopeptide(self.glycopeptide_sequence)
     inst.id = self.id
     peptide = self.peptide
     inst.protein_relation = PeptideProteinRelation(peptide.start_position,
                                                    peptide.end_position,
                                                    peptide.protein_id,
                                                    peptide.hypothesis_id)
     return inst
Example #3
0
 def convert(self, peptide_relation_cache=None):
     if peptide_relation_cache is None:
         session = object_session(self)
         peptide_relation_cache = session.info.get("peptide_relation_cache")
         if peptide_relation_cache is None:
             peptide_relation_cache = session.info['peptide_relation_cache'] = LRUDict(maxsize=1024)
     inst = FragmentCachingGlycopeptide(self.glycopeptide_sequence)
     inst.id = self.id
     try:
         inst.protein_relation = peptide_relation_cache[self.peptide_id]
     except KeyError:
         session = object_session(self)
         peptide_props = session.query(
             Peptide.start_position, Peptide.end_position,
             Peptide.protein_id, Peptide.hypothesis_id).filter(Peptide.id == self.peptide_id).first()
         peptide_relation_cache[self.peptide_id] = inst.protein_relation = PeptideProteinRelation(*peptide_props)
     return inst
Example #4
0
 def _build_protein_relation(self, glycopeptide_id_key):
     return PeptideProteinRelation(glycopeptide_id_key.start_position,
                                   glycopeptide_id_key.end_position,
                                   glycopeptide_id_key.protein_id,
                                   glycopeptide_id_key.hypothesis_id)