davidpng / FCS_Database

Program to scrape an FCS directory of metadata
GNU General Public License v3.0
3 stars 2 forks source link

Divide by zero error in feature_extraction: len(coordinates) #34

Closed hermands closed 9 years ago

hermands commented 9 years ago

Hey Dave, I haven't looked into this...could be an upfront handling issue, but I'm guessing it could also be a gating/compensation issue. For now, we could decide how to handle a case that exists but has no usable data...could handle a the analysis level or before.

I post in case you get to it before I do.

TEST: BRANCH: OneTubeExtract ~/repos/flow_anal/dev/test_run_custom.sh /home/local/AMC/ngdavid/clinical_cHL_cases/ $HOME/repos/flow_anal/db/Hodgkins/fcs.db $HOME/working/Hodgkin/test_cases.txt

INFO make_features 71 Case: 08-04165, Case_tube_idx: 868, File: Hodgkin_Cases_2008_2013/08-04165/08-04165_Hodgkins.fcs 17 745652684462 45 754557674453 55 554454454542 71 564464554553 80 755764684662 86 755644574454 120 754752684463 153 775762684463 157 474575765662 171 654657674453 dtype: int64 INFO make_features 71 Case: 08-00132, Case_tube_idx: 236, File: Hodgkin_Cases_2008_2013/08-00132/08-00132_Hodgkins.fcs Series([], dtype: float64) Traceback (most recent call last): File "/home/local/AMC/hermands/repos/flow_anal/dev/../flowanal.py", line 7, in sys.exit(main(sys.argv[1:])) File "/home/local/AMC/hermands/repos/flow_anal/FlowAnal/scripts/main.py", line 117, in main return action(arguments) File "/home/local/AMC/hermands/repos/flow_anal/FlowAnal/subcommands/make_features.py", line 93, in action bins=10) File "/home/local/AMC/hermands/repos/flow_anal/FlowAnal/FCS.py", line 108, in feature_extraction _kwargs) File "/home/local/AMC/hermands/repos/flow_anal/FlowAnal/FCS_subroutines/ND_Feature_Extraction.py", line 45, in init _kwargs).tocsr() File "/home/local/AMC/hermands/repos/flow_anal/FlowAnal/FCS_subroutines/ND_Feature_Extraction.py", line 56, in _coord2sparse_histogram return output/ len(coordinates) File "/home/local/AMC/hermands/repos/flow_anal/flow_anal-env/lib/python2.7/site-packages/scipy/sparse/base.py", line 432, in div return self._divide(other, true_divide=True) File "/home/local/AMC/hermands/repos/flow_anal/flow_anal-env/lib/python2.7/site-packages/scipy/sparse/base.py", line 393, in divide return self.astype(np.float)._mul_scalar(1./other) ZeroDivisionError: float division by zero

davidpng commented 9 years ago

I'm not sure how you generated this error, could you send me your execution script. test_run_custom.sh? Are you running this on master or some other branch?

hermands commented 9 years ago

These are both above:

BRANCH: OneTubeExtract COMMAND: ~/repos/flow_anal/dev/test_run_custom.sh /home/local/AMC/ngdavid/clinical_cHL_cases/ $HOME/repos/flow_anal/db/Hodgkins/fcs.db $HOME/working/Hodgkin/test_cases.txt

davidpng commented 9 years ago

Note that you'll need to build a new table to take the feature failure case list.

hermands commented 9 years ago

Handled in subcommand as a failure that is 'caught'