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 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 StringclaFileNamestatic StringcomFileNamestatic StringDEFAULT_VERSIONstatic StringdesFileNamestatic StringFILESPLITstatic StringhieFileNamestatic StringSCOP_DOWNLOADstatic StringSCOP_DOWNLOAD_ALTERNATE
-
Constructor Summary
Constructors Constructor Description ScopInstallation()Create a new SCOP installation, downloading the file to "the right place".ScopInstallation(String cacheLocation)Create a new SCOP installation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMirror(String scopDownloadURL)protected voiddownloadClaFile()protected voiddownloadComFile()protected voiddownloadDesFile()protected voiddownloadFileFromRemote(URL remoteURL, File localFile)protected voiddownloadHieFile()voidensureClaInstalled()voidensureComInstalled()voidensureDesInstalled()voidensureHieInstalled()List<ScopDescription>filterByClassificationId(String query)Get all scop descriptions that start with a classification ID, e.g. b.1.18List<ScopDescription>filterByDescription(String query)Get all scop descriptions that start with a certain name. e.g.List<ScopDomain>filterByDomainName(String query)search through SCOP and filter based on domain nameList<ScopDescription>getByCategory(ScopCategory category)Get all records of a particular classification.StringgetCacheLocation()protected StringgetClaFilename()protected StringgetComFilename()List<String>getComments(int sunid)Get comments about a SCOP domain by its sunidprotected StringgetDesFilename()ScopDomaingetDomainByScopID(String scopId)get a ScopDomain by its SCOP ID (warning, they are not stable between releases!)List<ScopDomain>getDomainsForPDB(String pdbId)Get a list of ScopDomains that have been assigned to a PDB IDprotected StringgetHieFilename()List<ScopMirror>getMirrors()ScopDescriptiongetScopDescriptionBySunid(int sunid)Return the SCOP description for a node in the hierarchy by its "sunid" id.List<ScopDomain>getScopDomainsBySunid(Integer sunid)Get a SCOP domain by its sunidScopNodegetScopNode(int sunid)Access a particular ScopNode.StringgetScopVersion()Returns the SCOP versionList<ScopNode>getTree(ScopDomain domain)get the SCOP sub-tree for a particular domain.voidnullifyComments()Removes all of the comments (dir.com file) in order to free memory.voidsetCacheLocation(String cacheLocation)voidsetScopVersion(String scopVersion)Sets the scop version used.
-
-
-
Field Detail
-
DEFAULT_VERSION
public static final String DEFAULT_VERSION
- See Also:
- Constant Field Values
-
claFileName
public static final String claFileName
- See Also:
- Constant Field Values
-
desFileName
public static final String desFileName
- See Also:
- Constant Field Values
-
hieFileName
public static final String hieFileName
- See Also:
- Constant Field Values
-
comFileName
public static final String comFileName
- See Also:
- Constant Field Values
-
SCOP_DOWNLOAD
public static final String SCOP_DOWNLOAD
- See Also:
- Constant Field Values
-
SCOP_DOWNLOAD_ALTERNATE
public static final String SCOP_DOWNLOAD_ALTERNATE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ScopInstallation
public ScopInstallation(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 IOException
- Throws:
IOException
-
ensureDesInstalled
public void ensureDesInstalled() throws IOException
- Throws:
IOException
-
ensureComInstalled
public void ensureComInstalled() throws IOException
- Throws:
IOException
-
ensureHieInstalled
public void ensureHieInstalled() throws IOException
- Throws:
IOException
-
getByCategory
public List<ScopDescription> getByCategory(ScopCategory category)
Description copied from interface:ScopDatabaseGet all records of a particular classification.- Specified by:
getByCategoryin interfaceScopDatabase- Parameters:
category- e.g. "superfamily"- Returns:
- all records of this type
-
filterByClassificationId
public List<ScopDescription> filterByClassificationId(String query)
Description copied from interface:ScopDatabaseGet all scop descriptions that start with a classification ID, e.g. b.1.18- Specified by:
filterByClassificationIdin interfaceScopDatabase- Returns:
- list of scop descriptions
-
getTree
public List<ScopNode> getTree(ScopDomain domain)
Description copied from interface:ScopDatabaseget the SCOP sub-tree for a particular domain.- Specified by:
getTreein interfaceScopDatabase- Returns:
- list of ScopNodes providing the path to this domain
-
filterByDomainName
public List<ScopDomain> filterByDomainName(String query)
Description copied from interface:ScopDatabasesearch through SCOP and filter based on domain name- Specified by:
filterByDomainNamein interfaceScopDatabase- Parameters:
query- a (part) of a name- Returns:
- list of matchin ScopDomains
-
filterByDescription
public List<ScopDescription> filterByDescription(String query) throws ScopIOException
Description copied from interface:ScopDatabaseGet all scop descriptions that start with a certain name. e.g. Globin- Specified by:
filterByDescriptionin interfaceScopDatabase- Returns:
- list of scop descriptions
- Throws:
ScopIOException
-
getScopDescriptionBySunid
public ScopDescription getScopDescriptionBySunid(int sunid)
Description copied from interface:ScopDatabaseReturn the SCOP description for a node in the hierarchy by its "sunid" id.- Specified by:
getScopDescriptionBySunidin interfaceScopDatabase- Returns:
- a ScopDescription object
-
getDomainsForPDB
public List<ScopDomain> getDomainsForPDB(String pdbId)
Description copied from interface:ScopDatabaseGet a list of ScopDomains that have been assigned to a PDB ID- Specified by:
getDomainsForPDBin interfaceScopDatabase- Parameters:
pdbId- the PDB entry- Returns:
- a list of ScopDomains
-
getDomainByScopID
public ScopDomain getDomainByScopID(String scopId)
Description copied from interface:ScopDatabaseget a ScopDomain by its SCOP ID (warning, they are not stable between releases!)- Specified by:
getDomainByScopIDin 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:ScopDatabaseAccess a particular ScopNode. The scopNode then allows to traverse through the scop hierarchy...- Specified by:
getScopNodein interfaceScopDatabase- Parameters:
sunid- the scop unique id- Returns:
- a ScopNode that matches this sunid
-
downloadClaFile
protected void downloadClaFile() throws FileNotFoundException, IOException
- Throws:
FileNotFoundExceptionIOException
-
downloadDesFile
protected void downloadDesFile() throws FileNotFoundException, IOException
- Throws:
FileNotFoundExceptionIOException
-
downloadHieFile
protected void downloadHieFile() throws IOException
- Throws:
IOException
-
downloadComFile
protected void downloadComFile() throws FileNotFoundException, IOException
- Throws:
FileNotFoundExceptionIOException
-
downloadFileFromRemote
protected void downloadFileFromRemote(URL remoteURL, File localFile) throws IOException
- Throws:
IOException
-
getClaFilename
protected String getClaFilename()
-
getDesFilename
protected String getDesFilename()
-
getHieFilename
protected String getHieFilename()
-
getComFilename
protected String getComFilename()
-
getCacheLocation
public String getCacheLocation()
-
setCacheLocation
public void setCacheLocation(String cacheLocation)
-
getScopVersion
public String getScopVersion()
Description copied from interface:ScopDatabaseReturns the SCOP version- Specified by:
getScopVersionin interfaceScopDatabase- Returns:
- version of SCOP
-
setScopVersion
public void setScopVersion(String scopVersion)
Description copied from interface:ScopDatabaseSets the scop version used.- Specified by:
setScopVersionin interfaceScopDatabase
-
getMirrors
public List<ScopMirror> getMirrors()
-
getScopDomainsBySunid
public List<ScopDomain> getScopDomainsBySunid(Integer sunid)
Description copied from interface:ScopDatabaseGet a SCOP domain by its sunid- Specified by:
getScopDomainsBySunidin interfaceScopDatabase- Parameters:
sunid- the scop unique id- Returns:
- a list of scop domains that match this sunid
-
getComments
public List<String> getComments(int sunid)
Description copied from interface:ScopDatabaseGet comments about a SCOP domain by its sunid- Specified by:
getCommentsin interfaceScopDatabase- Returns:
-
-