コード例 #1
0
    def to_match_representation(match, full=False):
        output = {
            "accession": match.protein_id,
            "coordinates": match.coordinates,
            "length": match.protein.length,
            "source_database": match.protein.source_database,
            "name": match.protein.name,
        }
        if full:
            output["protein"] = ProteinSerializer.to_metadata_representation(match.protein)

        return output
コード例 #2
0
ファイル: pdb.py プロジェクト: ProteinsWebTeam/interpro7-api
 def to_chain_representation(instance, full=False):
     chain = {
         "chain": instance.chain,
         "accession": instance.protein.accession,
         "source_database": instance.protein.source_database,
         "length": instance.length,
         "organism": instance.organism,
         "coordinates": instance.coordinates,
     }
     if full:
         chain["protein"] = ProteinSerializer.to_metadata_representation(instance.protein)
     return chain