baliga-lab / cmonkey2

Python port of cMonkey, a machine-learning based method for clustering
GNU Lesser General Public License v3.0
26 stars 16 forks source link

python 3 cmonkey crashing early #74

Closed fwschmitz closed 6 years ago

fwschmitz commented 7 years ago

Hi Wei-Ju et al., I wanted to run a human expression file (with GeneSymbols as gene names) 1 - RSAT cannot map the GSymbols to STRING IDs, switching off networks and string. runs now. 2 - after calculating some backgrounds, cm2 crashes with: 2017-11-07 11:22:16 INFO Calculating some backgrounds for about 17 genes 2017-11-07 11:24:45 INFO Calculating some backgrounds for about 23 genes 2017-11-07 11:28:20 INFO Calculating some backgrounds for about 26 genes 2017-11-07 11:31:02 INFO Calculating some backgrounds for about 44 genes 2017-11-07 11:34:08 INFO Calculating some backgrounds for about 24 genes Traceback (most recent call last): File "/home/fschmitz/miniconda3/bin/cmonkey2", line 36, in cmonkey_run.run() File "/home/fschmitz/miniconda3/lib/python3.5/site-packages/cmonkey/cmonkey_run.py", line 440, in run self.run_iterations() File "/home/fschmitz/miniconda3/lib/python3.5/site-packages/cmonkey/cmonkey_run.py", line 675, in run_iterations self.run_iteration(iteration, force=force) File "/home/fschmitz/miniconda3/lib/python3.5/site-packages/cmonkey/cmonkey_run.py", line 611, in run_iteration cscores = self.column_scoring.compute(iteration_result) File "/home/fschmitz/miniconda3/lib/python3.5/site-packages/cmonkey/scoring.py", line 142, in compute computed_result = self.do_compute(iteration_result, reference_matrix) File "/home/fschmitz/miniconda3/lib/python3.5/site-packages/cmonkey/scoring.py", line 227, in do_compute self.BSCM_obj) File "/home/fschmitz/miniconda3/lib/python3.5/site-packages/cmonkey/scoring.py", line 281, in compute_column_scores substitution = compute_substitution(cluster_column_scores) File "/home/fschmitz/miniconda3/lib/python3.5/site-packages/cmonkey/scoring.py", line 247, in compute_substitution if colnames[col] in columns: TypeError: 'dict_keys' object does not support indexing

Is this a specific when no networks or string or meme is used or due to missing gene name mapping or plainly (because this IS) a python 3.5 error? Thanks, Frank

weiju commented 7 years ago

Hi Frank, this looks to me like a code section that was not tested in Python 3.5, namely the BSCM code. The problem iseems to be the lines 277 and 278 in scoring.py that should be replaced by this:

                exp_names = list(cur_column_scores.keys())
                exp_scores = np.array(list(cur_column_scores.values()))

If you are running from source, could you please try if those changes will fix your problem ?

Thanks, Wei-ju

fwschmitz commented 7 years ago

Thank you Wei-Ju! I will try without the BSCM flag, convert to running from source and let you know both ways. Do you happen to have a run command line that works well with human expression data and addresses all the RSAT and STRING issues? Or are they contained somewhere in the SYGNAL publication? Alternatively - do you happen to have a docker container with working code for human data and possibly running inferelator on top? Best, Frank

On Nov 7, 2017, at 12:30 PM, Wei-ju Wu notifications@github.com wrote:

Hi Frank, this looks to me like a code section that was not tested in Python 3.5, namely the BSCM code. The problem iseems to be the lines 277 and 278 in scoring.py that should be replaced by this:

            exp_names = list(cur_column_scores.keys())
            exp_scores = np.array(list(cur_column_scores.values()))

If you are running from source, could you please try if those changes will fix your problem ?

Thanks, Wei-ju

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/baliga-lab/cmonkey2/issues/74#issuecomment-342612581, or mute the thread https://github.com/notifications/unsubscribe-auth/AYWpnZHqP3AA8J0rSxHNrSiNj_AlxrG2ks5s0L4AgaJpZM4QVX7Z.

weiju commented 7 years ago

Well, the sygnal github repository contains the directory "example_cMonkey2_files" which has a sample command line in there, not sure about its completeness, though. We currently don't have a Docker container setup for this.

Drwhit commented 6 years ago

A Dockerized version has now been created here:
https://github.com/PreCyte/cMonkey2-docker/

weiju commented 6 years ago

Hi, thanks for doing this, I should take a look and link to it through the github pages.