public class AtomCache
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BIOL_ASSEMBLY_IDENTIFIER |
static java.lang.String |
CHAIN_NR_SYMBOL |
static java.lang.String |
CHAIN_SPLIT_SYMBOL |
protected FileParsingParameters |
params |
static java.lang.String |
PDP_DOMAIN_IDENTIFIER |
protected PDPProvider |
pdpprovider |
static java.util.regex.Pattern |
scopIDregex |
static java.lang.String |
UNDERSCORE |
Constructor and Description |
---|
AtomCache()
Default AtomCache constructor.
|
AtomCache(java.lang.String pdbFilePath,
boolean isSplit)
Creates an instance of an AtomCache that is pointed to the a particular path in the file system.
|
AtomCache(UserConfiguration config)
Creates a new AtomCache object based on the provided UserConfiguration.
|
Modifier and Type | Method and Description |
---|---|
protected void |
flagLoading(java.lang.String name) |
protected void |
flagLoadingFinished(java.lang.String name) |
Atom[] |
getAtoms(java.lang.String name)
Returns the CA atoms for the provided name.
|
Atom[] |
getAtoms(java.lang.String name,
boolean clone)
Deprecated.
does the same as
getAtoms(String) ; |
Structure |
getBiologicalAssembly(java.lang.String pdbId,
int bioAssemblyId,
boolean bioAssemblyFallback)
Loads the biological assembly for a given PDB ID and bioAssemblyId.
|
Structure |
getBiologicalUnit(java.lang.String pdbId)
Loads the default biological unit (*.pdb1.gz) file.
|
java.lang.String |
getCachePath()
Returns the path that contains the caching file for utility data, such as domain definitons.
|
FileParsingParameters |
getFileParsingParams() |
java.lang.String |
getPath()
Get the path that is used to cache PDB files.
|
PDPProvider |
getPdpprovider() |
Structure |
getStructure(java.lang.String name)
Request a Structure based on a name.
|
Structure |
getStructureForCathDomain(StructureName structureName)
Returns a
Structure corresponding to the CATH identifier supplied in structureName , using the the CathDatabase
at CathFactory.getCathDatabase() . |
Structure |
getStructureForCathDomain(StructureName structureName,
CathDatabase cathInstall)
Returns a
Structure corresponding to the CATH identifier supplied in structureName , using the specified CathDatabase . |
Structure |
getStructureForDomain(ScopDomain domain)
Returns the representation of a
ScopDomain as a BioJava Structure object. |
Structure |
getStructureForDomain(ScopDomain domain,
ScopDatabase scopDatabase)
Returns the representation of a
ScopDomain as a BioJava Structure object. |
Structure |
getStructureForDomain(ScopDomain domain,
ScopDatabase scopDatabase,
boolean strictLigandHandling)
Returns the representation of a
ScopDomain as a BioJava Structure object. |
Structure |
getStructureForDomain(java.lang.String scopId)
Returns the representation of a
ScopDomain as a BioJava Structure object. |
Structure |
getStructureForDomain(java.lang.String scopId,
ScopDatabase scopDatabase)
Returns the representation of a
ScopDomain as a BioJava Structure object. |
boolean |
isAutoFetch()
Does the cache automatically download files that are missing from the local installation from the PDB FTP site?
|
boolean |
isFetchCurrent()
N.B. This feature won't work unless the structure wasn't found & autoFetch is set to
true . |
boolean |
isFetchFileEvenIfObsolete()
forces the cache to fetch the file if its status is OBSOLETE.
|
boolean |
isSplit()
Is the organization of files within the directory split, as on the PDB FTP servers, or are all files contained in
one directory.
|
boolean |
isStrictSCOP()
Reports whether strict scop naming will be enforced, or whether this AtomCache should try to guess some simple
variants on scop domains.
|
boolean |
isUseMmCif() |
protected Structure |
loadStructureFromCifByPdbId(java.lang.String pdbId) |
protected Structure |
loadStructureFromPdbByPdbId(java.lang.String pdbId) |
void |
notifyShutdown()
Send a signal to the cache that the system is shutting down.
|
void |
setAutoFetch(boolean autoFetch)
Does the cache automatically download files that are missing from the local installation from the PDB FTP site?
|
void |
setCachePath(java.lang.String cachePath)
set the location at which utility data should be cached.
|
void |
setFetchCurrent(boolean fetchNewestCurrent)
if enabled, the reader searches for the newest possible PDB ID, if not present in he local installation.
|
void |
setFetchFileEvenIfObsolete(boolean fetchFileEvenIfObsolete)
N.B. This feature won't work unless the structure wasn't found & autoFetch is set to
true . |
void |
setFileParsingParams(FileParsingParameters params) |
void |
setPath(java.lang.String path)
Set the path that is used to cache PDB files.
|
void |
setPdpprovider(PDPProvider pdpprovider) |
void |
setSplit(boolean isSplit)
Is the organization of files within the directory split, as on the PDB FTP servers, or are all files contained in
one directory.
|
void |
setStrictSCOP(boolean strictSCOP)
When strictSCOP is enabled, SCOP domain identifiers (eg 'd1gbga_') are matched literally to the SCOP database.
|
void |
setUseMmCif(boolean useMmCif) |
public static final java.lang.String BIOL_ASSEMBLY_IDENTIFIER
public static final java.lang.String CHAIN_NR_SYMBOL
public static final java.lang.String CHAIN_SPLIT_SYMBOL
public static final java.lang.String PDP_DOMAIN_IDENTIFIER
public static final java.util.regex.Pattern scopIDregex
public static final java.lang.String UNDERSCORE
protected FileParsingParameters params
protected PDPProvider pdpprovider
public AtomCache()
public AtomCache(java.lang.String pdbFilePath, boolean isSplit)
pdbFilePath
- a directory in the file system to use as a location to cache files.isSplit
- a flag to indicate if the directory organisation is "split" as on the PDB ftp servers, or if all files
are contained in one directory.public AtomCache(UserConfiguration config)
config
- the UserConfiguration to use for this cache.public Atom[] getAtoms(java.lang.String name) throws java.io.IOException, StructureException
getStructure(String)
for supported naming conventions.name
- java.io.IOException
StructureException
@Deprecated public Atom[] getAtoms(java.lang.String name, boolean clone) throws java.io.IOException, StructureException
getAtoms(String)
;getStructure(String)
for supported naming conventions.name
- clone
- flag to make sure that the atoms are getting conedjava.io.IOException
StructureException
public Structure getBiologicalAssembly(java.lang.String pdbId, int bioAssemblyId, boolean bioAssemblyFallback) throws StructureException, java.io.IOException
pdbId
- the PDB IDbioAssemblyId
- the ID of the biological assemblybioAssemblyFallback
- if true, try reading original PDB file in case the biological assembly file is not availablejava.io.IOException
StructureException
public Structure getBiologicalUnit(java.lang.String pdbId) throws StructureException, java.io.IOException
pdbId
- the PDB IDjava.io.IOException
StructureException
public java.lang.String getCachePath()
public FileParsingParameters getFileParsingParams()
public java.lang.String getPath()
public PDPProvider getPdpprovider()
public Structure getStructure(java.lang.String name) throws java.io.IOException, StructureException
Formal specification for how to specify the name: name := pdbID | pdbID '.' chainID | pdbID '.' range | scopID range := '('? range (',' range)? ')'? | chainID | chainID '_' resNum '-' resNum pdbID := [0-9][a-zA-Z0-9]{3} chainID := [a-zA-Z0-9] scopID := 'd' pdbID [a-z_][0-9_] resNum := [-+]?[0-9]+[A-Za-z]? Example structures: 1TIM #whole structure 4HHB.C #single chain 4GCR.A_1-83 #one domain, by residue number 3AA0.A,B #two chains treated as one structure d2bq6a1 #scop domainWith the additional set of rules:
setStrictSCOP(boolean)
name
- java.io.IOException
- The PDB file cannot be cached due to IO errorsStructureException
- The name appeared valid but did not correspond to a structure. Also thrown by some submethods upon
errors, eg for poorly formatted subranges.public Structure getStructureForDomain(ScopDomain domain) throws java.io.IOException, StructureException
ScopDomain
as a BioJava Structure
object.domain
- a SCOP domainjava.io.IOException
StructureException
public Structure getStructureForDomain(ScopDomain domain, ScopDatabase scopDatabase) throws java.io.IOException, StructureException
ScopDomain
as a BioJava Structure
object.domain
- a SCOP domainscopDatabase
- A ScopDatabase
to usejava.io.IOException
StructureException
public Structure getStructureForDomain(ScopDomain domain, ScopDatabase scopDatabase, boolean strictLigandHandling) throws java.io.IOException, StructureException
ScopDomain
as a BioJava Structure
object.domain
- a SCOP domainscopDatabase
- A ScopDatabase
to usestrictLigandHandling
- If set to false, hetero-atoms are included if and only if they belong to a chain to which the SCOP
domain belongs; if set to true, hetero-atoms are included if and only if they are strictly within the
definition (residue numbers) of the SCOP domainjava.io.IOException
StructureException
public Structure getStructureForDomain(java.lang.String scopId) throws java.io.IOException, StructureException
ScopDomain
as a BioJava Structure
object.scopId
- a SCOP Idjava.io.IOException
StructureException
public Structure getStructureForDomain(java.lang.String scopId, ScopDatabase scopDatabase) throws java.io.IOException, StructureException
ScopDomain
as a BioJava Structure
object.scopId
- a SCOP IdscopDatabase
- A ScopDatabase
to usejava.io.IOException
StructureException
public boolean isAutoFetch()
public boolean isFetchCurrent()
true
.public boolean isFetchFileEvenIfObsolete()
setFetchCurrent(boolean)
.true
.fetchCurrent
public boolean isSplit()
public boolean isStrictSCOP()
public void notifyShutdown()
public void setAutoFetch(boolean autoFetch)
autoFetch
- flagpublic void setCachePath(java.lang.String cachePath)
cachePath
- public void setFetchCurrent(boolean fetchNewestCurrent)
setFetchFileEvenIfObsolete(boolean)
function has a higher priority than this function.true
.fetchCurrent
- the fetchCurrent to setsetFetchFileEvenIfObsolete(boolean)
public void setFetchFileEvenIfObsolete(boolean fetchFileEvenIfObsolete)
true
.fetchFileEvenIfObsolete
- the fetchFileEvenIfObsolete to setpublic void setFileParsingParams(FileParsingParameters params)
public void setPath(java.lang.String path)
path
- to a directorypublic void setPdpprovider(PDPProvider pdpprovider)
public void setSplit(boolean isSplit)
isSplit
- flagpublic void setStrictSCOP(boolean strictSCOP)
strictSCOP
- Indicates whether strict scop names should be used.public boolean isUseMmCif()
public void setUseMmCif(boolean useMmCif)
useMmCif
- the useMmCif to setpublic Structure getStructureForCathDomain(StructureName structureName) throws java.io.IOException, StructureException
Structure
corresponding to the CATH identifier supplied in structureName
, using the the CathDatabase
at CathFactory.getCathDatabase()
.java.io.IOException
StructureException
public Structure getStructureForCathDomain(StructureName structureName, CathDatabase cathInstall) throws java.io.IOException, StructureException
Structure
corresponding to the CATH identifier supplied in structureName
, using the specified CathDatabase
.java.io.IOException
StructureException
protected void flagLoading(java.lang.String name)
protected void flagLoadingFinished(java.lang.String name)
protected Structure loadStructureFromCifByPdbId(java.lang.String pdbId) throws StructureException
StructureException
protected Structure loadStructureFromPdbByPdbId(java.lang.String pdbId) throws StructureException
StructureException