graphein icon indicating copy to clipboard operation
graphein copied to clipboard

Add support for DSSP version and add rsa node features to residues with insertion codes

Open biochunan opened this issue 2 years ago • 5 comments

Reference Issues/PRs

Fixes Issue #353 Fixes Issue #354

What does this implement/fix? Explain your changes

For Issue #353, this PR added a line to determine dssp version, which is passed to the function Bio.PDB.DSSP.dssp_dict_from_pdb_file otherwise, biopython will use default version number 3.9.9 and for users with dssp version >= 4.0.0, this will lead to an empty dssp DataFrame

For Issue #354, this modification fixes errors caused by missing rsa feature from nodes with insertion code. This is caused by skipping insertions when creating node_id. This modifications adds insertion codes to node_id if insertions is set to True in ProteinGraphConfiguration.

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

Added a script test_dssp.py to tests/features The example input pdb file (with cryst1 line and insertion codes) is attached here: input_pdb_cryst1.pdb.gz

File with suffix .pdb is not supported by GitHub, thus the compressed version. Need to uncompress it first before running the test.

Pull Request Checklist

  • [ ] Added a note about the modification or contribution to the ./CHANGELOG.md file (if applicable)
  • [x] Added appropriate unit test functions in the ./graphein/tests/* directories (if applicable)
  • [x] Modify documentation in the corresponding Jupyter Notebook under ./notebooks/ (if applicable)
  • [x] Ran python -m py.test tests/ and make sure that all unit tests pass (for small modifications, it might be sufficient to only run the specific test file, e.g., python -m py.test tests/protein/test_graphs.py)
  • [x] Checked for style issues by running black . and isort .

biochunan avatar Nov 03 '23 12:11 biochunan

Thanks @biochunan LGTM! Only comment re: pdb files - I'm quite sure these can be uploaded uncompressed. See: https://github.com/a-r-j/graphein/tree/master/tests/protein/test_data

a-r-j avatar Nov 06 '23 09:11 a-r-j

On second thought, it's likely the .gitignore that's preventing you from adding the .pdb file. Try: git add input_pdb_cryst1.pdb --force.

a-r-j avatar Nov 06 '23 13:11 a-r-j

Hi @a-r-j thanks for going through the PR. For the pdb file, I was trying to upload it through the PR window and GitHub doesn't support files with the suffix pdb. Will use existing pdb files in ./test_data in the future.

biochunan avatar Nov 06 '23 13:11 biochunan

I had a look at the three pdb files in tests/protein/test_data, and they do not have insertion code. Maybe it's a good idea to add a PDB file with insertion codes for insertions related testing.

biochunan avatar Nov 06 '23 14:11 biochunan

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

sonarqubecloud[bot] avatar Nov 08 '23 17:11 sonarqubecloud[bot]

Codecov Report

Attention: Patch coverage is 90.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 45.07%. Comparing base (8123f42) to head (26cfdbb). Report is 166 commits behind head on master.

Files Patch % Lines
graphein/protein/features/nodes/dssp.py 90.00% 1 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #355      +/-   ##
==========================================
+ Coverage   40.27%   45.07%   +4.80%     
==========================================
  Files          48      113      +65     
  Lines        2811     7916    +5105     
==========================================
+ Hits         1132     3568    +2436     
- Misses       1679     4348    +2669     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Mar 31 '24 17:03 codecov-commenter