Class WebOxidationAnalyzer
java.lang.Object
_global.tri.oxidationstates.webapi.WebOxidationAnalyzer
This is the primary class for the Web API. The main methods to call are:
getTableData(): This will return a JSON-formatted string containing all of the data required
to build the table on the web app. Two methods are provided: one that can take a structure file,
and one that can take a composition string
assignOxidationStates(): This will assign the selected oxidation states to the structure
-
Constructor Summary
ConstructorsConstructorDescriptionWebOxidationAnalyzer(String jsonBoundaryFileLocation, String polyIonLocation) Initializes the analyzer. -
Method Summary
Modifier and TypeMethodDescriptiongetJSONFromComposition(String elementalComposition) Returns all combinations of oxidation states with optimal likelihood above the specified lower bound.getJSONFromStructure(String structureFileString) Returns a JSON-formatted string containing the data needed to generate the oxidation state table for the given structure.doubleReturns the minimum allowed likelihood.getPageDataFromComposition(String compositionString) Returns all combinations of oxidation states with optimal likelihood above the specified lower bound.getPageDataFromComposition(String compositionString, boolean enumeratePossiblePolyanions) Returns all combinations of oxidation states with optimal likelihood above the provided lower bound.getPageDataFromStructure(String structureFileString) Returns an object containing the data needed to generate the web site pagefor the given structure.intReturn the minimum length of the list.voidsetMinAllowedLikelihood(double value) Sets the minimum allowed likelihood.voidsetMinListLength(int value) Set the minimum length of the list.
-
Constructor Details
-
WebOxidationAnalyzer
Initializes the analyzer. Ideally this would only be done once, to avoid initialization overhead with each request.- Parameters:
jsonBoundaryFileLocation- The location of the file containing the oxidation state analysis boundaries in JSON format.polyIonLocation- The location of the directory containing the information on known polyatomic ions.
-
-
Method Details
-
setMinAllowedLikelihood
public void setMinAllowedLikelihood(double value) Sets the minimum allowed likelihood. No combinations of oxidation states with optimal likelihood below this will be returned.- Parameters:
value- The minimum allowed likelihood.
-
getMinAllowedLikelihood
public double getMinAllowedLikelihood()Returns the minimum allowed likelihood. No combinations of oxidation states with optimal likelihood below this will be returned.- Returns:
- the minimum allowed likelihood. The default value is 0.01.
-
setMinListLength
public void setMinListLength(int value) Set the minimum length of the list. At least this many rows will be returned, even if some of them have likelihoods belowgetMinAllowedLikelihood(). Fewer rows may be returned if there are fewer total possible combinations of oxidation states.- Parameters:
value- The minimum length of the list. At least this many rows will be returned, even if some of them have likelihoods belowgetMinAllowedLikelihood(). Fewer rows may be returned if there are fewer total possible combinations of oxidation states.
-
minListLength
public int minListLength()Return the minimum length of the list. At least this many rows will be returned, even if some of them have likelihoods belowgetMinAllowedLikelihood(). Fewer rows may be returned if there are fewer total possible combinations of oxidation states.- Returns:
- the minimum length of the list. At least this many rows will be returned, even if some
of them have likelihoods below
getMinAllowedLikelihood(). Fewer rows may be returned if there are fewer total possible combinations of oxidation states.
-
getJSONFromComposition
Returns all combinations of oxidation states with optimal likelihood above the specified lower bound.- Parameters:
elementalComposition- The composition of the structure. Specifying polyatomic ions in parenthesis is allowed, If any polyatomic ions are recognized, the oxidation state ranges for those ions will be used instead of those for the constitutive elements.- Returns:
- A JSON-formatted string with all of the possible oxidation states for the table in the Web UI.
-
getPageDataFromComposition
Returns all combinations of oxidation states with optimal likelihood above the specified lower bound.- Parameters:
compositionString- The composition of the structure. Specifying polyatomic ions in parenthesis is allowed, If any polyatomic ions are recognized, the oxidation state ranges for those ions will be used instead of those for the constitutive elements.- Returns:
- A TableData object with all of the possible oxidation states for the table in the Web UI.
-
getPageDataFromComposition
public PageData getPageDataFromComposition(String compositionString, boolean enumeratePossiblePolyanions) Returns all combinations of oxidation states with optimal likelihood above the provided lower bound.- Parameters:
compositionString- The composition of the structure. Specifying polyatomic ions in parenthesis is allowed, If any polyatomic ions are recognized, the oxidation state ranges for those ions will be used instead of those for the constitutive elements.enumeratePossiblePolyanions- Set this to "true" if you want the table to evaluate combinations of integer numbers of polyatomic ions that could exist in a the given formula unit. For example, if the given composition string is Li2VPO5, oxidation states will be evaluated for "Li O (PO4)", "Li 2O (PO3)", and "Li 5O P". WARNING: This can result in a table with a large number (>10,000) of rows.- Returns:
- A TableData object with all of the possible oxidation states for the table in the Web UI.
-
getPageDataFromStructure
Returns an object containing the data needed to generate the web site pagefor the given structure.- Parameters:
structureFileString- A string representation of a text file that contains an atomic structure. Currently POSCAR and CIF are supported, and the format will be auto-detected.- Returns:
- The data needed to generate the oxidation state table for the given structure.
-
getJSONFromStructure
Returns a JSON-formatted string containing the data needed to generate the oxidation state table for the given structure.- Parameters:
structureFileString- A string representation of a text file that contains an atomic structure. Currently POSCAR and CIF are supported, and the format will be auto-detected.- Returns:
- A string containing the data needed to generate the oxidation state table for the given structure.
-