Skip to content
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

Fixes some problems related to FASTA header management #3

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ INCDIR = .
################################# for bloom filter code #################################
CXX=g++
# directory of sdsl library.so
SDSL_PATH=$(PREFIX)/lib
SDSL_PATH=./sdsl-lite/COMPILED/lib
# also requires head file of roaring, sdsl, jellyfish, tclap in ~/include
CXXFLAGS= -std=c++11 -Wall -O3 -I$(PREFIX)/include
CXXFLAGS= -std=c++11 -Wall -O3 -I./sdsl-lite/COMPILED/include

LD_LIB=-L $(SDSL_PATH)
LD_FLAG=-lsdsl -ldivsufsort -ldivsufsort64
LD_FLAG=-lsdsl -ldivsufsort -ldivsufsort64

################################ end bloom filter def ##################################

Expand Down
3 changes: 2 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
chmod +x ./sdsl-lite/install.sh ./sdsl-lite/build/*.sh
./sdsl-lite/install.sh $PREFIX
mkdir -p ./sdsl-lite/COMPILED
./sdsl-lite/install.sh ./sdsl-lite/COMPILED
make all
8 changes: 7 additions & 1 deletion src/generate_bf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ int BFGenerator::readFasta(string & fasta_filename) {
genome_vector.emplace_back(genome);
}

id = line.substr(1);
// This is necessary to correctly manage headers containing additional information
id = split(line.substr(1), ' ')[0];

// This is necessary because the chromosome id from VCF is forced to start with chr
if(id.compare(0, 3, "chr") != 0)
id = "chr" + id;

DNA_sequence.clear();
}
else {// if (line[0] != '>'){ // not needed because implicit
Expand Down
6 changes: 5 additions & 1 deletion src/qv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2342,7 +2342,11 @@ int main(const int argc, const char *argv[])
#undef CHRLENS_EXT

for (size_t i = 0; i < ref.size; i++) {
fprintf(chrlens, "%s %lu\n", ref.seqs[i].name, ref.seqs[i].size);
// This is necessary because the chromosome id from VCF is forced to start with chr
std::string seq_name (ref.seqs[i].name);
if(seq_name.compare(0, 3, "chr") != 0)
seq_name = "chr" + seq_name;
fprintf(chrlens, "%s %lu\n", seq_name.c_str(), ref.seqs[i].size);
}

fclose(chrlens);
Expand Down