Skip to content

Commit

Permalink
add moveTo to v1suppliers (#7222)
Browse files Browse the repository at this point in the history
  • Loading branch information
ricrogz committed Mar 9, 2024
1 parent bdb900d commit 38154cc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Code/GraphMol/FileParsers/MolSupplier.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ class RDKIT_FILEPARSERS_EXPORT SmilesMolSupplier : public MolSupplier {
* file parser above
* - As an when new molecules are read using "next" their
* positions in the file are noted.
* - A call to the "length" will autamatically parse the entire
* - A call to the "length" will automatically parse the entire
* file and cache all the mol block positions
* - [] operator is used to access a molecule at "idx", calling
* next following this will result in the next molecule after
Expand Down Expand Up @@ -343,7 +343,7 @@ class RDKIT_FILEPARSERS_EXPORT TDTMolSupplier : public MolSupplier {
* file parser above
* - As an when new molecules are read using "next" their
* positions in the file are noted.
* - A call to the "length" will autamatically parse the entire
* - A call to the "length" will automatically parse the entire
* file and cache all the mol block positions
* - [] operator is used to access a molecule at "idx", calling
* next following this will result in the next molecule after
Expand Down Expand Up @@ -399,7 +399,7 @@ class RDKIT_FILEPARSERS_EXPORT TDTMolSupplier : public MolSupplier {
TDTMolSupplierParams d_params;
};

//! Deprectead, will be removed in 2024.09 release
//! Deprecated, will be removed in 2024.09 release
class RDKIT_FILEPARSERS_EXPORT PDBMolSupplier : public MolSupplier {
public:
explicit PDBMolSupplier(std::istream *inStream, bool takeOwnership = true,
Expand Down
22 changes: 19 additions & 3 deletions Code/GraphMol/FileParsers/MolSupplier.v1API.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ class RDKIT_FILEPARSERS_EXPORT SDMolSupplier : public ForwardSDMolSupplier {
new v2::FileParsers::SDMolSupplier(inStream, takeOwnership, params));
}

void moveTo(unsigned int idx) {
PRECONDITION(dp_supplier, "no supplier");
static_cast<ContainedType *>(dp_supplier.get())->moveTo(idx);
}
ROMol *operator[](unsigned int idx) {
PRECONDITION(dp_supplier, "no supplier");
return static_cast<ContainedType *>(dp_supplier.get())
Expand Down Expand Up @@ -231,7 +235,7 @@ class RDKIT_FILEPARSERS_EXPORT SmilesMolSupplier : public MolSupplier {
* file parser above
* - As an when new molecules are read using "next" their
* positions in the file are noted.
* - A call to the "length" will autamatically parse the entire
* - A call to the "length" will automatically parse the entire
* file and cache all the mol block positions
* - [] operator is used to access a molecule at "idx", calling
* next following this will result in the next molecule after
Expand Down Expand Up @@ -298,6 +302,10 @@ class RDKIT_FILEPARSERS_EXPORT SmilesMolSupplier : public MolSupplier {
params.parseParameters.sanitize = sanitize;
static_cast<ContainedType *>(dp_supplier.get())->setData(text, params);
}
void moveTo(unsigned int idx) {
PRECONDITION(dp_supplier, "no supplier");
static_cast<ContainedType *>(dp_supplier.get())->moveTo(idx);
}
ROMol *operator[](unsigned int idx) {
PRECONDITION(dp_supplier, "no supplier");
return static_cast<ContainedType *>(dp_supplier.get())
Expand Down Expand Up @@ -326,7 +334,7 @@ class RDKIT_FILEPARSERS_EXPORT TDTMolSupplier : public MolSupplier {
* file parser above
* - As an when new molecules are read using "next" their
* positions in the file are noted.
* - A call to the "length" will autamatically parse the entire
* - A call to the "length" will automatically parse the entire
* file and cache all the mol block positions
* - [] operator is used to access a molecule at "idx", calling
* next following this will result in the next molecule after
Expand Down Expand Up @@ -378,6 +386,10 @@ class RDKIT_FILEPARSERS_EXPORT TDTMolSupplier : public MolSupplier {
params.parseParameters.sanitize = sanitize;
static_cast<ContainedType *>(dp_supplier.get())->setData(text, params);
}
void moveTo(unsigned int idx) {
PRECONDITION(dp_supplier, "no supplier");
static_cast<ContainedType *>(dp_supplier.get())->moveTo(idx);
}
ROMol *operator[](unsigned int idx) {
PRECONDITION(dp_supplier, "no supplier");
return static_cast<ContainedType *>(dp_supplier.get())
Expand All @@ -399,7 +411,7 @@ class RDKIT_FILEPARSERS_EXPORT TDTMolSupplier : public MolSupplier {
}
};

//! Deprectead, will be removed in 2024.09 release
//! Deprecated, will be removed in 2024.09 release
class RDKIT_FILEPARSERS_EXPORT PDBMolSupplier : public MolSupplier {
public:
explicit PDBMolSupplier(std::istream *inStream, bool takeOwnership = true,
Expand Down Expand Up @@ -462,6 +474,10 @@ class RDKIT_FILEPARSERS_EXPORT MaeMolSupplier : public MolSupplier {
params.removeHs = removeHs;
dp_supplier.reset(new ContainedType(fname, params));
}
void moveTo(unsigned int idx) {
PRECONDITION(dp_supplier, "no supplier");
static_cast<ContainedType *>(dp_supplier.get())->moveTo(idx);
}
RWMol *operator[](unsigned int idx) {
PRECONDITION(dp_supplier, "no supplier");
return static_cast<ContainedType *>(dp_supplier.get())
Expand Down

0 comments on commit 38154cc

Please sign in to comment.