-
Notifications
You must be signed in to change notification settings - Fork 7
[ENH] Replace PFOA with 5NU7 and 1BRQ #198
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
Open
satvshr
wants to merge
3
commits into
main
Choose a base branch
from
issue197
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,31 @@ | ||
| """Contains datasets along with their loaders.""" | ||
|
|
||
| from pyaptamer.datasets._loaders._aptacom_loader import ( | ||
| from pyaptamer.datasets._loaders import ( | ||
| load_1brq, | ||
| load_1brq_structure, | ||
| load_1gnh, | ||
| load_1gnh_structure, | ||
| load_5nu7, | ||
| load_5nu7_structure, | ||
| load_aptacom_full, | ||
| load_aptacom_x_y, | ||
| load_csv_dataset, | ||
| load_from_rcsb, | ||
| load_hf_dataset, | ||
| ) | ||
| from pyaptamer.datasets._loaders._csv_loader import load_csv_dataset | ||
| from pyaptamer.datasets._loaders._hf_loader import load_hf_dataset | ||
| from pyaptamer.datasets._loaders._one_gnh import load_1gnh, load_1gnh_structure | ||
| from pyaptamer.datasets._loaders._online_databank import load_from_rcsb | ||
| from pyaptamer.datasets._loaders._pfoa import load_pfoa, load_pfoa_structure | ||
|
|
||
| __all__ = [ | ||
| "load_aptacom_full", | ||
| "load_aptacom_x_y", | ||
| "load_csv_dataset", | ||
| "load_hf_dataset", | ||
| "load_pfoa", | ||
| "load_pfoa_structure", | ||
| "load_from_rcsb", | ||
| "mol_loader", | ||
| "structure_loader", | ||
| "load_1brq", | ||
| "load_1brq_structure", | ||
| "load_5nu7", | ||
| "load_5nu7_structure", | ||
| "load_1gnh", | ||
| "load_1gnh_structure", | ||
| "load_from_rcsb", | ||
| "load_csv_dataset", | ||
| ] | ||
24 changes: 12 additions & 12 deletions
24
pyaptamer/datasets/_loaders/_pfoa.py → pyaptamer/datasets/_loaders/_1brq.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,43 +1,43 @@ | ||
| __author__ = ["satvshr", "fkiraly"] | ||
| __all__ = ["load_pfoa", "load_pfoa_structure"] | ||
| __author__ = "satvshr" | ||
| __all__ = ["load_1brq", "load_1brq_structure"] | ||
|
|
||
| import os | ||
|
|
||
|
|
||
| def load_pfoa(): | ||
| """Load the PFOA molecule as a MoleculeLoader. | ||
| def load_1brq(): | ||
| """Load the 1brq molecule as a MoleculeLoader. | ||
|
|
||
| Returns | ||
| ------- | ||
| loader : MoleculeLoader | ||
| A MoleculeLoader object representing the PFOA molecule. | ||
| A MoleculeLoader object representing the 1brq molecule. | ||
| """ | ||
| from pyaptamer.data.loader import MoleculeLoader | ||
|
|
||
| pdb_path = os.path.join(os.path.dirname(__file__), "..", "data", "pfoa.pdb") | ||
| pdb_path = os.path.join(os.path.dirname(__file__), "..", "data", "1brq.pdb") | ||
|
|
||
| return MoleculeLoader(pdb_path) | ||
|
|
||
|
|
||
| def load_pfoa_structure(pdb_path=None): | ||
| def load_1brq_structure(pdb_path=None): | ||
| """ | ||
| Load the PFOA molecule from a PDB file using Biopython. | ||
| Load the 1brq molecule from a PDB file using Biopython. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| pdb_path : str, optional | ||
| Path to the PDB file. If not provided, the function uses the default path | ||
| located in the '../data/pfoa.pdb' relative to the current file. | ||
| located in the '../data/1brq.pdb' relative to the current file. | ||
|
|
||
| Returns | ||
| ------- | ||
| structure : Bio.PDB.Structure.Structure | ||
| A Biopython Structure object representing the PFOA molecule. | ||
| A Biopython Structure object representing the 1BRQ molecule. | ||
| """ | ||
| from Bio.PDB import PDBParser | ||
|
|
||
| pdb_path = os.path.join(os.path.dirname(__file__), "..", "data", "pfoa.pdb") | ||
| pdb_path = os.path.join(os.path.dirname(__file__), "..", "data", "1brq.pdb") | ||
|
|
||
| parser = PDBParser(QUIET=True) | ||
| structure = parser.get_structure("PFOA", pdb_path) | ||
| structure = parser.get_structure("1brq", pdb_path) | ||
| return structure |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| __author__ = "satvshr" | ||
| __all__ = ["load_5nu7", "load_5nu7_structure"] | ||
|
|
||
| import os | ||
|
|
||
|
|
||
| def load_5nu7(): | ||
| """Load the 5nu7 molecule as a MoleculeLoader. | ||
|
|
||
| Returns | ||
| ------- | ||
| loader : MoleculeLoader | ||
| A MoleculeLoader object representing the 5nu7 molecule. | ||
| """ | ||
| from pyaptamer.data.loader import MoleculeLoader | ||
|
|
||
| pdb_path = os.path.join(os.path.dirname(__file__), "..", "data", "5nu7.pdb") | ||
|
|
||
| return MoleculeLoader(pdb_path) | ||
|
|
||
|
|
||
| def load_5nu7_structure(pdb_path=None): | ||
| """ | ||
| Load the 5nu7 molecule from a PDB file using Biopython. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| pdb_path : str, optional | ||
| Path to the PDB file. If not provided, the function uses the default path | ||
| located in the '../data/5nu7.pdb' relative to the current file. | ||
|
|
||
| Returns | ||
| ------- | ||
| structure : Bio.PDB.Structure.Structure | ||
| A Biopython Structure object representing the 5NU7 molecule. | ||
| """ | ||
| from Bio.PDB import PDBParser | ||
|
|
||
| pdb_path = os.path.join(os.path.dirname(__file__), "..", "data", "5nu7.pdb") | ||
|
|
||
| parser = PDBParser(QUIET=True) | ||
| structure = parser.get_structure("5nu7", pdb_path) | ||
| return structure |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,35 @@ | ||
| """Loaders for different data structures.""" | ||
|
|
||
| from pyaptamer.datasets._loaders._1brq import ( | ||
| load_1brq, | ||
| load_1brq_structure, | ||
| ) | ||
| from pyaptamer.datasets._loaders._1gnh import ( | ||
| load_1gnh, | ||
| load_1gnh_structure, | ||
| ) | ||
| from pyaptamer.datasets._loaders._5nu7 import ( | ||
| load_5nu7, | ||
| load_5nu7_structure, | ||
| ) | ||
| from pyaptamer.datasets._loaders._aptacom_loader import ( | ||
| load_aptacom_full, | ||
| load_aptacom_x_y, | ||
| ) | ||
| from pyaptamer.datasets._loaders._csv_loader import load_csv_dataset | ||
| from pyaptamer.datasets._loaders._hf_loader import load_hf_dataset | ||
| from pyaptamer.datasets._loaders._one_gnh import load_1gnh_structure | ||
| from pyaptamer.datasets._loaders._pfoa import load_pfoa_structure | ||
| from pyaptamer.datasets._loaders._online_databank import load_from_rcsb | ||
|
|
||
| __all__ = [ | ||
| "load_pfoa_structure", | ||
| "load_1gnh_structure", | ||
| "load_aptacom_full", | ||
| "load_aptacom_x_y", | ||
| "load_csv_dataset", | ||
| "load_from_rcsb", | ||
| "load_hf_dataset", | ||
| "load_pfoa_structure", | ||
| "load_1gnh", | ||
| "load_1gnh_structure", | ||
| "load_1brq", | ||
| "load_1brq_structure", | ||
| "load_5nu7", | ||
| "load_5nu7_structure", | ||
| ] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like some exports get deleted - why?