Skip to content
Snippets Groups Projects
Commit fb58f416 authored by Bienchen's avatar Bienchen
Browse files

Add target entities

parent bc1eae2a
No related branches found
No related tags found
No related merge requests found
......@@ -230,28 +230,36 @@ def _get_entities(pdb_file, up_acs):
def _store_as_modelcif(interaction_name, data_json, file_prfx):
"""Mix all the data into a ModelCIF file."""
# create target references, ...
for cif_ent in data_json["target_entities"]:
# 'cif_sequence'
ref = modelcif.reference.UniProt(
cif_ent["up_id"],
cif_ent["up_ac"],
# careful: alignments are just that easy because of equal sequences!
align_begin=1,
align_end=cif_ent["up_seqlen"],
isoform=cif_ent["up_isoform"],
ncbi_taxonomy_id=cif_ent["up_ncbi_taxid"],
organism_scientific=cif_ent["up_organism"],
sequence_version_date=cif_ent["up_last_mod"],
sequence_crc64=cif_ent["up_crc64"],
)
# create system to gather all the data
system = modelcif.System(
title=data_json["title"],
id=interaction_name.upper(),
model_details=data_json["model_details"],
)
# create target entities, references, ...
for cif_ent in data_json["target_entities"]:
# ToDo [input]: Get entity description
mdlcif_ent = modelcif.Entity(
cif_ent["cif_sequence"],
description="entity.pdbx_description",
references=[
modelcif.reference.UniProt(
cif_ent["up_id"],
cif_ent["up_ac"],
# Careful: alignments are just that easy because of equal
# sequences!
align_begin=1,
align_end=cif_ent["up_seqlen"],
isoform=cif_ent["up_isoform"],
ncbi_taxonomy_id=cif_ent["up_ncbi_taxid"],
organism_scientific=cif_ent["up_organism"],
sequence_version_date=cif_ent["up_last_mod"],
sequence_crc64=cif_ent["up_crc64"],
)
],
)
system.entities.append(mdlcif_ent)
system.target_entities.append(mdlcif_ent)
# audit_authors
system.authors.extend(data_json["audit_authors"])
......@@ -320,4 +328,4 @@ if __name__ == "__main__":
# LocalWords: sqe olc ACDEFGHIKLMNPQRSTVWY RuntimeError upkb txt pylint iter
# LocalWords: rspns unicode startswith sline len elif NCBI TaxID ncbi taxid
# LocalWords: seqlen crc ISOFORM DT dt flds isoforms isoform ent LoadPDB
# LocalWords: mdlcf
# LocalWords: mdlcf mdlcif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment