예제 #1
0
 def add_to_record(self, record: Record) -> None:
     db_version = pfamdb.get_db_version_from_path(self.database)
     for i, hit in enumerate(self.hits):
         protein_location = FeatureLocation(hit["protein_start"], hit["protein_end"])
         pfam_feature = PFAMDomain(location_from_string(hit["location"]),
                                   description=hit["description"], protein_location=protein_location,
                                   identifier=hit["identifier"], tool=self.tool, locus_tag=hit["locus_tag"])
         for key in ["label", "locus_tag", "domain", "evalue",
                     "score", "translation"]:
             setattr(pfam_feature, key, hit[key])
         pfam_feature.database = db_version
         pfam_feature.detection = "hmmscan"
         pfam_feature.domain_id = "{}_{}_{:04d}".format(self.tool, pfam_feature.locus_tag, i + 1)
         record.add_pfam_domain(pfam_feature)
예제 #2
0
파일: hmmer.py 프로젝트: SBGlab/antismash
 def add_to_record(self, record: Record) -> None:
     """ Adds the hits as PFAMDomains to the given record """
     db_version = pfamdb.get_db_version_from_path(self.database)
     for i, hit in enumerate(self.hits):
         protein_location = FeatureLocation(hit.protein_start, hit.protein_end)
         pfam_feature = PFAMDomain(location_from_string(hit.location),
                                   description=hit.description, protein_location=protein_location,
                                   identifier=hit.identifier, tool=self.tool, locus_tag=hit.locus_tag)
         for key in ["label", "locus_tag", "domain", "evalue",
                     "score", "translation"]:
             setattr(pfam_feature, key, getattr(hit, key))
         pfam_feature.database = db_version
         pfam_feature.detection = "hmmscan"
         pfam_feature.domain_id = "{}_{}_{:04d}".format(self.tool, pfam_feature.locus_tag, i + 1)
         record.add_pfam_domain(pfam_feature)