Git Product home page Git Product logo

drivaer's People

Contributors

fangfang0906 avatar lkmklsmn avatar

Stargazers

 avatar  avatar

Watchers

 avatar

drivaer's Issues

dv.calc_relevance function does not accept normal count expression matrix

Hey! I have attempted using DrivAER but could not load in my normal expression matrix in the form a dataframe with genes as rownames and cells as column names into the function dv.calc_relevance. I have gotten an attribute error;

'DataFrame' object has no attribute 'var_names'

May I know if there is any way I can rectify this?

colab notebook errors

Hi, I want to report that I found Colab notebook errors. It would be great if you can guide how to resolve the issues.

  1. The fifth cell, which contains the code to calculate relevance score, occurs an error, and the following logs are what I saw. I guess there is an issue with scanpy or anndata, but I am not sure what exactly causes the error.
1 / 10
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-12-7d9aa89bc9ec> in <module>()
      5                             "PI3K_AKT_MTOR_SIGNALING", "UV_RESPONSE_UP",
      6                             "MITOTIC_SPINDLE", "PROTEIN_SECRETION"]]
----> 7 res = dv.calc_relevance(count=adata, pheno=adata.obs['Condition'], tf_targets = hm_human_reduced, min_targets=10)

8 frames
/usr/local/lib/python3.6/dist-packages/DrivAER/rele_score.py in calc_relevance(count, pheno, tf_targets, min_targets, ae_type, epochs, early_stop, hidden_size, verbose)
     48         return(sub.obsm["X_dca"])
     49 
---> 50     embed = targets.map(fun_dca)
     51 
     52     df_list = [pd.DataFrame(v, columns=[str(k) + '-1', str(k) + '-2']) for k, v in embed.items()]

/usr/local/lib/python3.6/dist-packages/pandas/core/series.py in map(self, arg, na_action)
   3628         dtype: object
   3629         """
-> 3630         new_values = super()._map_values(arg, na_action=na_action)
   3631         return self._constructor(new_values, index=self.index).__finalize__(self)
   3632 

/usr/local/lib/python3.6/dist-packages/pandas/core/base.py in _map_values(self, mapper, na_action)
   1143 
   1144         # mapper is a function
-> 1145         new_values = map_f(values, mapper)
   1146 
   1147         return new_values

pandas/_libs/lib.pyx in pandas._libs.lib.map_infer()

/usr/local/lib/python3.6/dist-packages/DrivAER/rele_score.py in fun_dca(v)
     45 
     46         dca_drivaer(sub, mode='latent',ae_type=ae_type,epochs=epochs,
---> 47         early_stop=early_stop,hidden_size=hidden_size,verbose=verbose)
     48         return(sub.obsm["X_dca"])
     49 

/usr/local/lib/python3.6/dist-packages/DrivAER/dca_drivaer.py in dca_drivaer(adata, mode, ae_type, normalize_per_cell, scale, log1p, hidden_size, hidden_dropout, batchnorm, activation, init, network_kwds, epochs, reduce_lr, early_stop, batch_size, optimizer, learning_rate, random_state, threads, verbose, training_kwds, return_model, return_info, copy)
    212                     size_factors=normalize_per_cell,
    213                     normalize_input=scale,
--> 214                     logtrans_input=log1p)
    215 
    216     network_kwds = {**network_kwds,

/usr/local/lib/python3.6/dist-packages/DrivAER/dca_drivaer.py in normalize_drivaer(adata, filter_min_counts, size_factors, normalize_input, logtrans_input)
    199 
    200         if logtrans_input:
--> 201             sc.pp.log1p(adata)
    202 
    203         if normalize_input:

/usr/lib/python3.6/functools.py in wrapper(*args, **kw)
    805                             '1 positional argument')
    806 
--> 807         return dispatch(args[0].__class__)(*args, **kw)
    808 
    809     funcname = getattr(func, '__name__', 'singledispatch function')

/usr/local/lib/python3.6/dist-packages/scanpy/preprocessing/_simple.py in log1p_anndata(adata, base, copy, chunked, chunk_size, layer, obsm)
    337 
    338     adata = adata.copy() if copy else adata
--> 339     view_to_actual(adata)
    340 
    341     if chunked:

/usr/local/lib/python3.6/dist-packages/scanpy/_utils.py in view_to_actual(adata)
    390 
    391 def view_to_actual(adata):
--> 392     if adata.is_view:
    393         warnings.warn(
    394             "Revieved a view of an AnnData. Making a copy.", stacklevel=2,

AttributeError: 'AnnData' object has no attribute 'is_view'
  1. Also, I found that The third cell of the Blood development notebook
%%capture
!wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=1JazgSX8Yb21DqWBNmVABbIDr2x_wFARd' -O "paul15.h5ad"
adata = sc.read("paul15.h5ad")

I got an error message with commenting %%capture

--2020-07-26 15:51:49--  https://docs.google.com/uc?export=download&id=1JazgSX8Yb21DqWBNmVABbIDr2x_wFARd
Resolving docs.google.com (docs.google.com)... 209.85.200.100, 209.85.200.139, 209.85.200.113, ...
Connecting to docs.google.com (docs.google.com)|209.85.200.100|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2020-07-26 15:51:49 ERROR 404: Not Found.

Thank you,

Hyun-Hwan Jeong

Install issues

Hey! After some struggle, finally installed DrivAER into a venv with scanpy. I'm on a windows machine (sorry, I know), in case that's relevant. However, I've still not been able to get things going. So I'll tell you what I've done and perhaps you can help.

miniconda/anaconda
python 3.7.5
scanpy up to date

  1. After pulling DrivAER from github, and trying to import DrivAER as dv it, I got an error from keras that it requires tensorflow >=2.2. This is weird, because it looks like the init file stipulates tensorflow<1.15. Nevertheless, with some effort I got tensorflow 2.2 installed.

  2. Next time I tried to import DrivAER as dv I got an error about missing package rpy2. This is a python connector to R. So.. I installed ryp2 and an R package

  3. Finally, this allowed me to import DrivAER as dv without an error message, though I did get a couple futurewarnings.

  4. I ran hm_human = dv.get_anno(filename="hallmark.gmt", filetype="gmt", conv_mouse=True) from tutorial which works. But then running dv.calc_relevance(count=adata_raw, pheno=adata_raw.obs['diet'], tf_targets = hm_human, min_targets=10) yields the error module 'keras.backend' has no attribute 'set_session'.

  5. [EDIT]. If I downgrade-install tensorflow 1.15 with keras 2.4.3, I get a different error at the same step: KeyError: 'rmsprop'

I'm stuck on this last one; does this have to do with the tensorflow or keras version?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.