Coder Social home page Coder Social logo

shenwanxiang / bidd-aggmap Goto Github PK

View Code? Open in Web Editor NEW
33.0 33.0 5.0 892.27 MB

Jigsaw-like AggMap: A Robust and Explainable Multi-Channel Omics Deep Learning Tool

Home Page: https://bidd-aggmap.readthedocs.io/en/latest/

License: GNU General Public License v3.0

Python 0.22% Jupyter Notebook 99.07% HTML 0.71%
ai clustering deep-learning machine-learning omics visualization

bidd-aggmap's People

Contributors

dependabot[bot] avatar shenwanxiang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bidd-aggmap's Issues

TypeError: an integer is required (got type bytes)

TypeError Traceback (most recent call last)
Cell In[1], line 2
1 import pandas as pd
----> 2 from sklearn.datasets import load_breast_cancer
3 from aggmap import AggMap, AggMapNet
5 # Data loading

File ~/micromamba/envs/aggmap/lib/python3.8/site-packages/sklearn/init.py:82
80 from . import _distributor_init # noqa: F401
81 from . import __check_build # noqa: F401
---> 82 from .base import clone
83 from .utils._show_versions import show_versions
85 all = ['calibration', 'cluster', 'covariance', 'cross_decomposition',
86 'datasets', 'decomposition', 'dummy', 'ensemble', 'exceptions',
87 'experimental', 'externals', 'feature_extraction',
(...)
96 'clone', 'get_config', 'set_config', 'config_context',
97 'show_versions']

File ~/micromamba/envs/aggmap/lib/python3.8/site-packages/sklearn/base.py:20
17 import numpy as np
19 from . import version
---> 20 from .utils import _IS_32BIT
22 _DEFAULT_TAGS = {
23 'non_deterministic': False,
24 'requires_positive_X': False,
(...)
35 'binary_only': False,
36 'requires_fit': True}
39 def clone(estimator, safe=True):

File ~/micromamba/envs/aggmap/lib/python3.8/site-packages/sklearn/utils/init.py:24
22 from .murmurhash import murmurhash3_32
23 from .class_weight import compute_class_weight, compute_sample_weight
---> 24 from . import _joblib
25 from ..exceptions import DataConversionWarning
26 from .deprecation import deprecated

File ~/micromamba/envs/aggmap/lib/python3.8/site-packages/sklearn/utils/_joblib.py:7
4 _warnings.simplefilter("ignore")
5 # joblib imports may raise DeprecationWarning on certain Python
6 # versions
----> 7 import joblib
8 from joblib import logger
9 from joblib import dump, load

File ~/micromamba/envs/aggmap/lib/python3.8/site-packages/joblib/init.py:119
117 from .numpy_pickle import load
118 from .compressor import register_compressor
--> 119 from .parallel import Parallel
120 from .parallel import delayed
121 from .parallel import cpu_count

File ~/micromamba/envs/aggmap/lib/python3.8/site-packages/joblib/parallel.py:28
26 from .my_exceptions import TransportableException
27 from .disk import memstr_to_bytes
---> 28 from ._parallel_backends import (FallbackToBackend, MultiprocessingBackend,
29 ThreadingBackend, SequentialBackend,
30 LokyBackend)
31 from ._compat import _basestring
32 from .externals.cloudpickle import dumps, loads

File ~/micromamba/envs/aggmap/lib/python3.8/site-packages/joblib/_parallel_backends.py:22
20 from .pool import MemmappingPool
21 from multiprocessing.pool import ThreadPool
---> 22 from .executor import get_memmapping_executor
24 # Compat between concurrent.futures and multiprocessing TimeoutError
25 from multiprocessing import TimeoutError

File ~/micromamba/envs/aggmap/lib/python3.8/site-packages/joblib/executor.py:14
12 from .disk import delete_folder
13 from ._memmapping_reducer import get_memmapping_reducers
---> 14 from .externals.loky.reusable_executor import get_reusable_executor
17 _backend_args = None
20 def get_memmapping_executor(n_jobs, timeout=300, initializer=None, initargs=(),
21 **backend_args):

File ~/micromamba/envs/aggmap/lib/python3.8/site-packages/joblib/externals/loky/init.py:12
9 from ._base import ALL_COMPLETED, FIRST_COMPLETED, FIRST_EXCEPTION
11 from .backend.context import cpu_count
---> 12 from .backend.reduction import set_loky_pickler
13 from .reusable_executor import get_reusable_executor
14 from .cloudpickle_wrapper import wrap_non_picklable_objects

File ~/micromamba/envs/aggmap/lib/python3.8/site-packages/joblib/externals/loky/backend/reduction.py:125
123 # global variable to change the pickler behavior
124 try:
--> 125 from joblib.externals import cloudpickle # noqa: F401
126 DEFAULT_ENV = "cloudpickle"
127 except ImportError:
128 # If cloudpickle is not present, fallback to pickle

File ~/micromamba/envs/aggmap/lib/python3.8/site-packages/joblib/externals/cloudpickle/init.py:3
1 from future import absolute_import
----> 3 from .cloudpickle import *
5 version = '0.8.0'

File ~/micromamba/envs/aggmap/lib/python3.8/site-packages/joblib/externals/cloudpickle/cloudpickle.py:152
132 else:
133 return types.CodeType(
134 co.co_argcount,
135 co.co_kwonlyargcount,
(...)
148 (),
149 )
--> 152 _cell_set_template_code = _make_cell_set_template_code()
155 def cell_set(cell, value):
156 """Set the value of a closure cell.
157 """

File ~/micromamba/envs/aggmap/lib/python3.8/site-packages/joblib/externals/cloudpickle/cloudpickle.py:133, in _make_cell_set_template_code()
116 return types.CodeType(
117 co.co_argcount,
118 co.co_nlocals,
(...)
130 (),
131 )
132 else:
--> 133 return types.CodeType(
134 co.co_argcount,
135 co.co_kwonlyargcount,
136 co.co_nlocals,
137 co.co_stacksize,
138 co.co_flags,
139 co.co_code,
140 co.co_consts,
141 co.co_names,
142 co.co_varnames,
143 co.co_filename,
144 co.co_name,
145 co.co_firstlineno,
146 co.co_lnotab,
147 co.co_cellvars, # this is the trickery
148 (),
149 )

TypeError: an integer is required (got type bytes)

Error of 'pip install -r requirements.txt'

Collecting lapjv==1.3.1
  Downloading lapjv-1.3.1.tar.gz (6.6 kB)
    ERROR: Command errored out with exit status 1:
     command: /home/moonswing/anaconda3/envs/aggmap/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-e9m58w4c/lapjv_3d5d8d9aecf6488b96d92e81a7f82f69/setup.py'"'"'; __file__='"'"'/tmp/pip-install-e9m58w4c/lapjv_3d5d8d9aecf6488b96d92e81a7f82f69/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-f09t2kp3
         cwd: /tmp/pip-install-e9m58w4c/lapjv_3d5d8d9aecf6488b96d92e81a7f82f69/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-e9m58w4c/lapjv_3d5d8d9aecf6488b96d92e81a7f82f69/setup.py", line 3, in <module>
        import numpy
    ModuleNotFoundError: No module named 'numpy'
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/98/75/d64ba8523db4168646a8f8d74f104c4eaea820ad0464a6b41ff1e692840f/lapjv-1.3.1.tar.gz#sha256=e95d8b70e56e1c19509d92138660e53a19024c81170bebd40b075d9a93d3425d (from https://pypi.org/simple/lapjv/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement lapjv==1.3.1 (from versions: 1.0.0, 1.0.1, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.2.0, 1.3.0, 1.3.1, 1.3.10, 1.3.11, 1.3.12, 1.3.13, 1.3.14)
ERROR: No matching distribution found for lapjv==1.3.1

Error when fit aggmap

I used aggmap to transform my transcriptome data. The sample number of my data is 805 and the feature number is 17737. When I input my data to fit aggmap, ValueError occurred: Buffer has the wrong number of dimensions (expected 1, got 2). I later found that this error occurs when the number of features is greater than or equal to 4096 and it works when the number is less than 4096.
error1
error2

Error when using simply_explainer?

I'm using aggmap to solve a binary classification problem. I followed the step and code exactly as what is showing, but I was faced up an error when using simply_explainer function. Here is what the error shows. Could anyone help me with this issue?

ๅ›พ็‰‡

NameError: name 'data' is not defined for Windows aggmap

RemoteTraceback Traceback (most recent call last)
RemoteTraceback:
"""
Traceback (most recent call last):
File "C:\Users\AdminCOOP\anaconda3\envs\aggmap\lib\multiprocessing\pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "C:\Users\AdminCOOP\anaconda3\envs\aggmap\lib\site-packages\aggmap\utils\calculator.py", line 41, in _fuc
return _calculate(i1, i2)
File "C:\Users\AdminCOOP\anaconda3\envs\aggmap\lib\site-packages\aggmap\utils\calculator.py", line 23, in _calculate
x1 = data[:, i1]
NameError: name 'data' is not defined
"""

The above exception was the direct cause of the following exception:

NameError Traceback (most recent call last)
Cell In[1], line 11
8 dfy = pd.get_dummies(pd.Series(data.target))
10 # AggMap object definition, fitting, and saving
---> 11 mp = AggMap(dfx, metric = 'correlation')
12 mp.fit(cluster_channels=5, emb_method = 'umap', verbose=0)
13 mp.save('agg.mp')

File ~\anaconda3\envs\aggmap\lib\site-packages\aggmap\map.py:176, in AggMap.init(self, dfx, metric, by_scipy, n_cpus, info_distance)
174 self.info_distance = D.clip(0, np.inf)
175 else:
--> 176 D = calculator.pairwise_distance(dfx.values, n_cpus=n_cpus, method=metric)
177 D = np.nan_to_num(D,copy=False)
178 D_ = squareform(D)

File ~\anaconda3\envs\aggmap\lib\site-packages\aggmap\utils\calculator.py:67, in pairwise_distance(npydata, n_cpus, method)
65 N = data.shape[1]
66 lst = list(_yield_combinations(N))
---> 67 res = MultiProcessUnorderedBarRun(_fuc, lst, n_cpus=n_cpus)
68 dist_matrix = np.zeros(shape = (N,N))
69 for x,y,v in tqdm(res,ascii=True):

File ~\anaconda3\envs\aggmap\lib\site-packages\aggmap\utils\multiproc.py:111, in MultiProcessUnorderedBarRun(func, deal_list, n_cpus)
109 res_list = []
110 with pbar(total = len(deal_list), ascii=True) as pb:
--> 111 for res in p.imap_unordered(func, deal_list):
112 pb.update(1)
113 res_list.append(res)

File ~\anaconda3\envs\aggmap\lib\multiprocessing\pool.py:868, in IMapIterator.next(self, timeout)
866 if success:
867 return value
--> 868 raise value

NameError: name 'data' is not defined

Error when running 01_mnist_data.ipynb

When I run the script 01_mnist_data.ipynb in the folder paper,
I get the following error

File "bidd-aggmap-master\paper\00_mnist\correlation\aggmap\utils\calculator.py", line 23, in _calculate
    x1 = data[:, i1]
NameError: name 'data' is not defined

NameError                                 
Traceback (most recent call last)
<ipython-input-10-b1aa715419d2> in <module>
----> 1 mp_train = AggMap(x_train_df, metric = metric)
      2 mp_test = AggMap(x_test_df, metric = metric)
      3 
      4 mp_train.save(os.path.join(data_save_folder, 'train.mp'))
      5 mp_test.save(os.path.join(data_save_folder, 'test.mp'))

I just copy the aggmap folder into the working directory and modified the mnist_data_save_folder in config.py.
Could you please explain the error so that I can modify it myself?
Thanks.

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.