theislab / dca

Deep count autoencoder for denoising scRNA-seq data
Apache License 2.0
246 stars 72 forks source link

Version of Pandas #36

Closed gprashant17 closed 4 years ago

gprashant17 commented 4 years ago

I ran the following command on my dataset.

dca SRA779509_SRS3805247.tsv DCA --type zinb

I changed the Tensorflow version to 1.15. However, it looks like the version of pandas that DCA uses is also the older one. The model was trained and the output files mean.tsv, latenet.tsv were produced, following which the execution terminated with an error that pandas series has no attribute 'reshape'.

...
Use tf.where in 2.0, which has the same broadcast rule as np.where
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:422: The name tf.global_variables is deprecated. Please use tf.compat.v1.global_variables instead.

2020-06-06 17:12:58,635 [WARNING] From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:422: The name tf.global_variables is deprecated. Please use tf.compat.v1.global_variables instead.

2020-06-06 17:12:59.027542: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10
Traceback (most recent call last):
  File "/usr/local/bin/dca", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/dist-packages/dca/__main__.py", line 149, in main
    train.train_with_args(args)
  File "/usr/local/lib/python3.6/dist-packages/dca/train.py", line 174, in train_with_args
    net.write(adata, args.outputdir, mode='full', colnames=predict_columns)
  File "/usr/local/lib/python3.6/dist-packages/dca/network.py", line 543, in write
    write_text_matrix(adata.var['X_dca_dispersion'].reshape(1, -1),
  File "/usr/local/lib/python3.6/dist-packages/pandas/core/generic.py", line 5274, in __getattr__
    return object.__getattribute__(self, name)
AttributeError: 'Series' object has no attribute 'reshape'

In the newer versions of pandas, it is replaced with pandas.Series.values.reshape. Is there any way to fix this without changing the version?