Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First version of pLDDT and LUR module #11

Merged
merged 12 commits into from
Oct 13, 2022
Merged

First version of pLDDT and LUR module #11

merged 12 commits into from
Oct 13, 2022

Conversation

bordin89
Copy link
Collaborator

First version of pLDDT and LUR module.
Input: CIF File
Output: Summary with Average pLDDT (by chain or domain depending on input) and percentage of residues in Long Unordered Regions (LUR, by chain or domain depending on input).
Add additional models, constant (for min_LUR_length) and writer.
Requires biopython for MMCIF reader.

@bordin89 bordin89 requested a review from sillitoe October 11, 2022 16:19
if chopping:
for segment in chopping.segments:
segment_plddt += plddt_string[(segment.start - 1) : segment.end]
domain_length = len(segment_plddt)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

domain_length needs to be a running total of the segments, then take the average after the loop, e.g.

domain_length = 0
for segment in chopping.segments:
            segment_plddt += plddt_string[(segment.start - 1) : segment.end]
            domain_length += len(segment_plddt)
average_plddt = ...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 'move domain_length out of loop to solve average'

for segment in chopping.segments:
segment_plddt += plddt_string[(segment.start - 1) : segment.end]
domain_length = len(segment_plddt)
average_plddt = round((sum(segment_plddt) / domain_length) * 100, 2)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure about the logic of this average calculation - is segment_plddt an int or a list of int? (sum usually takes an iterable)

mmcif_dict = MMCIF2Dict.MMCIF2Dict(cif_path)
chain_plddt = mmcif_dict["_ma_qa_metric_global.metric_value"][0]
plddt_string = mmcif_dict["_ma_qa_metric_local.metric_value"]
segment_plddt = ""
Copy link
Contributor

@sillitoe sillitoe Oct 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be initialised as an array (of float) that gets append to in the following loop?

segment_plddt = []

bordin89 and others added 5 commits October 12, 2022 17:29
Fix LUR and pLDDT summary given a chopping segment.
Change LUR threshold from 90 to 70 (residual from testing).
Return LUR_perc,LUR_total and segment_length
to check against.
Adjusted values in test to reflect change.
@bordin89 bordin89 merged commit f7370a7 into main Oct 13, 2022
@bordin89 bordin89 deleted the plddt branch October 13, 2022 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants