#include <Index_AMOS.hh>
Inheritance diagram for AMOS::Index_t:
Public Types | |
typedef HASHMAP::hash_multimap< ID_t, ID_t >::iterator | iterator |
Un-mutable index iterator, only itr -> second can be modified. | |
typedef HASHMAP::hash_multimap< ID_t, ID_t >::const_iterator | const_iterator |
constant index iterator | |
Public Member Functions | |
Index_t () | |
Constructs an empty Index_t object. | |
Index_t (NCode_t a, NCode_t b) | |
Constructs an Index_t of a certain type. | |
Index_t (const Index_t &source) | |
Copy constructor. | |
~Index_t () | |
Destroys a Index_t object. | |
iterator | begin () |
Returns a iterator to the beginning of the index. | |
const_iterator | begin () const |
void | buildContigFeature (const std::string bankname) |
Builds the index with Contig_t Feature_t's. | |
void | buildContigScaffold (const std::string bankname) |
Builds the index with Contig_t to Scaffold_t mappings. | |
void | buildReadContig (const std::string bankname) |
Builds the index with Read_t to Contig_t mappings. | |
void | buildReadLibrary (const std::string bankname) |
Builds the index with Read_t to Library_t mappings. | |
void | buildReadMate (const std::string bankname) |
Builds the index with mated Read_t's. | |
void | buildScaffoldFeature (const std::string bankname) |
Builds the index with Scaffold_t Feature_t's. | |
iterator | end () |
Returns a iterator to the end of the index. | |
const_iterator | end () const |
bool | empty () const |
Returns true if the index is empty. | |
virtual void | clear () |
Clears all object data, reinitializes the object. | |
Size_t | count (ID_t key) const |
Returns the number of IDs associated with a particular key. | |
virtual NCode_t | getNCode () const |
Get the AMOS NCode type identifier. | |
Size_t | getSize () const |
Returns the number of ID pairs in the index. | |
std::pair< NCode_t, NCode_t > | getType () const |
Get the index type as a pair of NCodes. | |
void | insert (ID_t key, ID_t value) |
Inserts a new IID pair into the index. | |
void | insert (std::pair< ID_t, ID_t > iids) |
bool | isMulti (ID_t key) const |
Returns true if count is > 1 for a particular key. | |
ID_t | lookup (ID_t key) const |
Look up a single IID by its index key. | |
std::pair< iterator, iterator > | lookupAll (ID_t key) |
Look up a list of IIDs by their index key. | |
std::pair< const_iterator, const_iterator > | lookupAll (ID_t key) const |
virtual void | readMessage (const Message_t &msg) |
Reads in data from a Message object. | |
Size_t | remove (ID_t key) |
Remove all IIDs associated with a particular key. | |
void | remove (iterator itr) |
Remove a single ID pair. | |
void | setType (std::pair< NCode_t, NCode_t > type) |
Set the index type as a pair of NCodes. | |
void | setType (NCode_t a, NCode_t b) |
virtual void | writeMessage (Message_t &msg) const |
Writes data to a Message object. | |
const std::string & | getComment () const |
Get the comment string. | |
const Status_t | getStatus () const |
Get the status value. | |
void | setComment (const std::string &comment) |
Set the comment string. | |
void | setStatus (Status_t status) |
Set the status value. | |
const std::string & | getEID () const |
Get the external ID. | |
ID_t | getIID () const |
Get the internal ID. | |
bool | isRemoved () const |
Check if the object is waiting to be removed from the bank. | |
bool | isModified () const |
Check if the object has been modified. | |
bool | isFlagA () const |
Check the value of flag A. | |
bool | isFlagB () const |
Check the value of flag B. | |
void | setEID (const std::string &eid) |
Set the external ID. | |
void | setFlagA (bool flag) |
Set flag A. | |
void | setFlagB (bool flag) |
Set flag B. | |
void | setIID (ID_t iid) |
Set the internal ID. | |
Static Public Attributes | |
const NCode_t | NCODE = M_INDEX |
The NCode type identifier for this object. | |
Protected Member Functions | |
virtual void | readRecord (std::istream &fix, std::istream &var) |
Read selected class members from a biserial record. | |
virtual void | writeRecord (std::ostream &fix, std::ostream &var) const |
Write selected class members to a biserial record. | |
Protected Attributes | |
ID_t | iid_m |
internal ID (integer AMOS identifier) | |
std::string | eid_m |
external ID (anything you want sans newlines) | |
BankFlags_t | flags_m |
bank flags, derived classes may use "nibble" |
Provides an efficient means for storing/retrieving inter-object relationships, e.g. read to mated read. Since most objects only store a minimal set of references, it can be akward and costly to identify related objects not directly linked with an IID reference. The Index_t provides a way to amortize this cost by storing the association information directly for future, repeated use. When in memory, it is essentially a watered-down version of an STL multimap.
Definition at line 33 of file Index_AMOS.hh.
|
constant index iterator Definition at line 62 of file Index_AMOS.hh. Referenced by begin(), buildContigScaffold(), buildReadContig(), end(), writeMessage(), and writeRecord(). |
|
Un-mutable index iterator, only itr -> second can be modified. Definition at line 59 of file Index_AMOS.hh. |
|
Constructs an empty Index_t object. Sets all members to zero or NULL Definition at line 70 of file Index_AMOS.hh. References AMOS::NULL_NCODE. |
|
Constructs an Index_t of a certain type. Definition at line 79 of file Index_AMOS.hh. References AMOS::NCode_t. |
|
Copy constructor. Definition at line 89 of file Index_AMOS.hh. |
|
Destroys a Index_t object. Definition at line 98 of file Index_AMOS.hh. |
|
Definition at line 119 of file Index_AMOS.hh. References begin(), and const_iterator. |
|
Returns a iterator to the beginning of the index. Iterator is of the type hash_multimap<ID_t, ID_t>::iterator. Access TO and FROM IIDs with 'itr -> first' and 'itr -> second' respectively.
References iterator. Referenced by begin(), buildContigScaffold(), buildReadContig(), writeMessage(), and writeRecord(). |
|
Builds the index with Contig_t Feature_t's. Builds the index with contig features, i.e. the index will contain a set of all associated features for each contig IID. Will throw an exception if there was any trouble opening and reading from the banks.
References AMOS::B_READ, clear(), AMOS::IBankable_t::getIID(), insert(), AMOS::NULL_ID, and setType(). |
|
Builds the index with Contig_t to Scaffold_t mappings. Builds the index with contig to scaffold links, i.e. the index will reference the containing scaffold(s) for each contig IID. Will throw an exception if there was any trouble opening and reading from the banks.
References AMOS::B_READ, begin(), clear(), const_iterator, end(), AMOS::IBankable_t::getIID(), insert(), AMOS::NULL_ID, and setType(). |
|
Builds the index with Read_t to Contig_t mappings. Builds the index with read to contig links, i.e. the index will reference the containing contig(s) for each read IID. Will throw an exception if there was any trouble opening and reading from the banks.
References AMOS::B_READ, begin(), clear(), const_iterator, end(), AMOS::IBankable_t::getIID(), insert(), AMOS::NULL_ID, and setType(). |
|
Builds the index with Read_t to Library_t mappings. Builds the index with read to library links, i.e. the index will reference the parent library for each read IID. Will throw an exception if there was any trouble opening and reading from the banks.
References AMOS::B_READ, clear(), AMOS::IBankable_t::getIID(), insert(), AMOS::NULL_ID, and setType(). |
|
Builds the index with mated Read_t's. Builds the index with read mates, i.e. the index will reference the the mate of each read IID. Will throw an exception if there was any trouble opening and reading from the banks.
References clear(), insert(), AMOS::NULL_ID, and setType(). |
|
Builds the index with Scaffold_t Feature_t's. Builds the index with scaffold features, i.e. the index will contain a set of all associated features for each scaffold IID. Will throw an exception if there was any trouble opening and reading from the banks.
References AMOS::B_READ, clear(), AMOS::IBankable_t::getIID(), insert(), AMOS::NULL_ID, and setType(). |
|
Clears all object data, reinitializes the object.
Reimplemented from AMOS::Universal_t. Definition at line 246 of file Index_AMOS.hh. References AMOS::Universal_t::clear(), and AMOS::NULL_NCODE. Referenced by buildContigFeature(), buildContigScaffold(), buildReadContig(), buildReadLibrary(), buildReadMate(), buildScaffoldFeature(), readMessage(), readRecord(), and writeMessage(). |
|
Returns the number of IDs associated with a particular key.
References AMOS::ID_t, and AMOS::Size_t. Referenced by isMulti(). |
|
Returns true if the index is empty.
|
|
Definition at line 228 of file Index_AMOS.hh. References const_iterator, and end(). |
|
Returns a iterator to the end of the index. Iterator is of the type hash_multimap<ID_t, ID_t>::iterator. Access TO and FROM IIDs with 'itr -> first' and 'itr -> second' respectively.
References iterator. Referenced by buildContigScaffold(), buildReadContig(), end(), writeMessage(), and writeRecord(). |
|
Get the comment string.
Referenced by AMOS::operator<<(). |
|
Get the external ID.
References AMOS::IBankable_t::eid_m. Referenced by AMOS::Contig_t::writeUMD(). |
|
Get the internal ID.
References AMOS::ID_t, and AMOS::IBankable_t::iid_m. Referenced by buildContigFeature(), buildContigScaffold(), buildReadContig(), buildReadLibrary(), buildScaffoldFeature(), and AMOS::operator<<(). |
|
Get the AMOS NCode type identifier.
Reimplemented from AMOS::Universal_t. Definition at line 267 of file Index_AMOS.hh. References AMOS::NCode_t. |
|
Returns the number of ID pairs in the index.
References AMOS::Size_t. Referenced by readMessage(), writeMessage(), and writeRecord(). |
|
Get the status value.
References AMOS::Status_t. |
|
Get the index type as a pair of NCodes. Get the index type as a pair of NCodes for the FROM and TO type respectively.
|
|
Definition at line 315 of file Index_AMOS.hh. References insert(). |
|
Inserts a new IID pair into the index. Inserts a new IID pair into the index. Index keys are allowed to have multiple, not necessarily unique, values.
References AMOS::ID_t. Referenced by buildContigFeature(), buildContigScaffold(), buildReadContig(), buildReadLibrary(), buildReadMate(), buildScaffoldFeature(), insert(), readMessage(), and readRecord(). |
|
Check the value of flag A.
References AMOS::IBankable_t::flags_m. Referenced by AMOS::Universal_t::writeMessage(), and AMOS::Overlap_t::writeMessage(). |
|
Check the value of flag B.
References AMOS::IBankable_t::flags_m. Referenced by AMOS::Universal_t::writeMessage(), and AMOS::Overlap_t::writeMessage(). |
|
Check if the object has been modified.
References AMOS::IBankable_t::flags_m. |
|
Returns true if count is > 1 for a particular key.
References count(), and AMOS::ID_t. |
|
Check if the object is waiting to be removed from the bank.
References AMOS::IBankable_t::flags_m. |
|
Look up a single IID by its index key. Look up a single IID by its index key, even though multiple IDs make be associated with the same key. If multiple IDs exist for the same key, a single value will be picked (in no guaranteed fasion) and returned
References AMOS::ID_t. |
|
Definition at line 366 of file Index_AMOS.hh. References AMOS::ID_t. |
|
Look up a list of IIDs by their index key. Look up all IIDs associated with the same index key. A begin and end iterator will be returned, representing the bounds of the value list. Like standard STL begin/end iterators, the begin iterator will point to the first object and the end iterator will point one past the end object.
References AMOS::ID_t. |
|
Reads in data from a Message object. Reads the data contained in a Message object and stores it in the Messagable object. Will not complain if incoming message is of the wrong type, will only try and suck out the fields it recognizes. All previous data in the Messagable object will be cleared or overwritten.
Reimplemented from AMOS::Universal_t. Definition at line 170 of file Index_AMOS.cc. References AMOS_THROW_ARGUMENT, clear(), AMOS::Encode(), AMOS::F_MAP, AMOS::F_OBJECT, AMOS::F_SIZE, getSize(), insert(), AMOS::NCODE_SIZE, AMOS::Universal_t::readMessage(), and AMOS::Size_t. |
|
Read selected class members from a biserial record. Reads the fixed and variable length streams from a biserial record and initializes the class members to the values stored within. Used in translating a biserial IBankable object, and needed to retrieve objects from a bank.
Reimplemented from AMOS::Universal_t. Definition at line 230 of file Index_AMOS.cc. References clear(), insert(), AMOS::Pos_t, AMOS::readLE(), AMOS::Universal_t::readRecord(), and AMOS::Size_t. |
|
Remove a single ID pair.
References iterator. |
|
Remove all IIDs associated with a particular key. Will remove the index key and all values associated with that key. Returns the number of ID pairs removed.
References AMOS::ID_t, and AMOS::Size_t. |
|
Set the comment string.
|
|
Set the external ID. Will only use the characters up to but not including the first newline.
References AMOS::IBankable_t::eid_m, and AMOS::NL_CHAR. Referenced by AMOS::Contig_t::readUMD(). |
|
Set flag A. Has no effect on the actual object in memory other than setting a flag. This is one of two user accessible flags to be used as needed, the other is flag B.
References AMOS::IBankable_t::flags_m. Referenced by AMOS::Universal_t::readMessage(), and AMOS::Overlap_t::readMessage(). |
|
Set flag B. Has no effect on the actual object in memory other than setting a flag. This is one of two user accessible flags to be used as needed, the other is flag A.
References AMOS::IBankable_t::flags_m. Referenced by AMOS::Universal_t::readMessage(), and AMOS::Overlap_t::readMessage(). |
|
Set the internal ID.
References AMOS::ID_t, and AMOS::IBankable_t::iid_m. |
|
Set the status value.
References AMOS::Status_t. Referenced by AMOS::Universal_t::readMessage(). |
|
Definition at line 419 of file Index_AMOS.hh. References AMOS::NCode_t, and setType(). |
|
Set the index type as a pair of NCodes. Set the index type as a pair of NCodes for the FROM and TO type respectively.
Referenced by buildContigFeature(), buildContigScaffold(), buildReadContig(), buildReadLibrary(), buildReadMate(), buildScaffoldFeature(), and setType(). |
|
Writes data to a Message object. Writes the data contained in a Messagable object to a Message object. All previous data in the Message will be cleared or overwritten.
Reimplemented from AMOS::Universal_t. Definition at line 252 of file Index_AMOS.cc. References begin(), clear(), const_iterator, AMOS::Decode(), end(), AMOS::F_MAP, AMOS::F_OBJECT, AMOS::F_SIZE, getSize(), AMOS::NL_CHAR, AMOS::NULL_NCODE, AMOS::NULL_STRING, AMOS::Size_t, and AMOS::Universal_t::writeMessage(). |
|
Write selected class members to a biserial record. Writes the fixed and variable length streams to a biserial record. Used in generating a biserial IBankable object, and needed to commit objects to a bank. Should not write the flags, EID, or IID of the object because the bank will handle the storage of these fields on its own.
Reimplemented from AMOS::Universal_t. Definition at line 296 of file Index_AMOS.cc. References begin(), const_iterator, end(), getSize(), AMOS::Size_t, AMOS::writeLE(), and AMOS::Universal_t::writeRecord(). |
|
external ID (anything you want sans newlines) Definition at line 66 of file Bank_AMOS.hh. Referenced by AMOS::IBankable_t::clear(), AMOS::IBankable_t::getEID(), and AMOS::IBankable_t::setEID(). |
|
bank flags, derived classes may use "nibble" Definition at line 68 of file Bank_AMOS.hh. Referenced by AMOS::IBankable_t::clear(), AMOS::IBankable_t::isFlagA(), AMOS::IBankable_t::isFlagB(), AMOS::IBankable_t::isModified(), AMOS::IBankable_t::isRemoved(), AMOS::IBankable_t::setFlagA(), and AMOS::IBankable_t::setFlagB(). |
|
internal ID (integer AMOS identifier) Definition at line 64 of file Bank_AMOS.hh. Referenced by AMOS::IBankable_t::clear(), AMOS::IBankable_t::getIID(), AMOS::IBankable_t::IBankable_t(), and AMOS::IBankable_t::setIID(). |
|
The NCode type identifier for this object.
Reimplemented from AMOS::Universal_t. Definition at line 18 of file Index_AMOS.cc. |