Skip to content

Commit

Permalink
exposed fill_value to protein_to_pyg function (#385)
Browse files Browse the repository at this point in the history
* exposed fill_value to protein_to_pyg function

* added to CHANGELOG

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

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

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
kierandidi and pre-commit-ci[bot] committed Apr 17, 2024
1 parent 51beb81 commit 4d97378
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
* Fix bug where the `deprotonate` argument is not wired up to `graphein.protein.graphs.construct_graphs`. [#375](https://github.com/a-r-j/graphein/pull/375)

#### Misc
* Updated Foldcomp datasets with improved setup function and updated database choices such as ESMAtlas [#382](https://github.com/a-r-j/graphein/pull/382)
* exposed `fill_value` option to `protein_to_pyg` function. [#385](https://github.com/a-r-j/graphein/pull/385)
* Updated Foldcomp datasets with improved setup function and updated database choices such as ESMAtlas. [#382](https://github.com/a-r-j/graphein/pull/382)
* Resolve issue with notebook version and `pluggy` in Dockerfile. [#372](https://github.com/a-r-j/graphein/pull/372)
* Remove `typing_extension` as dependency since we now primarily support Python >=3.8 and `Literal` is included in `typing` there.

Expand Down
5 changes: 4 additions & 1 deletion graphein/protein/tensor/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def protein_to_pyg(
atom_types: List[str] = PROTEIN_ATOMS,
remove_nonstandard: bool = True,
store_het: bool = False,
fill_value_coords: float = 1e-5,
) -> Data:
"""
Parses a protein (from either: a PDB code, PDB file or a UniProt ID
Expand Down Expand Up @@ -237,7 +238,9 @@ def protein_to_pyg(
df["residue_id"] = df.residue_id + ":" + df.insertion

out = Data(
coords=protein_df_to_tensor(df, atoms_to_keep=atom_types),
coords=protein_df_to_tensor(
df, atoms_to_keep=atom_types, fill_value=fill_value_coords
),
residues=get_sequence(
df,
chains=chain_selection,
Expand Down

0 comments on commit 4d97378

Please sign in to comment.