public class CrystalStructureDataset extends CompositionDataset
How to Import Files:
Rather than importing data from a single file with the importText(java.lang.String, java.lang.Object[]) operation, this class imports all the files in a given directory. These files must be VASP 5 POSCAR files. Any files that are not in this format will be ignored.
In order to provide properties about these structures, add a "properties.txt" file to the POSCAR-containing directory. This file should be in the following format
filename <property #1 name> <...>
<name of POSCAR> <property #1 of that structure> <...>
This file follows similar rules to that of CompositionDataset
Implemented Save Formats
poscar - Save dataset as a directory full of POSCARs.
Usage: *No options*
Properties of each entry will be saved in a file in that
directory named "properties.txt"
DataDirectory, ElementalProperties, ElementNames, ElementPairProperties, OxidationStates, PairPropertyData, PropertyData, SortingOrder
AttributeName, Entries, Expanders, Generators
Constructor and Description |
---|
CrystalStructureDataset()
Create a instance with the default attribute generators
|
CrystalStructureDataset(boolean useDefaultGenerators)
Create a new instance.
|
Modifier and Type | Method and Description |
---|---|
CrystalStructureEntry |
addEntry(java.lang.String input)
A new entry by parsing an input string.
|
CrystalStructureDataset |
clone()
Creates a new instance of this dataset, and clones of each entry.
|
CrystalStructureDataset |
emptyClone()
Creates a new instance with the same class and attribute names, but
without any entries.
|
CrystalStructureEntry |
getEntry(int index)
Retrieve a single entry from the dataset
|
void |
importText(java.lang.String directory,
java.lang.Object[] options)
Import all structure files in a directory.
|
void |
runAttributeGenerators()
Expand the list of attributes using the currently-set list of attribute
generators.
|
java.lang.String |
saveCommand(java.lang.String Basename,
java.lang.String Format)
Handles complicated saving commands.
|
void |
writePOSCARs(java.lang.String directory)
Save dataset as a directory full of POSCARs.
|
addElementalProperty, addElementalPropertySet, addElementPairProperty, addGeneratedElementPairProperty, calculateAttributes, compositionCanFormIonic, createTemplate, getDataDirectory, getElementalProperties, getElementPairProperties, getOxidationStates, getPairPropertyLookupTable, getPropertyLookupTable, getSortingOrder, printEntryDescription, removeElementalProperty, removeElementPairProperty, runAttributeCommand, runCommand, runPairPropertyCommand, runPropertyCommand, setDataDirectory, useCompositionAsAttributes
addEntries, addEntries, addEntry, addProperty, addProperty, clearPropertyData, combine, definePropertyNames, getClassNames, getMeasuredPropertyArray, getMeasuredPropertyArray, getPredictedPropertyArray, getPredictedPropertyArray, getPropertyClassCount, getPropertyClasses, getPropertyClasses, getPropertyIndex, getPropertyName, getPropertyNames, getTargetPropertyIndex, getTargetPropertyName, hasProperty, importEntryProperties, importPropertyNames, NClasses, NProperties, setClassNames, setPropertyClasses, setTargetProperty, setTargetProperty, toJSON, toString, usingPropertyAsClass
about, addAttribute, addAttributeExpander, addAttributeGenerator, addAttributes, clearAttributeExpanders, clearAttributeGenerators, clearAttributes, clearData, combine, combine, containsEntry, deleteMeasuredClasses, deletePredictedClasses, finalizeGeneration, generateAttributes, getAttributeArray, getAttributeExpanders, getAttributeGenerators, getAttributeIndex, getAttributeName, getAttributeNames, getCitations, getClassName, getClassProbabilityArray, getDistribution, getDistributionCount, getDuplicates, getEntries, getEntriesWriteAccess, getEntryArray, getMeasuredClassArray, getPredictedClassArray, getRandomSplit, getRandomSplit, getRandomSplit, getRandomSplit, getRandomSubset, getRandomSubset, getSingleAttributeArray, getSubset, getTrainingExamples, getUniqueEntries, loadState, matchEntries, NAttributes, NEntries, partition, partition, printAttributeDescription, printCommand, printDescription, printDistribution, printEntries, printUsage, removeDuplicates, resolveDuplicates, restoreAttributes, runAttributeExpanders, runAttributeExpansionCommand, runAttributeGeneratorCommand, saveState, saveTemplate, setAttributeNames, setClassProbabilities, setMeasuredClasses, setOptions, setPredictedClasses, splitForThreading, splitIntoFolds, splitIntoFolds, subtract, transferToWeka
public CrystalStructureDataset()
CrystalStructureDataset(boolean)
public CrystalStructureDataset(boolean useDefaultGenerators)
Default attribute generators are:
useDefaultGenerators
- Whether to use the default attribute generatorspublic CrystalStructureDataset clone()
Dataset
public CrystalStructureDataset emptyClone()
Dataset
emptyClone
in class CompositionDataset
public void importText(java.lang.String directory, java.lang.Object[] options) throws java.lang.Exception
importText
in class CompositionDataset
directory
- Directory containing VASP5-formatted filesoptions
- No optionsjava.lang.Exception
- If parsing failspublic CrystalStructureEntry getEntry(int index)
Dataset
getEntry
in class CompositionDataset
index
- Index of entrypublic CrystalStructureEntry addEntry(java.lang.String input) throws java.lang.Exception
Dataset
addEntry
in class CompositionDataset
input
- String describing the entryjava.lang.Exception
- If conversion failspublic void runAttributeGenerators() throws java.lang.Exception
Dataset
runAttributeGenerators
in class Dataset
java.lang.Exception
Dataset.getAttributeGenerators()
public java.lang.String saveCommand(java.lang.String Basename, java.lang.String Format) throws java.lang.Exception
Savable
Dev Note: Make sure to add save format to Javadoc. See Dataset as an example. Required format:
<save><p><b>format<b> - Description
<br>Optional room to talk more about format </save>
saveCommand
in interface Savable
saveCommand
in class CompositionDataset
Basename
- Name of file without extensionFormat
- Command specifying format in which to printjava.lang.Exception
- If command not understoodpublic void writePOSCARs(java.lang.String directory) throws java.lang.Exception
directory
- Path to output directoryjava.lang.Exception
- if writing fails