Package chemaxon.marvin.util
Class MolFragLoader
- java.lang.Object
-
- chemaxon.marvin.util.MolFragLoader
-
@PublicAPI public class MolFragLoader extends Object
Molecule fragment loader. Fragments can be added to the root structure or to R-group definitions as members.- Since:
- Marvin 5.2
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MolFragLoader.RgroupAttachmentCountFilter
Molecule filter which accepts molecules with a specified number of R-group attachments.
-
Field Summary
Fields Modifier and Type Field Description static MolFilter
FILTER_ONE_ATTACHMENT
Filter object for accepting fragments with one attachment point.static MolFilter
FILTER_TWO_ATTACHMENTS
Filter object for accepting fragments with two attachment points.
-
Constructor Summary
Constructors Constructor Description MolFragLoader()
Constructor.MolFragLoader(MolImporter importer)
Constructor: sets the molecule fragment iterator from the specified importer.MolFragLoader(MoleculeIterator iterator)
Constructor: sets the molecule fragment iterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
arrangeRgroupMembers(RgMolecule mol)
Arranges R-group definition member coordinates.Molecule
loadFrags()
Loads fragments, fuses them and returns the resulting molecule.Molecule
loadFrags(boolean arrange)
Loads fragments, fuses them and returns the resulting molecule.void
loadFrags(MoleculeGraph mol, boolean arrange)
Loads fragments, fuses them to the specified molecule.void
loadFrags(MoleculeGraph mol, int dim, boolean arrange)
Loads fragments, fuses them to the specified molecule.void
loadRgroupMembers(RgMolecule mol, int rgroupID)
Loads fragments and adds them as R-group definition members in the specified molecule.void
setFilter(MolFilter filter)
Sets the fragment filter.void
setImporter(MolImporter importer)
Sets the fragment iterator from the specified importer.void
setIterator(MoleculeIterator iterator)
Sets the fragment iterator.void
setRange(chemaxon.common.util.IntRange range)
Sets the (1-based) fragment index range to be loaded.
-
-
-
Constructor Detail
-
MolFragLoader
public MolFragLoader()
Constructor.
-
MolFragLoader
public MolFragLoader(MolImporter importer)
Constructor: sets the molecule fragment iterator from the specified importer.- Parameters:
importer
- the fragment importer
-
MolFragLoader
public MolFragLoader(MoleculeIterator iterator)
Constructor: sets the molecule fragment iterator.- Parameters:
iterator
- the fragment iterator- Since:
- Marvin 5.4
-
-
Method Detail
-
setImporter
public void setImporter(MolImporter importer)
Sets the fragment iterator from the specified importer.- Parameters:
importer
- the fragment importer
-
setIterator
public void setIterator(MoleculeIterator iterator)
Sets the fragment iterator.- Parameters:
iterator
- the fragment iterator- Since:
- Marvin 5.4
-
setRange
public void setRange(chemaxon.common.util.IntRange range)
Sets the (1-based) fragment index range to be loaded. The range is assumed to be sorted in ascending order.- Parameters:
range
- the fragment index range
-
setFilter
public void setFilter(MolFilter filter)
Sets the fragment filter. Only those fragments will be added which pass this filter. For example, the filter may accept only structures with one R-group attachment point (FILTER_ONE_ATTACHMENT
), or structures with two R-group attachment points (FILTER_TWO_ATTACHMENTS
), checking attachment point types. (By default, all loaded fragments will be added.)- Parameters:
filter
- the fragment filter- See Also:
FILTER_ONE_ATTACHMENT
,FILTER_TWO_ATTACHMENTS
-
loadFrags
public Molecule loadFrags()
Loads fragments, fuses them and returns the resulting molecule. If a fragment is anRgMolecule
then its root structure (structure without R-definitions) is used. Arranges fragments if needed.- Returns:
- the resulting molecule
- Since:
- Marvin 5.3
-
loadFrags
public Molecule loadFrags(boolean arrange)
Loads fragments, fuses them and returns the resulting molecule. If a fragment is anRgMolecule
then its root structure (structure without R-definitions) is used.- Parameters:
arrange
- istrue
if fragment coordinates should be shifted to avoid overlappings- Returns:
- the resulting molecule
- Since:
- Marvin 5.3
-
loadFrags
public void loadFrags(MoleculeGraph mol, boolean arrange)
Loads fragments, fuses them to the specified molecule. If a fragment is anRgMolecule
then its root structure (structure without R-definitions) is used.- Parameters:
mol
- the base moleculearrange
- istrue
if fragment coordinates should be shifted to avoid overlappings
-
loadFrags
public void loadFrags(MoleculeGraph mol, int dim, boolean arrange)
Loads fragments, fuses them to the specified molecule. If a fragment is anRgMolecule
then its root structure (structure without R-definitions) is used.- Parameters:
mol
- the base moleculedim
- the cleaning dim,-1
for automatic (dim of first fragment)arrange
- istrue
if fragment coordinates should be shifted to avoid overlappings- Since:
- Marvin 5.3
-
loadRgroupMembers
public void loadRgroupMembers(RgMolecule mol, int rgroupID)
Loads fragments and adds them as R-group definition members in the specified molecule. If a fragment is anRgMolecule
then its root structure (structure without R-definitions) is used.- Parameters:
mol
- the base moleculergroupID
- the R-group ID,0
for unnumbered R-group
-
arrangeRgroupMembers
public void arrangeRgroupMembers(RgMolecule mol)
Arranges R-group definition member coordinates. Shifts members to avoid overlappings after one or more invokation ofloadRgroupMembers(chemaxon.struc.RgMolecule, int)
.- Parameters:
mol
- the molecule
-
-