Package org.biojava.nbio.structure.scop
Class ScopInstallation
- java.lang.Object
-
- org.biojava.nbio.structure.scop.ScopInstallation
-
- All Implemented Interfaces:
LocalScopDatabase
,ScopDatabase
- Direct Known Subclasses:
BerkeleyScopInstallation
public class ScopInstallation extends java.lang.Object implements LocalScopDatabase
This class provides access to the SCOP protein structure classification. For more information about SCOP see here:- SCOP: http://scop.mrc-lmb.cam.ac.uk/scop/
- Introduction: http://scop.mrc-lmb.cam.ac.uk/scop/intro.html
- SCOP parsable files: http://scop.mrc-lmb.cam.ac.uk/scop/parse/
- Author:
- Andreas Prlic
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
claFileName
static java.lang.String
comFileName
static java.lang.String
DEFAULT_VERSION
static java.lang.String
desFileName
static java.lang.String
FILESPLIT
static java.lang.String
hieFileName
static java.lang.String
NEWLINE
static java.lang.String
SCOP_DOWNLOAD
static java.lang.String
SCOP_DOWNLOAD_ALTERNATE
protected java.lang.String
scopVersion
-
Constructor Summary
Constructors Constructor Description ScopInstallation()
Create a new SCOP installation, downloading the file to "the right place".ScopInstallation(java.lang.String cacheLocation)
Create a new SCOP installation.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addMirror(java.lang.String scopDownloadURL)
protected void
downloadClaFile()
protected void
downloadComFile()
protected void
downloadDesFile()
protected void
downloadFileFromRemote(java.net.URL remoteURL, java.io.File localFile)
protected void
downloadHieFile()
void
ensureClaInstalled()
void
ensureComInstalled()
void
ensureDesInstalled()
void
ensureHieInstalled()
java.util.List<ScopDescription>
filterByClassificationId(java.lang.String query)
Get all scop descriptions that start with a classification ID, e.g.java.util.List<ScopDescription>
filterByDescription(java.lang.String query)
Get all scop descriptions that start with a certain name.java.util.List<ScopDomain>
filterByDomainName(java.lang.String query)
search through SCOP and filter based on domain namejava.util.List<ScopDescription>
getByCategory(ScopCategory category)
Get all records of a particular classification.java.lang.String
getCacheLocation()
protected java.lang.String
getClaFilename()
protected java.lang.String
getComFilename()
java.util.List<java.lang.String>
getComments(int sunid)
Get comments about a SCOP domain by its sunidprotected java.lang.String
getDesFilename()
ScopDomain
getDomainByScopID(java.lang.String scopId)
get a ScopDomain by its SCOP ID (warning, they are not stable between releases!)java.util.List<ScopDomain>
getDomainsForPDB(java.lang.String pdbId)
Get a list of ScopDomains that have been assigned to a PDB IDprotected java.lang.String
getHieFilename()
java.util.List<ScopMirror>
getMirrors()
ScopDescription
getScopDescriptionBySunid(int sunid)
Return the SCOP description for a node in the hierarchy by its "sunid" id.java.util.List<ScopDomain>
getScopDomainsBySunid(java.lang.Integer sunid)
Get a SCOP domain by its sunidjava.lang.String
getScopDownloadURL()
Deprecated.ScopNode
getScopNode(int sunid)
Access a particular ScopNode.java.lang.String
getScopVersion()
Returns the SCOP versionjava.util.List<ScopNode>
getTree(ScopDomain domain)
get the SCOP sub-tree for a particular domain.void
nullifyComments()
Removes all of the comments (dir.com file) in order to free memory.void
setCacheLocation(java.lang.String cacheLocation)
void
setScopDownloadURL(java.lang.String scopDownloadURL)
Deprecated.UseaddMirror(java.lang.String)
insteadvoid
setScopVersion(java.lang.String scopVersion)
Sets the scop version used.
-
-
-
Field Detail
-
DEFAULT_VERSION
public static final java.lang.String DEFAULT_VERSION
- See Also:
- Constant Field Values
-
scopVersion
protected java.lang.String scopVersion
-
claFileName
public static final java.lang.String claFileName
- See Also:
- Constant Field Values
-
desFileName
public static final java.lang.String desFileName
- See Also:
- Constant Field Values
-
hieFileName
public static final java.lang.String hieFileName
- See Also:
- Constant Field Values
-
comFileName
public static final java.lang.String comFileName
- See Also:
- Constant Field Values
-
SCOP_DOWNLOAD
public static final java.lang.String SCOP_DOWNLOAD
- See Also:
- Constant Field Values
-
SCOP_DOWNLOAD_ALTERNATE
public static final java.lang.String SCOP_DOWNLOAD_ALTERNATE
- See Also:
- Constant Field Values
-
NEWLINE
public static final java.lang.String NEWLINE
-
FILESPLIT
public static final java.lang.String FILESPLIT
-
-
Constructor Detail
-
ScopInstallation
public ScopInstallation(java.lang.String cacheLocation)
Create a new SCOP installation.- Parameters:
cacheLocation
- where the SCOP files are stored. If they can't be found at that location they will get automatically downloaded and installed there.
-
ScopInstallation
public ScopInstallation()
Create a new SCOP installation, downloading the file to "the right place". This will first check for system properties or environmental variables calledUserConfiguration.PDB_CACHE_DIR
, or else will use a temporary directory
-
-
Method Detail
-
nullifyComments
public void nullifyComments()
Removes all of the comments (dir.com file) in order to free memory. The file will need to be reloaded ifgetComments(int)
is called subsequently.
-
ensureClaInstalled
public void ensureClaInstalled() throws java.io.IOException
- Throws:
java.io.IOException
-
ensureDesInstalled
public void ensureDesInstalled() throws java.io.IOException
- Throws:
java.io.IOException
-
ensureComInstalled
public void ensureComInstalled() throws java.io.IOException
- Throws:
java.io.IOException
-
ensureHieInstalled
public void ensureHieInstalled() throws java.io.IOException
- Throws:
java.io.IOException
-
getByCategory
public java.util.List<ScopDescription> getByCategory(ScopCategory category)
Description copied from interface:ScopDatabase
Get all records of a particular classification.- Specified by:
getByCategory
in interfaceScopDatabase
- Parameters:
category
- e.g. "superfamily"- Returns:
- all records of this type
-
filterByClassificationId
public java.util.List<ScopDescription> filterByClassificationId(java.lang.String query)
Description copied from interface:ScopDatabase
Get all scop descriptions that start with a classification ID, e.g. b.1.18- Specified by:
filterByClassificationId
in interfaceScopDatabase
- Returns:
- list of scop descriptions
-
getTree
public java.util.List<ScopNode> getTree(ScopDomain domain)
Description copied from interface:ScopDatabase
get the SCOP sub-tree for a particular domain.- Specified by:
getTree
in interfaceScopDatabase
- Returns:
- list of ScopNodes providing the path to this domain
-
filterByDomainName
public java.util.List<ScopDomain> filterByDomainName(java.lang.String query)
Description copied from interface:ScopDatabase
search through SCOP and filter based on domain name- Specified by:
filterByDomainName
in interfaceScopDatabase
- Parameters:
query
- a (part) of a name- Returns:
- list of matchin ScopDomains
-
filterByDescription
public java.util.List<ScopDescription> filterByDescription(java.lang.String query) throws ScopIOException
Description copied from interface:ScopDatabase
Get all scop descriptions that start with a certain name. e.g. Globin- Specified by:
filterByDescription
in interfaceScopDatabase
- Returns:
- list of scop descriptions
- Throws:
ScopIOException
-
getScopDescriptionBySunid
public ScopDescription getScopDescriptionBySunid(int sunid)
Description copied from interface:ScopDatabase
Return the SCOP description for a node in the hierarchy by its "sunid" id.- Specified by:
getScopDescriptionBySunid
in interfaceScopDatabase
- Returns:
- a ScopDescription object
-
getDomainsForPDB
public java.util.List<ScopDomain> getDomainsForPDB(java.lang.String pdbId)
Description copied from interface:ScopDatabase
Get a list of ScopDomains that have been assigned to a PDB ID- Specified by:
getDomainsForPDB
in interfaceScopDatabase
- Parameters:
pdbId
- the PDB entry- Returns:
- a list of ScopDomains
-
getDomainByScopID
public ScopDomain getDomainByScopID(java.lang.String scopId)
Description copied from interface:ScopDatabase
get a ScopDomain by its SCOP ID (warning, they are not stable between releases!)- Specified by:
getDomainByScopID
in interfaceScopDatabase
- Parameters:
scopId
- e.g. d2bq6a1- Returns:
- a ScopDomain or null if no domain with the particular ID could be found
-
getScopNode
public ScopNode getScopNode(int sunid)
Description copied from interface:ScopDatabase
Access a particular ScopNode. The scopNode then allows to traverse through the scop hierarchy...- Specified by:
getScopNode
in interfaceScopDatabase
- Parameters:
sunid
- the scop unique id- Returns:
- a ScopNode that matches this sunid
-
downloadClaFile
protected void downloadClaFile() throws java.io.FileNotFoundException, java.io.IOException
- Throws:
java.io.FileNotFoundException
java.io.IOException
-
downloadDesFile
protected void downloadDesFile() throws java.io.FileNotFoundException, java.io.IOException
- Throws:
java.io.FileNotFoundException
java.io.IOException
-
downloadHieFile
protected void downloadHieFile() throws java.io.IOException
- Throws:
java.io.IOException
-
downloadComFile
protected void downloadComFile() throws java.io.FileNotFoundException, java.io.IOException
- Throws:
java.io.FileNotFoundException
java.io.IOException
-
downloadFileFromRemote
protected void downloadFileFromRemote(java.net.URL remoteURL, java.io.File localFile) throws java.io.IOException
- Throws:
java.io.IOException
-
getClaFilename
protected java.lang.String getClaFilename()
-
getDesFilename
protected java.lang.String getDesFilename()
-
getHieFilename
protected java.lang.String getHieFilename()
-
getComFilename
protected java.lang.String getComFilename()
-
getCacheLocation
public java.lang.String getCacheLocation()
-
setCacheLocation
public void setCacheLocation(java.lang.String cacheLocation)
-
getScopVersion
public java.lang.String getScopVersion()
Description copied from interface:ScopDatabase
Returns the SCOP version- Specified by:
getScopVersion
in interfaceScopDatabase
- Returns:
- version of SCOP
-
setScopVersion
public void setScopVersion(java.lang.String scopVersion)
Description copied from interface:ScopDatabase
Sets the scop version used.- Specified by:
setScopVersion
in interfaceScopDatabase
-
getScopDownloadURL
@Deprecated public java.lang.String getScopDownloadURL()
Deprecated.Get the URL of the first scop mirror being used- Returns:
-
setScopDownloadURL
@Deprecated public void setScopDownloadURL(java.lang.String scopDownloadURL)
Deprecated.UseaddMirror(java.lang.String)
instead- Parameters:
scopDownloadURL
- URL to load
-
addMirror
public void addMirror(java.lang.String scopDownloadURL)
-
getMirrors
public java.util.List<ScopMirror> getMirrors()
-
getScopDomainsBySunid
public java.util.List<ScopDomain> getScopDomainsBySunid(java.lang.Integer sunid)
Description copied from interface:ScopDatabase
Get a SCOP domain by its sunid- Specified by:
getScopDomainsBySunid
in interfaceScopDatabase
- Parameters:
sunid
- the scop unique id- Returns:
- a list of scop domains that match this sunid
-
getComments
public java.util.List<java.lang.String> getComments(int sunid)
Description copied from interface:ScopDatabase
Get comments about a SCOP domain by its sunid- Specified by:
getComments
in interfaceScopDatabase
- Returns:
-
-