Matrix Science header
Public Member Functions

ms_unigene Class Reference
[Mascot results file module]

This class encapsulates a complete unigene file. More...

#include <ms_mascotresunigene.hpp>

Collaboration diagram for ms_unigene:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ms_unigene (const ms_mascotresfile &resfile, const char *filename)
 The constructor for a unigene object.
 ~ms_unigene ()
 Destructor.
const ms_unigene_entryfindEntry (const char *id)
 Given an accession, return a pointer to the relevant unigene entry.
std::string getUnigeneForAccession (const std::string accession, const int index)
 Return the Unigene 'accession' (ID) for a given EST accession.

Detailed Description

This class encapsulates a complete unigene file.

Creating one of these objects reads in the unigene file, creating a number of ms_unigene_entry objects. The gi and EMBL accessions are all indexed.


Constructor & Destructor Documentation

ms_unigene ( const ms_mascotresfile resfile,
const char *  filename 
)

The constructor for a unigene object.

This is used from within the library but can also be called directly.

For details of how Unigene is configured within Mascot, see: http://www.matrixscience.com/help/seq_db_setup_EMBLEST.html

If a cache directory is specified for the ms_mascotresfile object, as returned by ms_mascotresfile::getCacheDirectory(), then this constructor will attempt to use a cache file for fast indexing. See Specifying cache file directory for details of the cache file location which will typically be in the same directory tree as the results cache files. The size and last modified date/time of the unigene file are used to determine if a new cache file needs to be produced. The cache filename for example, for Mm.data will be Mm.data.cdb. If the cache file does not exist and the constructor is unable to create the cache directory, then it will report the error: ms_mascotresfile::ERR_FAIL_MK_CACHE_DIR and continue without the cache.

If cache files are not used, the constructor loads the whole file into memory.

Parameters:
resfileis required for error reporting. Any errors are added to the resfile object. The cache directory (if any) is obtained by calling ms_mascotresfile::getCacheDirectory()
filenameis the path to the unigene file.

Member Function Documentation

const ms_unigene_entry * findEntry ( const char *  id )

Given an accession, return a pointer to the relevant unigene entry.

Parameters:
idis the unigene id - for example Hs.1234
Returns:
A pointer to the unigene entry or a NULL pointer if no match is found. The returned object will be deleted when the ms_unigene object is deleted so it should not be deleted by the client application.
std::string getUnigeneForAccession ( const std::string  accession,
const int  index 
)

Return the Unigene 'accession' (ID) for a given EST accession.

Each accession can belong to zero or more unigene entries. This function must be called multiple times to return all the unigene entries that contain the accession.

The returned string can be passed to findEntry() to return the complete unigene entry.

Parameters:
accessionis the gi number or EBI accession
indexis a 1 based index. Increment this value until the function returns an empty string.
Returns:
the 'id' for the Unigene entry - e.g. Hs.1234 or an empty string if index is out of range

The documentation for this class was generated from the following files:

Copyright © 2022 Matrix Science Ltd.  All Rights Reserved. Generated on Thu Mar 31 2022 01:12:39