Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exposed fill_value to protein_to_pyg function #385

Merged
merged 3 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading