org.biojava.bio.structure.scop
Class ScopInstallation

java.lang.Object
  extended by org.biojava.bio.structure.scop.ScopInstallation
All Implemented Interfaces:
ScopDatabase
Direct Known Subclasses:
BerkeleyScopInstallation

public class ScopInstallation
extends Object
implements ScopDatabase

This class provides access to the SCOP protein structure classification. For more information about SCOP see here:

This class can automatically download missing files from the SCOP classification.

Author:
Andreas Prlic

Field Summary
static String claFileName
           
static String DEFAULT_VERSION
           
static String desFileName
           
static String FILESPLIT
           
static String hieFileName
           
static String NEWLINE
           
static String SCOP_DOWNLOAD
           
protected  String scopDownloadURL
           
protected  String scopVersion
           
 
Constructor Summary
ScopInstallation()
          Create a new SCOP installation, downloading the file to "the right place".
ScopInstallation(String cacheLocation)
          Create a new SCOP installation.
 
Method Summary
protected  void downloadClaFile()
           
protected  void downloadDesFile()
           
protected  void downloadFileFromRemote(URL remoteURL, File localFile)
           
protected  void downloadHieFile()
           
 void ensureClaInstalled()
           
 void ensureDesInstalled()
           
 void ensureHieInstalled()
           
 List<ScopDescription> filterByClassificationId(String query)
          Get all scop descriptions that start with a classifcation ID, e.g.
 List<ScopDescription> filterByDescription(String query)
          Get all scop descriptions that start with a certain name.
 List<ScopDomain> filterByDomainName(String query)
          search through SCOP and filter based on domain name
 List<ScopDescription> getByCategory(ScopCategory category)
          Get all records of a particular classification.
 String getCacheLocation()
           
protected  String getClaFilename()
           
protected  String getDesFilename()
           
 ScopDomain getDomainByScopID(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 ID
protected  String getHieFilename()
           
 ScopDescription getScopDescriptionBySunid(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 sunid
 String getScopDownloadURL()
           
 ScopNode getScopNode(int sunid)
          Access a particular ScopNode.
 String getScopVersion()
          Returns the SCOP version
 List<ScopNode> getTree(ScopDomain domain)
          get the SCOP sub-tree for a particular domain.
 void setCacheLocation(String cacheLocation)
           
 void setScopDownloadURL(String scopDownloadURL)
           
 void setScopVersion(String scopVersion)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_VERSION

public static final String DEFAULT_VERSION
See Also:
Constant Field Values

scopVersion

protected String scopVersion

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

SCOP_DOWNLOAD

public static final String SCOP_DOWNLOAD
See Also:
Constant Field Values

scopDownloadURL

protected String scopDownloadURL

NEWLINE

public static final String NEWLINE

FILESPLIT

public static final String FILESPLIT
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 called 'PDB_DIR', or else will use a temporary directory

Method Detail

ensureClaInstalled

public void ensureClaInstalled()

ensureDesInstalled

public void ensureDesInstalled()

ensureHieInstalled

public void ensureHieInstalled()

getByCategory

public List<ScopDescription> getByCategory(ScopCategory category)
Description copied from interface: ScopDatabase
Get all records of a particular classification.

Specified by:
getByCategory in interface ScopDatabase
Parameters:
category - e.g. "superfamily"
Returns:
all records of this type

filterByClassificationId

public List<ScopDescription> filterByClassificationId(String query)
Description copied from interface: ScopDatabase
Get all scop descriptions that start with a classifcation ID, e.g. b.1.18

Specified by:
filterByClassificationId in interface ScopDatabase
Returns:
list of scop descriptions

getTree

public List<ScopNode> getTree(ScopDomain domain)
Description copied from interface: ScopDatabase
get the SCOP sub-tree for a particular domain.

Specified by:
getTree in interface ScopDatabase
Returns:
list of ScopNodes providing the path to this domain

filterByDomainName

public List<ScopDomain> filterByDomainName(String query)
Description copied from interface: ScopDatabase
search through SCOP and filter based on domain name

Specified by:
filterByDomainName in interface ScopDatabase
Parameters:
query - a (part) of a name
Returns:
list of matchin ScopDomains

filterByDescription

public List<ScopDescription> filterByDescription(String query)
Description copied from interface: ScopDatabase
Get all scop descriptions that start with a certain name. e.g. Globin

Specified by:
filterByDescription in interface ScopDatabase
Returns:
list of scop descriptions

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 interface ScopDatabase
Returns:
a ScopDescription object

getDomainsForPDB

public List<ScopDomain> getDomainsForPDB(String pdbId)
Description copied from interface: ScopDatabase
Get a list of ScopDomains that have been assigned to a PDB ID

Specified by:
getDomainsForPDB in interface ScopDatabase
Parameters:
pdbId - the PDB entry
Returns:
a list of ScopDomains

getDomainByScopID

public ScopDomain getDomainByScopID(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 interface ScopDatabase
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 interface ScopDatabase
Parameters:
sunid - the scop unique id
Returns:
a ScopNode that matches this sunid

downloadClaFile

protected void downloadClaFile()
                        throws FileNotFoundException,
                               IOException
Throws:
FileNotFoundException
IOException

downloadDesFile

protected void downloadDesFile()
                        throws FileNotFoundException,
                               IOException
Throws:
FileNotFoundException
IOException

downloadHieFile

protected void downloadHieFile()
                        throws FileNotFoundException,
                               IOException
Throws:
FileNotFoundException
IOException

downloadFileFromRemote

protected void downloadFileFromRemote(URL remoteURL,
                                      File localFile)
                               throws FileNotFoundException,
                                      IOException
Throws:
FileNotFoundException
IOException

getClaFilename

protected String getClaFilename()

getDesFilename

protected String getDesFilename()

getHieFilename

protected String getHieFilename()

getCacheLocation

public String getCacheLocation()

setCacheLocation

public void setCacheLocation(String cacheLocation)

getScopVersion

public String getScopVersion()
Description copied from interface: ScopDatabase
Returns the SCOP version

Specified by:
getScopVersion in interface ScopDatabase
Returns:
version of SCOP

setScopVersion

public void setScopVersion(String scopVersion)

getScopDownloadURL

public String getScopDownloadURL()

setScopDownloadURL

public void setScopDownloadURL(String scopDownloadURL)

getScopDomainsBySunid

public List<ScopDomain> getScopDomainsBySunid(Integer sunid)
Description copied from interface: ScopDatabase
Get a SCOP domain by its sunid

Specified by:
getScopDomainsBySunid in interface ScopDatabase
Parameters:
sunid - the scop unique id
Returns:
a list of scop domains that match this sunid