Skip to content

Commit

Permalink
Added release version to the graphics, added info text when using Tor…
Browse files Browse the repository at this point in the history
…toize
  • Loading branch information
glycojones committed Jul 2, 2024
1 parent e00e703 commit 984b52d
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 24 deletions.
23 changes: 19 additions & 4 deletions src/iris_validation/graphics/chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from svgwrite.animate import Animate

from iris_validation._defs import COLORS, CHAIN_VIEW_RINGS, CHAIN_VIEW_GAP_ANGLE
from iris_validation._version import version_tuple


class ChainView:
Expand Down Expand Up @@ -142,21 +143,35 @@ def _draw(self):

# Draw center text
self.dwg.add(self.dwg.text(text='Iris',
insert=(self.center[0], self.center[1]-24),
font_size=1.5*16,
insert=(self.center[0], self.center[1]-22),
font_size=1.5*18,
font_family='Arial',
font_weight='bold',
text_anchor='middle',
alignment_baseline='central'))
self.dwg.add(self.dwg.text(text='Release ' + '.'.join(map(str, version_tuple[:3])),
insert=(self.center[0], self.center[1]),
font_size=14,
font_family='Arial',
text_anchor='middle',
alignment_baseline='central'))
self.dwg.add(self.dwg.text(text='Chain ' + self.data['chain_id'],
insert=(self.center[0], self.center[1]+16),
insert=(self.center[0], self.center[1]+18),
font_size=16,
font_family='Arial',
text_anchor='middle',
alignment_baseline='central'))
if self.data['has_molprobity']:
self.dwg.add(self.dwg.text(text='MolProbity',
insert=(self.center[0], self.center[1]+48),
insert=(self.center[0], self.center[1]+50),
font_size=16,
font_family='Arial',
text_anchor='middle',
alignment_baseline='central',
fill=COLORS['L_GREY']))
elif self.data['has_rama_z']:
self.dwg.add(self.dwg.text(text='Tortoize',
insert=(self.center[0], self.center[1]+50),
font_size=16,
font_family='Arial',
text_anchor='middle',
Expand Down
5 changes: 5 additions & 0 deletions src/iris_validation/graphics/panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,11 @@ def _draw(self):
onclick=f'toggleDropdown();'))

# Version toggle switch
self.dwg.add(self.dwg.text(text='Model version',
insert=(chain_view_bounds[2]-385, chain_view_bounds[1]+20),
font_size=view_title_font,
font_family='Arial'))

self.dwg.add(self.dwg.text(text=self.custom_labels['Previous'],
insert=(chain_view_bounds[2]-215, chain_view_bounds[1]+20),
font_size=16,
Expand Down
41 changes: 21 additions & 20 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
DATASET1_PATH = str(os.path.join(INPUT_DIR, "3atp")) + '{suffix}'
DATASET2_PATH = str(os.path.join(INPUT_DIR, "8ira")) + '{suffix}'


def test_2m2d_noCOV_noMP_noRamaZ_mpro ():
import iris_validation as iris
importlib.reload(iris)
Expand Down Expand Up @@ -130,23 +131,23 @@ def test_2m2d_noCOV_MP_noRamaZ_spro ():
assert path.exists(OUTPUT_DIR.format(suffix=job_name) + ".html")


@pytest.mark.slow
def test_2m2d_COV_MP_noRamaZ_spro ():
import iris_validation as iris
importlib.reload(iris)
job_name = "test_2m2d_COV_MP_noRamaZ_spro"
iris.generate_report(latest_model_path=DATASET1_PATH.format(suffix='_final.pdb'),
latest_reflections_path=DATASET1_PATH.format(suffix='_final.mtz'),
latest_sequence_path=DATASET1_PATH.format(suffix='.fasta'),
latest_distpred_path=DATASET1_PATH.format(suffix='.npz'),
previous_model_path=DATASET1_PATH.format(suffix='_0cyc.pdb'),
previous_reflections_path=DATASET1_PATH.format(suffix='_0cyc.mtz'),
previous_sequence_path=DATASET1_PATH.format(suffix='.fasta'),
previous_distpred_path=DATASET1_PATH.format(suffix='.npz'),
run_covariance=True,
run_molprobity=True,
calculate_rama_z=False,
multiprocessing=False,
output_dir=OUTPUT_DIR.format(suffix=""),
output_name_prefix=job_name)
assert path.exists(OUTPUT_DIR.format(suffix=job_name) + ".html")
# @pytest.mark.slow
# def test_2m2d_COV_MP_noRamaZ_spro ():
# import iris_validation as iris
# importlib.reload(iris)
# job_name = "test_2m2d_COV_MP_noRamaZ_spro"
# iris.generate_report(latest_model_path=DATASET1_PATH.format(suffix='_final.pdb'),
# latest_reflections_path=DATASET1_PATH.format(suffix='_final.mtz'),
# latest_sequence_path=DATASET1_PATH.format(suffix='.fasta'),
# latest_distpred_path=DATASET1_PATH.format(suffix='.npz'),
# previous_model_path=DATASET1_PATH.format(suffix='_0cyc.pdb'),
# previous_reflections_path=DATASET1_PATH.format(suffix='_0cyc.mtz'),
# previous_sequence_path=DATASET1_PATH.format(suffix='.fasta'),
# previous_distpred_path=DATASET1_PATH.format(suffix='.npz'),
# run_covariance=True,
# run_molprobity=True,
# calculate_rama_z=False,
# multiprocessing=False,
# output_dir=OUTPUT_DIR.format(suffix=""),
# output_name_prefix=job_name)
# assert path.exists(OUTPUT_DIR.format(suffix=job_name) + ".html")

0 comments on commit 984b52d

Please sign in to comment.