Skip to content

Commit

Permalink
Fix handing id when loading from path (#332)
Browse files Browse the repository at this point in the history
* Fix handing id when loading from path

Previously, the id for the pyg data object would become the entire (possibly length) path to the pdb file OR only the filename + chain ID. However, in the later case, the '.pdb' extension would still show up under the id field.

This commit fixes the above to be consistent and to not contain '.pdb' extension in the pyg data id.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add non-standard Cystine

From Wikipedia: "The thiol is susceptible to oxidation to give the disulfide derivative cystine, which serves an important structural role in many proteins. In this case, the symbol Cyx is sometimes used. The deprotonated form can generally be described by the symbol Cym as well."

* Update CHANGELOG.md

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
chaitjo and pre-commit-ci[bot] committed Aug 20, 2023
1 parent 281ce30 commit e0d5d63
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* Fixes initialisation of `Protein` objects. [#317](https://github.com/a-r-j/graphein/issues/317) [#318](https://github.com/a-r-j/graphein/pull/318)
* Fixes incorrect `rad` and `embed` argument logic in `graphein.protein.tensor.angles.dihedrals/sidechain_torsion` [#321](https://github.com/a-r-j/graphein/pull/321)
* Fixes incorrect start padding in pNeRF output [#321](https://github.com/a-r-j/graphein/pull/321)
* Fixes setting ID for PyG data objects when loading from a path to a `.pdb` file [#332](https://github.com/a-r-j/graphein/pull/332)

#### Other Changes
* Adds transform composition to FoldComp Dataset [#312](https://github.com/a-r-j/graphein/pull/312)
Expand All @@ -35,6 +36,7 @@
* Adds transform composition to FoldComp Dataset [#312](https://github.com/a-r-j/graphein/pull/312)
* Improve FoldComp dataloading performance and include B factors (pLDDT) in output. [#313](https://github.com/a-r-j/graphein/pull/313) [#315](https://github.com/a-r-j/graphein/pull/315)
* Add new helper functions to PDBManager [#322](https://github.com/a-r-j/graphein/pull/322) (@amorehead)
* Add non-standard 'CYX' to `RESI_THREE_TO_1`.

### 1.7.0 - 10 /04/2023

Expand Down
1 change: 1 addition & 0 deletions graphein/protein/resi_atoms.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,7 @@
"CSX": "C",
"CXM": "M",
"CYS": "C",
"CYX": "C",
"DAL": "A",
"DAR": "R",
"DCY": "C",
Expand Down
6 changes: 4 additions & 2 deletions graphein/protein/tensor/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,11 @@ def protein_to_pyg(
# Get ID
if path is not None:
id = (
path.split("/")[-1] + "_" + "".join(chain_selection)
os.path.splitext(path)[0].split("/")[-1]
+ "_"
+ "".join(chain_selection)
if chain_selection != "all"
else path
else os.path.splitext(path)[0].split("/")[-1]
)
elif pdb_code is not None:
id = (
Expand Down

0 comments on commit e0d5d63

Please sign in to comment.