a-r-j / graphein

Protein Graph Library
https://graphein.ai/
MIT License
1.03k stars 131 forks source link

Dssp and hover name #176

Closed avivko closed 2 years ago

avivko commented 2 years ago

Reference Issues/PRs

What does this implement/fix? Explain your changes

Rational for refactoring: Before this PR, after we read a pdb and make a DataFrame out of it, as far as I know, we didn't save the original path to the pdb in the graph metadata. This is why previously, once we wanted to get the dssp features of a local pdb, we ran into problems as long as the structure was not in the pdb_dir. I wanted to make G.graph always contain the following three separate parameters from here on out: name, pdb_code, pdb_path. This way, when pdb_code is not None, we know we have a pdb from the protein database (and can also use download_pdb(pdb_code) etc.); Otherwise, we know are dealing with a local pdb and we keep the path to where it was originally stored. It is important to note that the pdb file might be moved after a graph was generated, therefore yielding a dead pdb_path. For getting dssp features, this PR also provides the option to provide a new pdb_path in such a case.

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

I ran the Jupyter notebooks from the protein tutorials as well as my own local pdb + dssp graph conversion workflow and it all works.

codecov-commenter commented 2 years ago

Codecov Report

Merging #176 (fd7f92f) into master (8123f42) will increase coverage by 8.76%. The diff coverage is 56.38%.

@@            Coverage Diff             @@
##           master     #176      +/-   ##
==========================================
+ Coverage   40.27%   49.03%   +8.76%     
==========================================
  Files          48       74      +26     
  Lines        2811     4264    +1453     
==========================================
+ Hits         1132     2091     +959     
- Misses       1679     2173     +494     
Impacted Files Coverage Δ
graphein/grn/parse_trrust.py 37.77% <ø> (ø)
graphein/ml/diffusion.py 0.00% <0.00%> (ø)
graphein/ppi/edges.py 100.00% <ø> (ø)
graphein/ppi/graph_metadata.py 0.00% <ø> (ø)
graphein/ppi/graphs.py 54.34% <ø> (ø)
graphein/ppi/parse_biogrid.py 75.00% <ø> (ø)
graphein/ppi/visualisation.py 0.00% <0.00%> (ø)
graphein/protein/analysis.py 0.00% <0.00%> (ø)
graphein/protein/features/sequence/sequence.py 71.42% <0.00%> (+2.67%) :arrow_up:
graphein/protein/features/sequence/utils.py 28.00% <0.00%> (+3.00%) :arrow_up:
... and 59 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update dcf294f...fd7f92f. Read the comment docs.

review-notebook-app[bot] commented 2 years ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

avivko commented 2 years ago

Would you like me to me to also add a test for dssp with both a pdb code a local pdb structure? I could also add the show_edges visualization from #167 to the corresponding notebook while I'm already on it.

a-r-j commented 2 years ago

I think a test & example of the edges in the asteroid plot would be great :)

Also, woould you mind adding a brief a description to the changelog?

sonarcloud[bot] commented 2 years 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 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication