public class MonomerParser extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ATTACHEMENT_ELEMENT |
static String |
ATTACHEMENT_ID_ELEMENT |
static String |
ATTACHEMENT_LABEL_ELEMENT |
static String |
ATTACHEMENTS_ELEMENT |
static String |
ATTACHEMENTS_LIST_ELEMENT |
static String |
CAP_GROUP_NAME_ELEMENT |
static String |
CAP_GROUP_SMILES_ELEMENT |
static String |
MONOMER_ELEMENT |
static String |
MONOMER_ID_ELEMENT |
static String |
MONOMER_MOL_FILE_ELEMENT |
static String |
MONOMER_NAME_ELEMENT |
static String |
MONOMER_SMILES_ELEMENT |
static String |
MONOMER_TYPE_ELEMENT |
static String |
NATURAL_ANALOG_ELEMENT |
static String |
POLYMER_TYPE_ELEMENT |
protected static String |
SMILES_EXTENSION_SEPARATOR_REGEX |
| Constructor and Description |
|---|
MonomerParser() |
| Modifier and Type | Method and Description |
|---|---|
static void |
fillAttachmentInfo(Attachment att) |
static org.jdom2.Element |
getAttachementElement(Attachment att)
This method converts Attachment to ATTACHMENT XML element
|
static Attachment |
getAttachment(org.jdom2.Element attachment)
Convert ATTACHMENT element to Attachment object
|
static Monomer |
getMonomer(org.jdom2.Element monomer)
Convert monomer element to Monomer object
|
static Monomer |
getMonomer(String monomerXMLString) |
static org.jdom2.Element |
getMonomerElement(Monomer monomer)
This method converts Monomer to MONOMER XML element
|
static List<Monomer> |
getMonomerList(String monomerXMLString) |
static boolean |
validateAttachement(Attachment attachment)
This method validates Attachment by the following rules
Attachment must have unique ID
cap group SMILES must be valid
cap group SMILES must contain one R group
R group in SMILES must match R group label
|
static void |
validateAttachmentLabel(String label)
This method checks if attachment label is in the format of R#, where # is a
number
|
static boolean |
validateMonomer(Monomer monomer)
This methods checks the validity of the monomer based on the following
rules
monomer cannot be null
polymer type cannot be null
and must be one of the defined polymer type
monomer type cannot be null and must be one of the defined monomer type for a given polymer
type
Monomer ID cannot be null
structure cannot be null for non-chemical type monomer
structure SMILES must be valid
attachment labels on monomer must be unique
Attachment number on SMILES must match attachment List size
Each attachment in attachment list must be valid (call validateAttachment())
Attachment labels on monomer must match atachment label on attachment
list
For non-chemical type monomers, modified monomer (ID length
greater than 1) must have natural analog
All monomers must have at least one attachment
|
public static final String MONOMER_ELEMENT
public static final String MONOMER_ID_ELEMENT
public static final String MONOMER_SMILES_ELEMENT
public static final String MONOMER_MOL_FILE_ELEMENT
public static final String MONOMER_TYPE_ELEMENT
public static final String POLYMER_TYPE_ELEMENT
public static final String NATURAL_ANALOG_ELEMENT
public static final String MONOMER_NAME_ELEMENT
public static final String ATTACHEMENTS_LIST_ELEMENT
public static final String ATTACHEMENTS_ELEMENT
public static final String ATTACHEMENT_ELEMENT
public static final String ATTACHEMENT_ID_ELEMENT
public static final String ATTACHEMENT_LABEL_ELEMENT
public static final String CAP_GROUP_NAME_ELEMENT
public static final String CAP_GROUP_SMILES_ELEMENT
protected static final String SMILES_EXTENSION_SEPARATOR_REGEX
public static Attachment getAttachment(org.jdom2.Element attachment)
attachment - elementpublic static org.jdom2.Element getAttachementElement(Attachment att)
att - -- Attachmentpublic static boolean validateAttachement(Attachment attachment) throws MonomerException, IOException, ChemistryException
attachment - given attachmentMonomerException - if attachment is not validIOException - IO errorChemistryException - if chemistry engine can not be initializedpublic static Monomer getMonomer(org.jdom2.Element monomer) throws MonomerException
monomer - elementMonomerException - if element is not a valid monomerpublic static org.jdom2.Element getMonomerElement(Monomer monomer) throws MonomerException
monomer - given monomerMonomerException - if monomer is not validpublic static List<Monomer> getMonomerList(String monomerXMLString) throws org.jdom2.JDOMException, IOException, MonomerException, org.helm.chemtoolkit.CTKException, ChemistryException
org.jdom2.JDOMExceptionIOExceptionMonomerExceptionorg.helm.chemtoolkit.CTKExceptionChemistryExceptionpublic static Monomer getMonomer(String monomerXMLString) throws org.jdom2.JDOMException, IOException, MonomerException
org.jdom2.JDOMExceptionIOExceptionMonomerExceptionpublic static boolean validateMonomer(Monomer monomer) throws MonomerException, IOException, org.helm.chemtoolkit.CTKException, ChemistryException
monomer - given monomerMonomerException - if monomer is not validIOException - IO errororg.helm.chemtoolkit.CTKException - general ChemToolKit exception passed to HELMToolKitChemistryException - if chemistry engine can not be initializedpublic static void validateAttachmentLabel(String label) throws MonomerException
label - attachment labelMonomerException - if label is not validpublic static void fillAttachmentInfo(Attachment att) throws MonomerException, IOException, org.jdom2.JDOMException, ChemistryException, org.helm.chemtoolkit.CTKException
MonomerExceptionIOExceptionorg.jdom2.JDOMExceptionChemistryExceptionorg.helm.chemtoolkit.CTKExceptionCopyright © 2017. All rights reserved.