a-r-j / graphein

Protein Graph Library
https://graphein.ai/
MIT License
998 stars 125 forks source link

`PDBManager` - Bug fixes, adding necessary changes to export only first PDB model, and merging-in latest updates from `master` #311

Closed a-r-j closed 1 year ago

a-r-j commented 1 year ago

Reference Issues/PRs

@a-r-j, I noticed that our (new) default function for exporting collated groups of PDB chains does not currently export only the first model for each PDB complex file. I've added the necessary changes to make this happen, and I also added a workaround that's needed when exporting (i.e., calling to_pdb() on) PandasPdb objects that have had a model_id column added to them. In the long term, I think it'd be good to have a fix merged into the master branch of BioPandas that types the model_id column as a str -> object column, but this workaround I've proposed should work for now.

Originally posted by @amorehead in https://github.com/a-r-j/graphein/issues/309#issuecomment-1513710494

@a-r-j, note that this PR also includes a fix for dataset-splitting edge cases where you only select one splitting strategy (e.g., time-based splitting) and then try to download and export your selected PDBs. Currently, if you try to export such PDBs, the download and export functions will throw an error saying that your selected PDBs are not labeled correctly according to which split to which they are assigned. The fix for this is simple: track split names per PDB entry more thoroughly by installing them within individual splitting functions (e.g., split_df_into_time_frames). If you are good with these changes, please feel free to go ahead and merge these changes into master after testing them on your end.

Originally posted by @amorehead in https://github.com/a-r-j/graphein/issues/309#issuecomment-1513711152

What does this implement/fix? Explain your changes

What testing did you do to verify the changes in this PR?

Pull Request Checklist

review-notebook-app[bot] commented 1 year ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 40.07% and project coverage change: +3.71 :tada:

Comparison is base (8123f42) 40.27% compared to head (628616d) 43.98%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #311 +/- ## ========================================== + Coverage 40.27% 43.98% +3.71% ========================================== Files 48 113 +65 Lines 2811 7778 +4967 ========================================== + Hits 1132 3421 +2289 - Misses 1679 4357 +2678 ``` | [Impacted Files](https://codecov.io/gh/a-r-j/graphein/pull/311?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Arian+Jamasb) | Coverage Δ | | |---|---|---| | [graphein/ml/datasets/foldcomp\_dataset.py](https://codecov.io/gh/a-r-j/graphein/pull/311?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Arian+Jamasb#diff-Z3JhcGhlaW4vbWwvZGF0YXNldHMvZm9sZGNvbXBfZGF0YXNldC5weQ==) | `0.00% <0.00%> (ø)` | | | [graphein/ml/diffusion.py](https://codecov.io/gh/a-r-j/graphein/pull/311?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Arian+Jamasb#diff-Z3JhcGhlaW4vbWwvZGlmZnVzaW9uLnB5) | `0.00% <0.00%> (ø)` | | | [graphein/ml/metrics/\_\_init\_\_.py](https://codecov.io/gh/a-r-j/graphein/pull/311?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Arian+Jamasb#diff-Z3JhcGhlaW4vbWwvbWV0cmljcy9fX2luaXRfXy5weQ==) | `0.00% <0.00%> (ø)` | | | [graphein/ml/metrics/gdt.py](https://codecov.io/gh/a-r-j/graphein/pull/311?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Arian+Jamasb#diff-Z3JhcGhlaW4vbWwvbWV0cmljcy9nZHQucHk=) | `0.00% <0.00%> (ø)` | | | [graphein/ml/metrics/tm\_score.py](https://codecov.io/gh/a-r-j/graphein/pull/311?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Arian+Jamasb#diff-Z3JhcGhlaW4vbWwvbWV0cmljcy90bV9zY29yZS5weQ==) | `0.00% <0.00%> (ø)` | | | [graphein/ppi/graph\_metadata.py](https://codecov.io/gh/a-r-j/graphein/pull/311?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Arian+Jamasb#diff-Z3JhcGhlaW4vcHBpL2dyYXBoX21ldGFkYXRhLnB5) | `0.00% <0.00%> (ø)` | | | [graphein/ppi/visualisation.py](https://codecov.io/gh/a-r-j/graphein/pull/311?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Arian+Jamasb#diff-Z3JhcGhlaW4vcHBpL3Zpc3VhbGlzYXRpb24ucHk=) | `0.00% <0.00%> (ø)` | | | [graphein/protein/analysis.py](https://codecov.io/gh/a-r-j/graphein/pull/311?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Arian+Jamasb#diff-Z3JhcGhlaW4vcHJvdGVpbi9hbmFseXNpcy5weQ==) | `0.00% <0.00%> (ø)` | | | [graphein/protein/features/utils.py](https://codecov.io/gh/a-r-j/graphein/pull/311?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Arian+Jamasb#diff-Z3JhcGhlaW4vcHJvdGVpbi9mZWF0dXJlcy91dGlscy5weQ==) | `27.77% <0.00%> (ø)` | | | [graphein/protein/folding\_utils.py](https://codecov.io/gh/a-r-j/graphein/pull/311?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Arian+Jamasb#diff-Z3JhcGhlaW4vcHJvdGVpbi9mb2xkaW5nX3V0aWxzLnB5) | `0.00% <0.00%> (ø)` | | | ... and [95 more](https://codecov.io/gh/a-r-j/graphein/pull/311?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Arian+Jamasb) | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication