sparse_hash_set requires that set_deleted_key() * is called before calling erase(). This key cannot * be an existing kmer in m_data. This function sets * the deleted key and should be called after all * data has been loaded. */
| 135 | * data has been loaded. |
| 136 | */ |
| 137 | void setDeletedKey() |
| 138 | { |
| 139 | #if HAVE_GOOGLE_SPARSE_HASH_MAP |
| 140 | for (SequenceDataHash::iterator it = m_data.begin(); |
| 141 | it != m_data.end(); it++) { |
| 142 | key_type rc(reverseComplement(it->first)); |
| 143 | bool isrc; |
| 144 | SequenceDataHash::iterator search = find(rc, isrc); |
| 145 | // If this is false, we should have a palindrome or we're |
| 146 | // doing a SS assembly. |
| 147 | if (isrc || search == m_data.end()) { |
| 148 | m_data.set_deleted_key(rc); |
| 149 | return; |
| 150 | } |
| 151 | } |
| 152 | logger(1) << "error: unable to set deleted key.\n"; |
| 153 | exit(EXIT_FAILURE); |
| 154 | #else |
| 155 | return; |
| 156 | #endif |
| 157 | } |
| 158 | |
| 159 | /** Add the specified k-mer to this collection. */ |
| 160 | void add(const key_type& seq, unsigned coverage = 1) |
no test coverage detected