Skip to content

Commit

Permalink
support residue variants accepted by TALOS: protonated HIS and oxidis…
Browse files Browse the repository at this point in the history
…ed CYS
  • Loading branch information
locsmith committed Nov 5, 2023
1 parent c6338a5 commit 7b24ebb
Show file tree
Hide file tree
Showing 7 changed files with 427 additions and 8 deletions.
12 changes: 12 additions & 0 deletions src/nef_pipelines/lib/sequence_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ def sequence_from_frame(
sequence_code_index = loop.tag_index("sequence_code")
residue_name_index = loop.tag_index("residue_name")
linking_index = loop.tag_index("linking")
residue_variant_index = loop.tag_index("residue_variant")

for line in loop:
chain_code = line[chain_code_index]
Expand All @@ -512,11 +513,22 @@ def sequence_from_frame(
if line[linking_index] != NEF_UNKNOWN
else None
)
residue_variants = line[residue_variant_index].split(",")
residue_variants = (
()
if residue_variants
== [
UNUSED,
]
else tuple(residue_variants)
)

residue = SequenceResidue(
chain_code=chain_code,
sequence_code=sequence_code,
residue_name=residue_name,
linking=linking,
variants=residue_variants,
)
residues.append(residue)

Expand Down
2 changes: 1 addition & 1 deletion src/nef_pipelines/lib/structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class SequenceResidue(Residue):

is_cis: bool = False
linking: Optional[Linking] = None
variant: Optional[str] = None
variants: List[str] = ()


# should contain a residue and have constructors?
Expand Down
88 changes: 88 additions & 0 deletions src/nef_pipelines/tests/talos/test_data/oxidised_cys.nef
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
data_nmrpipe

save_nef_nmr_meta_data
_nef_nmr_meta_data.sf_category nef_nmr_meta_data
_nef_nmr_meta_data.sf_framecode nef_nmr_meta_data
_nef_nmr_meta_data.format_name nmr_exchange_format
_nef_nmr_meta_data.format_version 1.1
_nef_nmr_meta_data.program_name NEFPipelines
_nef_nmr_meta_data.script_name nmrpipe/import/shifts.py
_nef_nmr_meta_data.program_version 0.1.45
_nef_nmr_meta_data.creation_date 2023-08-27T12:11:33.808424
_nef_nmr_meta_data.uuid NEFPipelines-2023-08-27T12:11:33.930553-9145925061
_nef_nmr_meta_data.creation_time 2023-08-27T12:11:33.930553

loop_
_nef_run_history.run_number
_nef_run_history.program_name
_nef_run_history.program_version
_nef_run_history.script_name

1 NEFPipelines 0.1.45 nmrpipe/import/sequence.py

stop_

save_

save_nef_molecular_system
_nef_molecular_system.sf_category nef_molecular_system
_nef_molecular_system.sf_framecode nef_molecular_system

loop_
_nef_sequence.index
_nef_sequence.chain_code
_nef_sequence.sequence_code
_nef_sequence.residue_name
_nef_sequence.linking
_nef_sequence.residue_variant
_nef_sequence.cis_peptide

1 A 1 MET start . .
2 A 2 CYS middle -HG .
3 A 3 ILE middle . .
4 A 4 PHE end . .

stop_

save_

save_nef_chemical_shift_list_nmrpipe
_nef_chemical_shift_list.sf_category nef_chemical_shift_list
_nef_chemical_shift_list.sf_framecode nef_chemical_shift_list_nmrpipe

loop_
_nef_chemical_shift.chain_code
_nef_chemical_shift.sequence_code
_nef_chemical_shift.residue_name
_nef_chemical_shift.atom_name
_nef_chemical_shift.value
_nef_chemical_shift.value_uncertainty
_nef_chemical_shift.element
_nef_chemical_shift.isotope_number

A 1 MET CB 33.27 . . .
A 1 MET CA 54.45 . . .
A 1 MET C 170.54 . . .
A 1 MET HA 4.23 . . .
A 2 CYS HN 8.9 . . .
A 2 CYS CA 55.08 . . .
A 2 CYS CB 30.76 . . .
A 2 CYS C 175.92 . . .
A 2 CYS HA 5.249 . . .
A 2 CYS N 123.22 . . .
A 3 ILE HA 4.213 . . .
A 3 ILE C 172.45 . . .
A 3 ILE CA 59.57 . . .
A 3 ILE N 115.34 . . .
A 3 ILE HN 8.32 . . .
A 3 ILE CB 42.21 . . .
A 4 PHE HA 5.63 . . .
A 4 PHE C 175.32 . . .
A 4 PHE CB 41.48 . . .
A 4 PHE CA 55.21 . . .
A 4 PHE N 118.11 . . .
A 4 PHE HN 8.61 . . .

stop_

save_
89 changes: 89 additions & 0 deletions src/nef_pipelines/tests/talos/test_data/protonated_his.nef
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
data_nmrpipe

save_nef_nmr_meta_data
_nef_nmr_meta_data.sf_category nef_nmr_meta_data
_nef_nmr_meta_data.sf_framecode nef_nmr_meta_data
_nef_nmr_meta_data.format_name nmr_exchange_format
_nef_nmr_meta_data.format_version 1.1
_nef_nmr_meta_data.program_name NEFPipelines
_nef_nmr_meta_data.script_name nmrpipe/import/shifts.py
_nef_nmr_meta_data.program_version 0.1.45
_nef_nmr_meta_data.creation_date 2023-08-27T12:11:33.808424
_nef_nmr_meta_data.uuid NEFPipelines-2023-08-27T12:11:33.930553-9145925061
_nef_nmr_meta_data.creation_time 2023-08-27T12:11:33.930553

loop_
_nef_run_history.run_number
_nef_run_history.program_name
_nef_run_history.program_version
_nef_run_history.script_name

1 NEFPipelines 0.1.45 nmrpipe/import/sequence.py

stop_

save_

save_nef_molecular_system
_nef_molecular_system.sf_category nef_molecular_system
_nef_molecular_system.sf_framecode nef_molecular_system

loop_
_nef_sequence.index
_nef_sequence.chain_code
_nef_sequence.sequence_code
_nef_sequence.residue_name
_nef_sequence.linking
_nef_sequence.residue_variant
_nef_sequence.cis_peptide

1 A 1 MET start . .
2 A 2 HIS middle +HE2 .
3 A 3 ILE middle . .
4 A 4 PHE end . .


stop_

save_

save_nef_chemical_shift_list_nmrpipe
_nef_chemical_shift_list.sf_category nef_chemical_shift_list
_nef_chemical_shift_list.sf_framecode nef_chemical_shift_list_nmrpipe

loop_
_nef_chemical_shift.chain_code
_nef_chemical_shift.sequence_code
_nef_chemical_shift.residue_name
_nef_chemical_shift.atom_name
_nef_chemical_shift.value
_nef_chemical_shift.value_uncertainty
_nef_chemical_shift.element
_nef_chemical_shift.isotope_number

A 1 MET CB 33.27 . . .
A 1 MET CA 54.45 . . .
A 1 MET C 170.54 . . .
A 1 MET HA 4.23 . . .
A 2 HIS HN 8.9 . . .
A 2 HIS CA 55.08 . . .
A 2 HIS CB 30.76 . . .
A 2 HIS C 175.92 . . .
A 2 HIS HA 5.249 . . .
A 2 HIS N 123.22 . . .
A 3 ILE HA 4.213 . . .
A 3 ILE C 172.45 . . .
A 3 ILE CA 59.57 . . .
A 3 ILE N 115.34 . . .
A 3 ILE HN 8.32 . . .
A 3 ILE CB 42.21 . . .
A 4 PHE HA 5.63 . . .
A 4 PHE C 175.32 . . .
A 4 PHE CB 41.48 . . .
A 4 PHE CA 55.21 . . .
A 4 PHE N 118.11 . . .
A 4 PHE HN 8.61 . . .

stop_

save_
89 changes: 89 additions & 0 deletions src/nef_pipelines/tests/talos/test_data/ubi_4_offset_1.nef
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
data_nmrpipe

save_nef_nmr_meta_data
_nef_nmr_meta_data.sf_category nef_nmr_meta_data
_nef_nmr_meta_data.sf_framecode nef_nmr_meta_data
_nef_nmr_meta_data.format_name nmr_exchange_format
_nef_nmr_meta_data.format_version 1.1
_nef_nmr_meta_data.program_name NEFPipelines
_nef_nmr_meta_data.script_name nmrpipe/import/shifts.py
_nef_nmr_meta_data.program_version 0.1.45
_nef_nmr_meta_data.creation_date 2023-08-27T12:11:33.808424
_nef_nmr_meta_data.uuid NEFPipelines-2023-08-27T12:11:33.930553-9145925061
_nef_nmr_meta_data.creation_time 2023-08-27T12:11:33.930553

loop_
_nef_run_history.run_number
_nef_run_history.program_name
_nef_run_history.program_version
_nef_run_history.script_name

1 NEFPipelines 0.1.45 nmrpipe/import/sequence.py

stop_

save_

save_nef_molecular_system
_nef_molecular_system.sf_category nef_molecular_system
_nef_molecular_system.sf_framecode nef_molecular_system

loop_
_nef_sequence.index
_nef_sequence.chain_code
_nef_sequence.sequence_code
_nef_sequence.residue_name
_nef_sequence.linking
_nef_sequence.residue_variant
_nef_sequence.cis_peptide

1 A 2 MET start . .
2 A 3 GLN middle . .
3 A 4 ILE middle . .
4 A 5 PHE end . .


stop_

save_

save_nef_chemical_shift_list_nmrpipe
_nef_chemical_shift_list.sf_category nef_chemical_shift_list
_nef_chemical_shift_list.sf_framecode nef_chemical_shift_list_nmrpipe

loop_
_nef_chemical_shift.chain_code
_nef_chemical_shift.sequence_code
_nef_chemical_shift.residue_name
_nef_chemical_shift.atom_name
_nef_chemical_shift.value
_nef_chemical_shift.value_uncertainty
_nef_chemical_shift.element
_nef_chemical_shift.isotope_number

A 2 MET CB 33.27 . . .
A 2 MET CA 54.45 . . .
A 2 MET C 170.54 . . .
A 2 MET HA 4.23 . . .
A 3 GLN HN 8.9 . . .
A 3 GLN CA 55.08 . . .
A 3 GLN CB 30.76 . . .
A 3 GLN C 175.92 . . .
A 3 GLN HA 5.249 . . .
A 3 GLN N 123.22 . . .
A 4 ILE HA 4.213 . . .
A 4 ILE C 172.45 . . .
A 4 ILE CA 59.57 . . .
A 4 ILE N 115.34 . . .
A 4 ILE HN 8.32 . . .
A 4 ILE CB 42.21 . . .
A 5 PHE HA 5.63 . . .
A 5 PHE C 175.32 . . .
A 5 PHE CB 41.48 . . .
A 5 PHE CA 55.21 . . .
A 5 PHE N 118.11 . . .
A 5 PHE HN 8.61 . . .

stop_

save_
Loading

0 comments on commit 7b24ebb

Please sign in to comment.