diff --git a/src/utils/Fasta/Fasta.cpp b/src/utils/Fasta/Fasta.cpp index 447eab8b94bb513858475796f6c1fdd666fd2df4..bd0c70096805641dbc293af528891377e47c6f85 100644 --- a/src/utils/Fasta/Fasta.cpp +++ b/src/utils/Fasta/Fasta.cpp @@ -286,7 +286,7 @@ string FastaReference::sequenceNameStartingWith(string seqnameStart) { } } -string FastaReference::getSubSequence(const string &seqname, int start, int length) { +string FastaReference::getSubSequence(string seqname, int start, int length) { FastaIndexEntry entry = index->entry(seqname); if (start < 0 || length < 1) { cerr << "Error: cannot construct subsequence with negative offset or length < 1" << endl; @@ -318,7 +318,7 @@ string FastaReference::getSubSequence(const string &seqname, int start, int leng return s; } -long unsigned int FastaReference::sequenceLength(const string &seqname) { +long unsigned int FastaReference::sequenceLength(string seqname) { FastaIndexEntry entry = index->entry(seqname); return entry.length; } diff --git a/src/utils/Fasta/Fasta.h b/src/utils/Fasta/Fasta.h index 9bebae04c0f41d966793b0ebbd6329064c2912f1..f9e3a7f5e3c1b6421d0912e55266f11cc71be215 100644 --- a/src/utils/Fasta/Fasta.h +++ b/src/utils/Fasta/Fasta.h @@ -70,9 +70,9 @@ class FastaReference { string getSequence(string seqname); // potentially useful for performance, investigate // void getSequence(string seqname, string& sequence); - string getSubSequence(const string &seqname, int start, int length); + string getSubSequence(string seqname, int start, int length); string sequenceNameStartingWith(string seqnameStart); - long unsigned int sequenceLength(const string &seqname); + long unsigned int sequenceLength(string seqname); }; #endif diff --git a/src/utils/bedFile/bedFile.cpp b/src/utils/bedFile/bedFile.cpp index 4b7bdc6348ecea298318bbc4ca7ccce89ea4c0ca..f296b429dc98682c2a51b9bfd997746211667069 100644 --- a/src/utils/bedFile/bedFile.cpp +++ b/src/utils/bedFile/bedFile.cpp @@ -139,6 +139,9 @@ void BedFile::Open(void) { delete _bedStream; _bedStream = new igzstream(bedFile.c_str(), ios::in); } + // bytes were consumed. rewind. + _bedStream->seekg(0); + // can we open the file? if ( !(_bedStream->good()) ) { cerr << "Error: The requested bed file (" << bedFile << ") could not be opened. Exiting!" << endl; diff --git a/src/utils/bedFilePE/bedFilePE.cpp b/src/utils/bedFilePE/bedFilePE.cpp index adc447cd81c0bb6b81aa685c50b8206c93860736..08f8a4565e2e9b2ae63206f4b20e440c7df9d366 100644 --- a/src/utils/bedFilePE/bedFilePE.cpp +++ b/src/utils/bedFilePE/bedFilePE.cpp @@ -35,6 +35,10 @@ void BedFilePE::Open(void) { delete _bedStream; _bedStream = new igzstream(bedFile.c_str(), ios::in); } + + // bytes were consumed. rewind. + _bedStream->seekg(0); + // can we open the file? if ( !(_bedStream->good()) ) { cerr << "Error: The requested bed file (" << bedFile << ") could not be opened. Exiting!" << endl; diff --git a/src/utils/bedGraphFile/bedGraphFile.cpp b/src/utils/bedGraphFile/bedGraphFile.cpp index f3df54026f55a23d7ef3249d265b70e4736d3293..d9e618f72e6bec5804402753dc68a6953e0c708f 100644 --- a/src/utils/bedGraphFile/bedGraphFile.cpp +++ b/src/utils/bedGraphFile/bedGraphFile.cpp @@ -37,6 +37,10 @@ void BedGraphFile::Open() { delete _bedGraphStream; _bedGraphStream = new igzstream(bedGraphFile.c_str(), ios::in); } + + // bytes were consumed. rewind. + _bedGraphStream->seekg(0); + // can we open the file? if ( !(_bedGraphStream->good()) ) { cerr << "Error: The requested bed file (" << bedGraphFile << ") could not be opened. Exiting!" << endl;