diff --git a/src/cgi/include/computeCoreIdentity.hpp b/src/cgi/include/computeCoreIdentity.hpp index 76af5aa..88024b7 100644 --- a/src/cgi/include/computeCoreIdentity.hpp +++ b/src/cgi/include/computeCoreIdentity.hpp @@ -50,8 +50,7 @@ namespace cgi for(auto &e : parameters.querySequences) { //Open the file using kseq - FILE *file = fopen(e.c_str(), "r"); - gzFile fp = gzdopen(fileno(file), "r"); + gzFile fp = gzopen(e.c_str(), "r"); kseq_t *seq = kseq_init(fp); int l; uint64_t genomeLen = 0; @@ -62,7 +61,6 @@ namespace cgi kseq_destroy(seq); gzclose(fp); //close the file handler - fclose(file); } for(auto &e : parameters.refSequences) @@ -70,8 +68,7 @@ namespace cgi if( genomeLengths.find(e) == genomeLengths.end() ) { //Open the file using kseq - FILE *file = fopen(e.c_str(), "r"); - gzFile fp = gzdopen(fileno(file), "r"); + gzFile fp = gzopen(e.c_str(), "r"); kseq_t *seq = kseq_init(fp); int l; uint64_t genomeLen = 0; @@ -82,7 +79,6 @@ namespace cgi kseq_destroy(seq); gzclose(fp); //close the file handler - fclose(file); } } } diff --git a/src/map/include/computeMap.hpp b/src/map/include/computeMap.hpp index 13d4a1f..9abc123 100644 --- a/src/map/include/computeMap.hpp +++ b/src/map/include/computeMap.hpp @@ -119,8 +119,7 @@ namespace skch { //Open the file using kseq - FILE *file = fopen(queryFileName.c_str(), "r"); - gzFile fp = gzdopen(fileno(file), "r"); + gzFile fp = gzopen(queryFileName.c_str(), "r"); kseq_t *seq = kseq_init(fp); #ifdef DEBUG diff --git a/src/map/include/winSketch.hpp b/src/map/include/winSketch.hpp index e5ce08e..1c07188 100644 --- a/src/map/include/winSketch.hpp +++ b/src/map/include/winSketch.hpp @@ -134,11 +134,9 @@ namespace skch #endif //Open the file using kseq - FILE *file = fopen(fileName.c_str(), "r"); - gzFile fp = gzdopen(fileno(file), "r"); + gzFile fp = gzopen(fileName.c_str(), "r"); kseq_t *seq = kseq_init(fp); - //size of sequence offset_t len; @@ -166,7 +164,6 @@ namespace skch kseq_destroy(seq); gzclose(fp); //close the file handler - fclose(file); } if ( omp_get_thread_num() == 0)