gregversteeg / bio_corex

A flexible version of CorEx developed for bio-data challenges that handles missing data, continuous/discrete variables, multi-CPU, overlapping structure, and includes visualizations
Apache License 2.0
137 stars 30 forks source link

Install problem - running anaconda with python and python3 #24

Closed paseman closed 3 years ago

paseman commented 3 years ago

(base) katherinepaseman@Bills-MacBook-Pro-3 bio_corex % python vis_corex.py data/test_data.csv vis_corex.py:719: DeprecationWarning: 'U' mode is deprecated with open(filename, 'rU') as csvfile: Time for first layer: 0.05 TC at layer 0 is: 2.078 TC at layer 1 is: -0.000 Groups in sorted_groups.txt Pairwise plots among high TC variables in "relationships" /opt/anaconda3/lib/python3.7/site-packages/seaborn/distributions.py:288: UserWarning: Data must have variance to compute a kernel density estimate. warnings.warn(msg, UserWarning) /opt/anaconda3/lib/python3.7/site-packages/seaborn/distributions.py:288: UserWarning: Data must have variance to compute a kernel density estimate. warnings.warn(msg, UserWarning) /opt/anaconda3/lib/python3.7/site-packages/seaborn/distributions.py:288: UserWarning: Data must have variance to compute a kernel density estimate. warnings.warn(msg, UserWarning) /opt/anaconda3/lib/python3.7/site-packages/seaborn/distributions.py:288: UserWarning: Data must have variance to compute a kernel density estimate. warnings.warn(msg, UserWarning) /opt/anaconda3/lib/python3.7/site-packages/seaborn/distributions.py:288: UserWarning: Data must have variance to compute a kernel density estimate. warnings.warn(msg, UserWarning) /opt/anaconda3/lib/python3.7/site-packages/seaborn/distributions.py:288: UserWarning: Data must have variance to compute a kernel density estimate. warnings.warn(msg, UserWarning) /opt/anaconda3/lib/python3.7/site-packages/seaborn/distributions.py:288: UserWarning: Data must have variance to compute a kernel density estimate. warnings.warn(msg, UserWarning) /opt/anaconda3/lib/python3.7/site-packages/seaborn/distributions.py:288: UserWarning: Data must have variance to compute a kernel density estimate. warnings.warn(msg, UserWarning) /opt/anaconda3/lib/python3.7/site-packages/seaborn/distributions.py:288: UserWarning: Data must have variance to compute a kernel density estimate. warnings.warn(msg, UserWarning) /opt/anaconda3/lib/python3.7/site-packages/seaborn/distributions.py:288: UserWarning: Data must have variance to compute a kernel density estimate. warnings.warn(msg, UserWarning) vis_corex.py:174: FutureWarning: arrays to stack must be passed as a "sequence" type such as list or tuple. Support for non-sequence iterables such as generators is deprecated as of NumPy 1.16 and will raise an error in the future. all_edges = np.hstack(map(np.ravel, weights)) weight threshold is -0.000000 for graph with max of 12.000000 edges Traceback (most recent call last): File "vis_corex.py", line 790, in prefix=options.output) File "vis_corex.py", line 90, in vis_hierarchy g = make_graph(weights, node_weights, column_label, max_edges=max_edges) File "vis_corex.py", line 184, in make_graph g.node[(layer + 1, j)]['weight'] = 0.3 * node_weights[layer][j] / max_node_weight AttributeError: 'DiGraph' object has no attribute 'node'

Same thing with python3 (base) katherinepaseman@Bills-MacBook-Pro-3 bio_corex % python3 vis_corex.py data/test_data.csv vis_corex.py:719: DeprecationWarning: 'U' mode is deprecated with open(filename, 'rU') as csvfile: Time for first layer: 0.04 TC at layer 0 is: 2.078 TC at layer 1 is: -0.000 Groups in sorted_groups.txt Pairwise plots among high TC variables in "relationships" /opt/anaconda3/lib/python3.7/site-packages/seaborn/distributions.py:288: UserWarning: Data must have variance to compute a kernel density estimate. warnings.warn(msg, UserWarning) /opt/anaconda3/lib/python3.7/site-packages/seaborn/distributions.py:288: UserWarning: Data must have variance to compute a kernel density estimate. warnings.warn(msg, UserWarning) /opt/anaconda3/lib/python3.7/site-packages/seaborn/distributions.py:288: UserWarning: Data must have variance to compute a kernel density estimate. warnings.warn(msg, UserWarning) /opt/anaconda3/lib/python3.7/site-packages/seaborn/distributions.py:288: UserWarning: Data must have variance to compute a kernel density estimate. warnings.warn(msg, UserWarning) /opt/anaconda3/lib/python3.7/site-packages/seaborn/distributions.py:288: UserWarning: Data must have variance to compute a kernel density estimate. warnings.warn(msg, UserWarning) /opt/anaconda3/lib/python3.7/site-packages/seaborn/distributions.py:288: UserWarning: Data must have variance to compute a kernel density estimate. warnings.warn(msg, UserWarning) /opt/anaconda3/lib/python3.7/site-packages/seaborn/distributions.py:288: UserWarning: Data must have variance to compute a kernel density estimate. warnings.warn(msg, UserWarning) /opt/anaconda3/lib/python3.7/site-packages/seaborn/distributions.py:288: UserWarning: Data must have variance to compute a kernel density estimate. warnings.warn(msg, UserWarning) /opt/anaconda3/lib/python3.7/site-packages/seaborn/distributions.py:288: UserWarning: Data must have variance to compute a kernel density estimate. warnings.warn(msg, UserWarning) /opt/anaconda3/lib/python3.7/site-packages/seaborn/distributions.py:288: UserWarning: Data must have variance to compute a kernel density estimate. warnings.warn(msg, UserWarning) vis_corex.py:174: FutureWarning: arrays to stack must be passed as a "sequence" type such as list or tuple. Support for non-sequence iterables such as generators is deprecated as of NumPy 1.16 and will raise an error in the future. all_edges = np.hstack(map(np.ravel, weights)) weight threshold is -0.000000 for graph with max of 12.000000 edges Traceback (most recent call last): File "vis_corex.py", line 790, in prefix=options.output) File "vis_corex.py", line 90, in vis_hierarchy g = make_graph(weights, node_weights, column_label, max_edges=max_edges) File "vis_corex.py", line 184, in make_graph g.node[(layer + 1, j)]['weight'] = 0.3 * node_weights[layer][j] / max_node_weight AttributeError: 'DiGraph' object has no attribute 'node' (base) katherinepaseman@Bills-MacBook-Pro-3 bio_corex %

gregversteeg commented 3 years ago

vis_corex.py:719: DeprecationWarning: 'U' mode is deprecated

This warning can be ignored. It's there for python 2 compatibility, but eventually we'll just delete the "U" character as this is the default mode in python 3.

/opt/anaconda3/lib/python3.7/site-packages/seaborn/distributions.py:288: UserWarning: Data must have variance to compute a kernel density estimate.

This only affects some of the output visualizations. You might get this if one of your data columns is constant. I recommend you omit any data columns which are constant - CorEx doesn't use them.

vis_corex.py:174: FutureWarning: arrays to stack must be passed as a "sequence" type such as list or tuple. Support for non-sequence iterables such as generators is deprecated as of NumPy 1.16 and will raise an error in the future.

Another warning you can ignore. I just updated the code to remove this one.

AttributeError: 'DiGraph' object has no attribute 'node'

And now the big one, from networkx. This one is tricky because they changed the interface multiple times. So if I change it here, it might break somebody else's installation. Can you try installing an old version of networkx (e.g. by doing "pip install networkx==1.11") and seeing if that fixes it?

gregversteeg commented 3 years ago

Another option is to replace ".node" with "._node" as that seems to be the new networkx interface. I haven't tried that though.

gregversteeg commented 3 years ago

Ok, I just updated the code replacing g.node with g._node. It seems to work with the newer version of networkx! Let me know if there are still issues.

paseman commented 3 years ago

Just saw this! Thanks for the fix.

On Wed, Jan 6, 2021 at 12:51 PM Greg Ver Steeg notifications@github.com wrote:

Closed #24 https://github.com/gregversteeg/bio_corex/issues/24.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gregversteeg/bio_corex/issues/24#event-4176977475, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEIR5OF5TBAQO6FW6Q67PTSYTEOTANCNFSM4VPAZJLA .