-
Notifications
You must be signed in to change notification settings - Fork 248
Add createdb support for sequence db input #545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
ebaedb7
ece8e5d
e34f40d
cdb5c8a
f9eb35d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -98,9 +98,12 @@ int createdb(int argc, const char **argv, const Command& command) { | |
|
|
||
| size_t fileCount = filenames.size(); | ||
| DBReader<unsigned int>* reader = NULL; | ||
| DBReader<unsigned int>* hdrReader = nullptr; | ||
| if (dbInput == true) { | ||
| reader = new DBReader<unsigned int>(par.db1.c_str(), par.db1Index.c_str(), 1, DBReader<unsigned int>::USE_DATA | DBReader<unsigned int>::USE_INDEX | DBReader<unsigned int>::USE_LOOKUP); | ||
| reader->open(DBReader<unsigned int>::LINEAR_ACCCESS); | ||
| hdrReader = new DBReader<unsigned int>((par.db1 + "_h").c_str(), (par.db1 + "_h.index").c_str(), 1, DBReader<unsigned int>::USE_DATA | DBReader<unsigned int>::USE_INDEX); | ||
matchy233 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| hdrReader->open(DBReader<unsigned int>::LINEAR_ACCCESS); | ||
| fileCount = reader->getSize(); | ||
| } | ||
|
|
||
|
|
@@ -126,8 +129,11 @@ int createdb(int argc, const char **argv, const Command& command) { | |
| } | ||
|
|
||
| KSeqWrapper* kseq = NULL; | ||
| std::string seq = ">"; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we move this into the if condition? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No we can't :( we need to refer to the address of this string later. Variables defined inside |
||
| if (dbInput == true) { | ||
| kseq = new KSeqBuffer(reader->getData(fileIdx, 0), reader->getEntryLen(fileIdx) - 1); | ||
| seq.append(hdrReader->getData(fileIdx, 0)); | ||
| seq.append(reader->getData(fileIdx, 0)); | ||
| kseq = new KSeqBuffer(seq.c_str(), seq.length()); | ||
| } else { | ||
| kseq = KSeqFactory(filenames[fileIdx].c_str()); | ||
| } | ||
|
|
@@ -260,6 +266,8 @@ int createdb(int argc, const char **argv, const Command& command) { | |
| if (dbInput == true) { | ||
| reader->close(); | ||
| delete reader; | ||
| hdrReader->close(); | ||
| delete hdrReader; | ||
| } | ||
|
|
||
| if (entries_num == 0) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.