Skip to content

Commit

Permalink
working version (wrong counts)
Browse files Browse the repository at this point in the history
  • Loading branch information
gf777 committed Jun 12, 2024
1 parent 4efda0c commit 7326fcf
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 63 deletions.
2 changes: 1 addition & 1 deletion gfalibs
Submodule gfalibs updated 1 files
+100 −100 include/kmer.h
2 changes: 0 additions & 2 deletions include/kreeq.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ class DBG : public Kmap<DBG, UserInputKreeq, DBGkmer, DBGkmer32> { // CRTP

bool mergeSubMaps(parallelMap* map1, parallelMap* map2, uint8_t subMapIndex, uint16_t m);

bool unionSum(parallelMap* map1, parallelMap* map2, uint16_t m);

bool mergeSubMaps(parallelMap32* map1, parallelMap32* map2, uint8_t subMapIndex);

bool unionSum(parallelMap32* map1, parallelMap32* map2);
Expand Down
2 changes: 0 additions & 2 deletions src/graph-builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,7 @@ bool DBG::reloadMap32(uint16_t m) {
auto newPair = std::make_pair(pair.first, dbgkmer);
map.insert(newPair);
}

return true;

}

bool DBG::summary(uint16_t m) {
Expand Down
116 changes: 58 additions & 58 deletions src/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,64 +116,64 @@ void Input::read() {
knav.cleanup(); // delete tmp files
break;
}
// case 1: { // union of multiple kmerdbs
//
// std::ifstream file;
// lg.verbose("Merging input databases.");
// unsigned int numFiles = userInput.kmerDB.size(); // number of input kmerdbs
// short unsigned int k = 0;
//
// for (unsigned int i = 0; i < numFiles; i++) { // reads the kmer length from the index files checking consistency between kmerdbs
//
// file.open(userInput.kmerDB[i] + "/.index");
// std::string line;
//
// getline(file, line);
// file.close();
//
// if (k == 0)
// k = stoi(line);
//
// if (k != stoi(line)) {
// fprintf(stderr, "Cannot merge databases with different kmer length.\n");
// exit(1);
// }
// }
// if (k == 0 || k > 32) {
// fprintf(stderr, "Invalid kmer length.\n");
// exit(1);
// }
// DBG knav(userInput); // a new empty kmerdb with the specified kmer length
// lg.verbose("DBG object generated. Merging.");
// knav.kunion(); // union set
// knav.report(); // output
// knav.cleanup(); // delete tmp files
// break;
// }
// case 2: { // subgraph
//
// loadGraph();
// DBG knav(userInput); // navigational kmerdb
// knav.loadHighCopyKmers(); // reload high copy kmers for computation steps
//
// InSequencesDBG genome; // initialize sequence collection object
// if (!userInput.inSequence.empty()) {
//
// if (!userInput.inSequence.empty()) {
// lg.verbose("Loading input sequences");
// loadGenome(genome); // read input genome
// lg.verbose("Sequences loaded");
// }
// knav.loadGenome(&genome);
// }
// knav.subgraph();
// knav.report(); // output
// knav.cleanup(); // delete tmp files
// break;
// }
// default:
// fprintf(stderr, "Invalid mode.\n");
// exit(1);
case 1: { // union of multiple kmerdbs

std::ifstream file;
lg.verbose("Merging input databases.");
unsigned int numFiles = userInput.kmerDB.size(); // number of input kmerdbs
short unsigned int k = 0;

for (unsigned int i = 0; i < numFiles; i++) { // reads the kmer length from the index files checking consistency between kmerdbs

file.open(userInput.kmerDB[i] + "/.index");
std::string line;

getline(file, line);
file.close();

if (k == 0)
k = stoi(line);

if (k != stoi(line)) {
fprintf(stderr, "Cannot merge databases with different kmer length.\n");
exit(1);
}
}
if (k == 0 || k > 32) {
fprintf(stderr, "Invalid kmer length.\n");
exit(1);
}
DBG knav(userInput); // a new empty kmerdb with the specified kmer length
lg.verbose("DBG object generated. Merging.");
knav.kunion(); // union set
knav.report(); // output
knav.cleanup(); // delete tmp files
break;
}
case 2: { // subgraph

loadGraph();
DBG knav(userInput); // navigational kmerdb
knav.loadHighCopyKmers(); // reload high copy kmers for computation steps

InSequencesDBG genome; // initialize sequence collection object
if (!userInput.inSequence.empty()) {

if (!userInput.inSequence.empty()) {
lg.verbose("Loading input sequences");
loadGenome(genome); // read input genome
lg.verbose("Sequences loaded");
}
knav.loadGenome(&genome);
}
knav.subgraph();
knav.report(); // output
knav.cleanup(); // delete tmp files
break;
}
default:
fprintf(stderr, "Invalid mode.\n");
exit(1);
}
}

Expand Down

0 comments on commit 7326fcf

Please sign in to comment.