Created
June 19, 2015 23:06
-
-
Save blahah/fb479d075c11b0b1b4ee to your computer and use it in GitHub Desktop.
libkhmer untraceable abort
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "hashbits.hh" | |
#include "subset.hh" | |
#include <string> | |
#include <exception> | |
using namespace khmer; | |
using namespace std; | |
bool file_exists (const string& name) { | |
ifstream f(name.c_str()); | |
if (f.good()) { | |
// f.close(); | |
return true; | |
} else { | |
// f.close(); | |
return false; | |
} | |
} | |
int main(void) { | |
vector<HashIntoType> sizes = | |
{static_cast<HashIntoType>(4e9+7), static_cast<HashIntoType>(4e9+9)}; | |
int k = 19; | |
Hashbits htable(k, sizes); | |
SubsetPartition part(&htable); | |
string left = "example_data/left.fq"; | |
string right = "example_data/right.fq"; | |
string pmap_out = "out.part"; | |
if (file_exists(pmap_out)) { | |
// load existing pmap | |
cout << "Loading partition map from existing file" << endl; | |
try { | |
part.load_partitionmap(pmap_out); | |
} catch (exception &e) { | |
cerr << "ERROR loading partition map" << endl << e.what() << endl; | |
exit(1); | |
} | |
} else { | |
// do fresh partitioning | |
unsigned long long n_consumed = 0; | |
unsigned int total_reads = 0; | |
htable.consume_fasta_and_tag(left, total_reads, n_consumed); | |
htable.consume_fasta_and_tag(right, total_reads, n_consumed); | |
part.do_partition(0, 0, true, true); | |
part.save_partitionmap(pmap_out); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this was eventually resolved to being a problem caused by
-static-libgcc