Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: _nnls.nnls() missing required argument 'n' (pos 3) #80

Open
andreyurch opened this issue Sep 19, 2024 · 0 comments
Open

TypeError: _nnls.nnls() missing required argument 'n' (pos 3) #80

andreyurch opened this issue Sep 19, 2024 · 0 comments

Comments

@andreyurch
Copy link

X = pd.read_csv('simulated_example.Skin.Melanoma.X.csv', index_col=0)
X.head()

     SP124323  SP124281  SP124389  SP124362  SP124394  SP124380  SP124399  SP124311  SP124434  SP124428  SP124298  SP124431  ...  SP124391  SP124264  SP124271  SP124336  SP124441  SP124291  SP82471  SP124353  SP113197  SP83027  SP124351  SP124458

Type ...
A[C>A]A 60 49 75 129 54 187 223 278 153 184 387 189 ... 106 279 296 163 265 84 101 41 62 62 12 101
A[C>A]C 45 31 57 49 27 94 165 148 98 78 99 86 ... 84 190 198 86 148 59 68 38 44 56 13 37
A[C>A]G 9 4 9 23 15 40 37 38 31 23 49 22 ... 12 17 29 20 31 9 10 2 9 6 4 11
A[C>A]T 32 26 40 86 45 107 150 132 93 97 163 97 ... 61 156 139 81 140 48 53 33 39 36 12 44
C[C>A]A 823 789 60 120 119 145 168 150 92 170 242 93 ... 314 340 271 557 315 86 166 145 120 112 23 79

[5 rows x 107 columns]

model = musical.DenovoSig(X,
... min_n_components=1, # Minimum number of signatures to test
... max_n_components=6, # Maximum number of signatures to test
... init='random', # Initialization method
... method='mvnmf', # mvnmf or nmf
... n_replicates=20, # Number of mvnmf/nmf replicates to run per n_components
... ncpu=38, # Number of CPUs to use
... max_iter=100000, # Maximum number of iterations for each mvnmf/nmf run
... bootstrap=True, # Whether or not to bootstrap X for each run
... tol=1e-8, # Tolerance for claiming convergence of mvnmf/nmf
... verbose=1, # Verbosity of output
... normalize_X=False # Whether or not to L1 normalize each sample in X before mvnmf/nmf
... )
model.fit()
Extracting signatures for n_components = 1..................

multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/mnt/beegfs/userdata/id12439/APP/anaconda3/lib/python3.7/multiprocessing/pool.py", line 121, in worker
result = (True, func(*args, **kwds))
File "/mnt/beegfs/userdata/id12439/APP/anaconda3/lib/python3.7/multiprocessing/pool.py", line 44, in mapstar
return list(map(*args))
File "/mnt/beegfs/userdata/id12439/APP/anaconda3/lib/python3.7/site-packages/musical/mvnmf.py", line 406, in _job
model.fit()
File "/mnt/beegfs/userdata/id12439/APP/anaconda3/lib/python3.7/site-packages/musical/mvnmf.py", line 305, in fit
H = nnls(self.X, W)
File "/mnt/beegfs/userdata/id12439/APP/anaconda3/lib/python3.7/site-packages/musical/nnls.py", line 11, in nnls
h, _ = sp.optimize.nnls(W, x)
TypeError: _nnls.nnls() missing required argument 'n' (pos 3)
"""

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

Traceback (most recent call last):
File "", line 1, in
File "/mnt/beegfs/userdata/id12439/APP/anaconda3/lib/python3.7/site-packages/musical/denovo.py", line 869, in fit
self._run_jobs()
File "/mnt/beegfs/userdata/id12439/APP/anaconda3/lib/python3.7/site-packages/musical/denovo.py", line 750, in _run_jobs
model.fit()
File "/mnt/beegfs/userdata/id12439/APP/anaconda3/lib/python3.7/site-packages/musical/mvnmf.py", line 443, in fit
models = workers.map(self._job, list(self.lambda_tilde_grid))
File "/mnt/beegfs/userdata/id12439/APP/anaconda3/lib/python3.7/multiprocessing/pool.py", line 268, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "/mnt/beegfs/userdata/id12439/APP/anaconda3/lib/python3.7/multiprocessing/pool.py", line 657, in get
raise self._value
TypeError: _nnls.nnls() missing required argument 'n' (pos 3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant