Package com.actelion.research.chem.mmp
Class MMPReader
- java.lang.Object
-
- com.actelion.research.chem.mmp.MMPReader
-
public class MMPReader extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classMMPReader.DataFieldstatic classMMPReader.MatchedMolecularPair
-
Field Summary
Fields Modifier and Type Field Description static java.util.Comparator<com.actelion.research.chem.mmp.MMPReader.MatchedMolecularPairExamples>EXAMPLES_SIMILARITY_SORTstatic java.util.Comparator<MMPReader.MatchedMolecularPair>NUMBER_OF_EXAMPLES_SORTstatic java.util.Comparator<MMPReader.MatchedMolecularPair>SIMILARITY_SORTstatic java.lang.StringSORT_BY_NUMBER_OF_EXAMPLESstatic java.lang.StringSORT_BY_SIMILARITY
-
Constructor Summary
Constructors Constructor Description MMPReader(java.io.BufferedReader br, boolean verbose)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.IntegerfragmentToFragmentIndex(java.lang.String fragment)Returns the fragment index from one fragment idCodejava.lang.Integer[]fragmentToFragmentIndex(java.lang.String[] fragments)Return the fragment indexes from one (single cut) or several fragment idCodesjava.lang.IntegerfragmentToFragmentSize(java.lang.String fragment)Returns the number of heavy atoms of one fragmentjava.util.List<java.lang.String>getChemicalSpace(java.lang.String[] keys, java.lang.String value, java.lang.String dataField)Returns the list of idCode & molecules names representing the chemical space of one constant part of a moleculejava.lang.StringgetChemicalSpaceDWAR(java.lang.String moleculeIDCode, java.lang.String[] keys, java.lang.String dataField)Generates the DWAR file for the chemical space for a specific 'key' and data fieldintgetChemicalSpaceSize(java.lang.String key)Returns the size of the chemical space corresponding to a specific 'key' (constant part of a molecule)intgetChemicalSpaceSize(java.lang.String[] keys)Returns the size of the chemical space corresponding to one constant part of a moleculejava.util.List<java.lang.String>getDataFields(java.lang.String what)Returns a list of fieldsjava.lang.StringgetIDCodeFromMolName(java.lang.String molName)Returns the idCode from one compound name, null if the compound is not foundjava.lang.StringgetMMPsDWAR(java.lang.String moleculeIDCode, java.lang.String[] keys, java.lang.String value1, java.lang.String value2, int replacementSize, java.util.List<java.lang.String> properties)Generates the DWAR file for the Matched Molecular Pairs corresponding to a specific seed 'value', target 'value', and list of data fieldsjava.lang.StringgetTransformationsDWAR(java.lang.String moleculeIDCode, java.lang.String[] keys, java.lang.String value1, int minAtoms, int maxAtoms, java.lang.Integer environmentSize, java.util.List<java.lang.String> properties)Generates the DWAR file for the Transformations corresponding to a specific seed 'value', number of atoms for the replacement, environment size, and list of data fieldsjava.lang.StringgetTransformationsJSON(java.lang.String moleculeIDCode, java.lang.String[] keys, java.lang.String value1, int minAtoms, int maxAtoms, java.lang.String sortBy)Generates the main JSON file for Transformations and Matched Molecular PairsintgetTransformationsSize(java.lang.String value1, int minAtoms, int maxAtoms)Returns the number of transformations for a defined variable part of a moleculejava.lang.StringgetWhat(java.lang.String what)Returns the requested general information of the data setjava.util.List<java.lang.String[]>transformationsListToTable(java.lang.String[] keys, java.lang.String value1, int minAtoms, int maxAtoms)Returns a list of transformations
-
-
-
Field Detail
-
SORT_BY_SIMILARITY
public static final java.lang.String SORT_BY_SIMILARITY
- See Also:
- Constant Field Values
-
SORT_BY_NUMBER_OF_EXAMPLES
public static final java.lang.String SORT_BY_NUMBER_OF_EXAMPLES
- See Also:
- Constant Field Values
-
NUMBER_OF_EXAMPLES_SORT
public static final java.util.Comparator<MMPReader.MatchedMolecularPair> NUMBER_OF_EXAMPLES_SORT
-
SIMILARITY_SORT
public static final java.util.Comparator<MMPReader.MatchedMolecularPair> SIMILARITY_SORT
-
EXAMPLES_SIMILARITY_SORT
public static final java.util.Comparator<com.actelion.research.chem.mmp.MMPReader.MatchedMolecularPairExamples> EXAMPLES_SIMILARITY_SORT
-
-
Method Detail
-
fragmentToFragmentIndex
public java.lang.Integer fragmentToFragmentIndex(java.lang.String fragment)
Returns the fragment index from one fragment idCode- Parameters:
fragment- idCode of a fragment- Returns:
- fragment index
-
fragmentToFragmentIndex
public java.lang.Integer[] fragmentToFragmentIndex(java.lang.String[] fragments)
Return the fragment indexes from one (single cut) or several fragment idCodes- Parameters:
fragments- List of fragment idCodes- Returns:
- List of fragment indexes
-
fragmentToFragmentSize
public java.lang.Integer fragmentToFragmentSize(java.lang.String fragment)
Returns the number of heavy atoms of one fragment- Parameters:
fragment- idCode of a fragment- Returns:
- number of heavy atoms
-
getChemicalSpaceSize
public int getChemicalSpaceSize(java.lang.String key)
Returns the size of the chemical space corresponding to a specific 'key' (constant part of a molecule)- Parameters:
key- idCode of the 'key' (constant part of a molecule)- Returns:
- the size of the chemical space
-
getChemicalSpaceSize
public int getChemicalSpaceSize(java.lang.String[] keys)
Returns the size of the chemical space corresponding to one constant part of a molecule- Parameters:
keys- array of one (single cut) or two (double cut) IDCodes of the 'keys' (constant part of the molecule)- Returns:
- the size of the chemical space.
-
getChemicalSpace
public java.util.List<java.lang.String> getChemicalSpace(java.lang.String[] keys, java.lang.String value, java.lang.String dataField)Returns the list of idCode & molecules names representing the chemical space of one constant part of a molecule- Parameters:
keys- array of one (single cut) or two (double cut) IDCodes of the 'keys' (constant part of the molecule)value- the variable part of the molecule; not used yet but might be used to identify the current compound- Returns:
- an array of tab-delimited idCode, idCoord, molecule names [and data]
-
getChemicalSpaceDWAR
public java.lang.String getChemicalSpaceDWAR(java.lang.String moleculeIDCode, java.lang.String[] keys, java.lang.String dataField)Generates the DWAR file for the chemical space for a specific 'key' and data field- Parameters:
moleculeIDCode- idCode of the seed moleculekeys- Array of one (single cut) or two (double cut) 'keys' idCodes (constant part of the molecule)dataField- null or short name of a data field- Returns:
- the whole string of the generated DWAR file
-
getMMPsDWAR
public java.lang.String getMMPsDWAR(java.lang.String moleculeIDCode, java.lang.String[] keys, java.lang.String value1, java.lang.String value2, int replacementSize, java.util.List<java.lang.String> properties)Generates the DWAR file for the Matched Molecular Pairs corresponding to a specific seed 'value', target 'value', and list of data fields- Parameters:
moleculeIDCode- idCode of the seed moleculekeys- Array of one or two 'keys' idCodes (constant part of the molecule)value1- seed 'value' (variable part of the molecule)value2- target 'value' (variable part of the molecule)replacementSize- size of the replacement (number of heavy atoms)properties- List of data fields for which data should be retrieved- Returns:
- the whole string of the generated DWAR file
-
getTransformationsSize
public int getTransformationsSize(java.lang.String value1, int minAtoms, int maxAtoms)Returns the number of transformations for a defined variable part of a molecule- Parameters:
value1- IDCode of the variable part of a moleculeminAtoms- minimal number of atoms in the replacement (relative to value1Atoms)maxAtoms- maximal number of atoms in the replacement (relative to value1Atoms)- Returns:
- an integer corresponding to the number of transformations
-
getTransformationsDWAR
public java.lang.String getTransformationsDWAR(java.lang.String moleculeIDCode, java.lang.String[] keys, java.lang.String value1, int minAtoms, int maxAtoms, java.lang.Integer environmentSize, java.util.List<java.lang.String> properties)Generates the DWAR file for the Transformations corresponding to a specific seed 'value', number of atoms for the replacement, environment size, and list of data fields- Parameters:
moleculeIDCode- idCode of the seed moleculekeys- Array of 'keys' idCodes (constant part of the molecule)value1- seed 'value' idCode (variable part of the molecule)minAtoms- minimal number of atoms in the replacement (relative to value1Atoms)maxAtoms- maximal number of atoms in the replacement (relative to value1Atoms)environmentSize- size of the environment (0-5)properties- List of numerical data fields- Returns:
- String of the whole DWAR file
-
transformationsListToTable
public java.util.List<java.lang.String[]> transformationsListToTable(java.lang.String[] keys, java.lang.String value1, int minAtoms, int maxAtoms)Returns a list of transformations- Parameters:
keys- Array of 'keys' idCodes (constant part of the molecule)value1- seed 'value' idCode (variable part of the molecule)minAtoms- minimal number of atoms in the replacement (relative to value1Atoms)maxAtoms- maximal number of atoms in the replacement (relative to value1Atoms)- Returns:
- List of transformations
-
getTransformationsJSON
public java.lang.String getTransformationsJSON(java.lang.String moleculeIDCode, java.lang.String[] keys, java.lang.String value1, int minAtoms, int maxAtoms, java.lang.String sortBy)Generates the main JSON file for Transformations and Matched Molecular Pairs- Parameters:
moleculeIDCode- idCode of the seed moleculekeys- Array of 'keys' idCodes (constant part of the molecule)value1- seed 'value' idCode (variable part of the molecule)minAtoms- minimal number of atoms in the replacement (relative to value1Atoms)maxAtoms- maximal number of atoms in the replacement (relative to value1Atoms)sortBy- SORT_BY_SIMILARITY, SORT_BY_NUMBER_OF_EXAMPLES- Returns:
- JSON string
-
getIDCodeFromMolName
public java.lang.String getIDCodeFromMolName(java.lang.String molName)
Returns the idCode from one compound name, null if the compound is not found- Parameters:
molName- name of a compound- Returns:
- null or idCode
-
getDataFields
public java.util.List<java.lang.String> getDataFields(java.lang.String what)
Returns a list of fields- Parameters:
what- Requested data (fieldName, longFieldName, categoryName, percentile5, percentile95)- Returns:
- List of fields
-
getWhat
public java.lang.String getWhat(java.lang.String what)
Returns the requested general information of the data set- Parameters:
what- Requested information (datasetName, date, numberOfMolecules, randomMoleculeName)- Returns:
- the requested information
-
-