Package org.biojava.nbio.structure.io
Class MMTFFileReader
- java.lang.Object
-
- org.biojava.nbio.structure.io.LocalPDBDirectory
-
- org.biojava.nbio.structure.io.MMTFFileReader
-
- All Implemented Interfaces:
StructureIOFile
,StructureProvider
public class MMTFFileReader extends LocalPDBDirectory
A class to read MMTF files and cache them locally.- Author:
- Anthony Bradley
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.biojava.nbio.structure.io.LocalPDBDirectory
LocalPDBDirectory.FetchBehavior, LocalPDBDirectory.ObsoleteBehavior
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String[]
MMTF_OBSOLETE_DIR
static java.lang.String[]
MMTF_SPLIT_DIR
-
Fields inherited from class org.biojava.nbio.structure.io.LocalPDBDirectory
DEFAULT_PDB_FILE_SERVER, LAST_REMEDIATION_DATE, lineSplit, MIN_PDB_FILE_SIZE, PDB_FILE_SERVER_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description MMTFFileReader()
Constructs a newMMTFFileReader
, initializing the extensions member variable.MMTFFileReader(java.lang.String path)
Constructs a newMMTFFileReader
, initializing the extensions member variable.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
getFilename(java.lang.String pdbId)
Converts a PDB ID into a filename with the proper extensionprotected java.lang.String[]
getObsoleteDirPath()
Location of obsolete files within the directory, as an array of paths.protected java.lang.String[]
getSplitDirPath()
Location of split files within the directory, as an array of paths.Structure
getStructure(java.io.InputStream inStream)
Handles the actual parsing of the file into a Structure object.static void
main(java.lang.String[] args)
-
Methods inherited from class org.biojava.nbio.structure.io.LocalPDBDirectory
addExtension, checkFileExists, clearExtensions, deleteStructure, downloadStructure, getDir, getExtensions, getFetchBehavior, getFileParsingParameters, getInputStream, getLocalFile, getObsoleteBehavior, getPath, getServerName, getStructure, getStructure, getStructure, getStructureById, initPaths, prefetchStructure, setFetchBehavior, setFileParsingParameters, setObsoleteBehavior, setPath
-
-
-
-
Constructor Detail
-
MMTFFileReader
public MMTFFileReader()
Constructs a newMMTFFileReader
, initializing the extensions member variable. The path is initialized in the same way asUserConfiguration
, i.e. to system property/environment variableUserConfiguration.PDB_DIR
. Both autoFetch and splitDir are initialized to false
-
MMTFFileReader
public MMTFFileReader(java.lang.String path)
Constructs a newMMTFFileReader
, initializing the extensions member variable. The path is initialized to the given path, both autoFetch and splitDir are initialized to false.
-
-
Method Detail
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getStructure
public Structure getStructure(java.io.InputStream inStream) throws java.io.IOException
Description copied from class:LocalPDBDirectory
Handles the actual parsing of the file into a Structure object.- Specified by:
getStructure
in classLocalPDBDirectory
- Returns:
- Throws:
java.io.IOException
-
getFilename
protected java.lang.String getFilename(java.lang.String pdbId)
Description copied from class:LocalPDBDirectory
Converts a PDB ID into a filename with the proper extension- Specified by:
getFilename
in classLocalPDBDirectory
- Returns:
- The filename, e.g. "4hhb.pdb.gz"
-
getSplitDirPath
protected java.lang.String[] getSplitDirPath()
Description copied from class:LocalPDBDirectory
Location of split files within the directory, as an array of paths. These will be joined with either slashes (for the URL) or the file separator (for directories). The returned results should be constant, to allow for caching.- Specified by:
getSplitDirPath
in classLocalPDBDirectory
- Returns:
- A list of directories, relative to the /pub/pdb directory on the server
-
getObsoleteDirPath
protected java.lang.String[] getObsoleteDirPath()
Description copied from class:LocalPDBDirectory
Location of obsolete files within the directory, as an array of paths. These will be joined with either slashes (for the URL) or the file separator (for directories). The returned results should be constant, to allow for caching.- Specified by:
getObsoleteDirPath
in classLocalPDBDirectory
- Returns:
- A list of directories, relative to the /pub/pdb directory on the server
-
-