Commit 50505a44 authored by Sreenath Sasidharan Nair's avatar Sreenath Sasidharan Nair

Merge branch 'production_ready' into 'master'

PDBE-4249: Offset for PRO ids in seq conservation call

See merge request pdbe-kb/services/pdbe-graph-api!400
parents f4f8b385 93ec7118
......@@ -2600,6 +2600,9 @@ def get_sequence_conservation_uniprot_api(uniprot_accession):
}
}
first_residue = None
residue_id = None
for score in result:
scores_tuple = [
......@@ -2625,9 +2628,19 @@ def get_sequence_conservation_uniprot_api(uniprot_accession):
('Y', score['hr.P_SCORE_Y'])
]
residue_id = score['residue_id']
# find the first residue
if not first_residue:
first_residue = residue_id
# PDBE-4249 - Offset for processed proteins
if uniprot_accession.startswith("PRO_"):
residue_id = residue_id - first_residue + 1
residue_fragment = {
"start": score['residue_id'],
"end": score['residue_id'],
"start": residue_id,
"end": residue_id,
"conservation_score": int(score['hr.CONSERVED_SCORE']),
"tooltipContent": f"Conservation score: {score['hr.CONSERVED_SCORE']}",
"amino": [],
......@@ -2638,11 +2651,11 @@ def get_sequence_conservation_uniprot_api(uniprot_accession):
(aa_code, p_score) = element
residue_fragment["amino"].append({
"end": score['residue_id'],
"end": residue_id,
"oneLetterCode": aa_code,
"threeLetterCode": util_common.get_amino_one_to_three(aa_code),
"probability": float(p_score),
"start": score['residue_id'],
"start": residue_id,
"color": seq_conservation_aa_colors[aa_code],
"tooltipContent": f"Amino acid: {amino_acid_codes_one_to_three[aa_code]}<br/>Probability: {float(p_score) * 100:.2f}%"
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment