Closed manonreau closed 1 year ago
Kudos, SonarCloud Quality Gate passed!
0 Bugs
0 Vulnerabilities
0 Security Hotspots
2 Code Smells
No Coverage information
12.5% Duplication
Base: 40.27% // Head: 47.76% // Increases project coverage by +7.49%
:tada:
Coverage data is based on head (
3eb36cf
) compared to base (8123f42
). Patch coverage: 51.86% of modified lines in pull request are covered.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Hi all! Just a comment regarding the updates in the atoms.groupby called inside the centroid calculations. It seems the input list starts with residue_number which makes the centroid data.frame being ordered by the residue_number. In the case we are working with two protein chains, the rows of this data.frame will be different from the G.graph["pdb_df"] called, for instance, inside the add_distance_threshold. Thus, the edges are created between wrong nodes. It seems that just changing the order of the input list for atoms.groupby (starting for instance by chaid_id) could correct this issue, but not sure about downstream impacts of this modification.
Reference Issues/PRs
Fixes #219
What does this implement/fix? Explain your changes
graphein/protein/edges/distance.py
not to compute distances and angles on empty dataframesatoms.groupby("residue_number")
->atoms.groupby(["residue_number","chain_id","residue_name"])
)What testing did you do to verify the changes in this PR?
new_edge_funcs = {"edge_construction_functions": [add_peptide_bonds, add_aromatic_interactions, add_hydrogen_bond_interactions, add_disulfide_interactions, add_ionic_interactions, add_aromatic_sulphur_interactions, add_cation_pi_interactions, partial(add_distance_threshold, long_interaction_threshold=2, threshold=20.)]}
params_to_change = {"granularity": "centroids"} config = ProteinGraphConfig(new_edge_funcs, params_to_change)
pdb_name = 'xxxx.pdb' g = construct_graph(config=config, pdb_path=pdb_name) g.coords