Skip to content

Commit

Permalink
parallel file sketch fix(?)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Ondov committed Dec 21, 2016
1 parent c2fc632 commit 66d63e3
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/mash/Sketch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1105,18 +1105,17 @@ void setMinHashesForReference(Sketch::Reference & reference, const MinHashHeap &

Sketch::SketchOutput * sketchFile(Sketch::SketchInput * input)
{
FILE * inStream = 0;
gzFile fp;

if ( input->fileName == "-" )
{
inStream = stdin;
fp = gzdopen(fileno(stdin), "r");
}
else
{
inStream = fopen(input->fileName.c_str(), "r");
fp = gzopen(input->fileName.c_str(), "r");
}

gzFile fp = gzdopen(fileno(inStream), "r");
kseq_t *seq = kseq_init(fp);

const Sketch::Parameters & parameters = input->parameters;
Expand Down Expand Up @@ -1224,7 +1223,6 @@ Sketch::SketchOutput * sketchFile(Sketch::SketchInput * input)

kseq_destroy(seq);
gzclose(fp);
fclose(inStream);

return output;
}
Expand Down

0 comments on commit 66d63e3

Please sign in to comment.