hoffmangroup / segway

Application for semi-automated genomic annotation.
http://segway.hoffmanlab.org/
GNU General Public License v2.0
13 stars 7 forks source link

seg_subseg objects should not be used when hierarchical segmentation is not enabled #88

Open EricR86 opened 8 years ago

EricR86 commented 8 years ago

Original report (BitBucket issue) by Rachel Chan (Bitbucket: rcwchan).


seg_subseg objects should not be used when hierarchical segmentation is not enabled.

The following should not occur as hierarchial segmentation is not actually supposed to be enabled here:

#!python

WARNING: zero accumulator values for DenseCPT 'seg_subseg'
WARNING: zero accumulator values for DenseCPT 'seg_subseg_subseg'

WARNING: DenseCPT named 'seg_subseg' received only -1.000000e+17 accumulated probability in EM iteration. Using previous iteraton values.
WARNING: DenseCPT named 'seg_subseg_subseg' received only -1.000000e+17 accumulated probability in EM iteration. Using previous iteraton values.
EricR86 commented 8 years ago

Original comment by Rachel Chan (Bitbucket: rcwchan).


EricR86 commented 8 years ago

Original comment by Rachel Chan (Bitbucket: rcwchan).


Currently the relevant code is in input_master.py.

In particular, make_dense_cpt_seg_subseg_spec and make_dense_cpt_seg_subseg_subseg_spec.

Due to the way the DenseCPTParamSpec is generated, it is significantly easier to remove them from the input.master files by, for example:

#!python

438     def generate_objects(self):
439         yield self.make_dense_cpt_start_seg_spec()
440         if self.num_subsegs > 1:
441             yield self.make_dense_cpt_seg_subseg_spec()
442         yield self.make_dense_cpt_seg_seg_spec()
443         if self.num_subsegs > 1:
444             yield self.make_dense_cpt_seg_subseg_subseg_spec()
445         yield self.make_dense_cpt_segCountDown_seg_segTransition_spec()

than by inserting an ifdef/endif into the param spec (as that will require some refactoring).

@ericr86 , what would you recommend?

EricR86 commented 8 years ago

Original comment by Rachel Chan (Bitbucket: rcwchan).


Note:

#!python

#if CARD_SUBSEG > 1 
4 subseg_subseg_copy
1
CARD_SUBSEG CARD_SUBSEG
internal:copyParent
#endif

results in

#!python
readUnsigned: Can't form unsigned at (DENSE_CPT_IN_FILE inline
) in file (traindir/params/input.master) line 117. Can't read DeterministicCPT num
readUnsigned: Can't form unsigned at (DENSE_CPT_IN_FILE inline
) in file (traindir/params/input.master) line 117. Can't read DeterministicCPT num