kr-colab / diploSHIC

feature-based deep learning for the identification of selective sweeps
MIT License
49 stars 14 forks source link

testing file input size not equal to preds output size #36

Closed stsmall closed 3 years ago

stsmall commented 3 years ago

Hi @andrewkern, I am using an fvec of 500 sims (500 lines + header) for testing classification with a previously constructed model. When I run 'predict' with the option --simData the resulting file has fewer than 500 lines. E.g., 323. I also checked this for the empirical fvecs and the input and output files are also not the same size. Am I missing something here? Like a cutoff option for reporting? thanks, @stsmall

Edit: The output from predict prints '500 predictions complete', but only 322 are in the output file Edit2: The length of preds and predictions (in the diploSHIC.py) are both 500. Edit3: When I drop into the code (ipdb) right after preds to check the length, then 'c' to continue ... the resulting file is 500 lines! BUT once I remove the breakpoint and run it back to <500 ... lol, I think I am losing my mind

stsmall commented 3 years ago

It seems the culprit is on Ln 319, there is not an () on outputFile.close. If I change it to outputFile.close() ... it works as expected.

andrewkern commented 3 years ago

well that's a crappy bug. @stsmall do you want to submit a little PR so that you can get credit for this bug fix?

stsmall commented 3 years ago

No thanks. Glad to have helped out.