-
Notifications
You must be signed in to change notification settings - Fork 25
Description
When I ran this line of code, this error kept popping up. I checked my maps file and input file h5ad file format, there was no problem.
sm.run(pairwise=True)
samap = sm.samap # SAM object with three species stitched together
TypingError Traceback (most recent call last)
Cell In [49], line 1
----> 1 sm.run(pairwise=True)
2 samap = sm.samap # SAM object with three species stitched together
File /opt/conda/lib/python3.8/site-packages/samap/mapping.py:296, in SAMAP.run(self, NUMITERS, NHS, crossK, N_GENE_CHUNKS, umap, ncpus, hom_edge_thr, hom_edge_mode, scale_edges_by_corr, neigh_from_keys, pairwise)
292 neigh_from_keys[sid] = False
294 start_time = time.time()
--> 296 smap.run(
297 NUMITERS=NUMITERS,
298 NHS=NHS,
299 K=crossK,
300 NCLUSTERS=N_GENE_CHUNKS,
301 ncpus=ncpus,
302 THR=hom_edge_thr,
303 corr_mode=hom_edge_mode,
304 scale_edges_by_corr = scale_edges_by_corr,
305 neigh_from_keys=neigh_from_keys,
306 pairwise=pairwise
307 )
308 samap = smap.final_sam
309 self.samap = samap
File /opt/conda/lib/python3.8/site-packages/samap/mapping.py:726, in _Samap_Iter.run(self, NUMITERS, NHS, K, corr_mode, NCLUSTERS, scale_edges_by_corr, THR, neigh_from_keys, pairwise, ncpus)
724 print("Calculating gene-gene correlations in the homology graph...")
725 self.samap = sam4
--> 726 gnnmu = self.refine_homology_graph(ncpus = ncpus, NCLUSTERS = NCLUSTERS, THR=THR, corr_mode=corr_mode)
728 self.GNNMS_corr.append(gnnmu)
729 self.gnnmu = gnnmu
File /opt/conda/lib/python3.8/site-packages/samap/mapping.py:653, in _Samap_Iter.refine_homology_graph(self, NCLUSTERS, ncpus, THR, corr_mode, wscale)
650 keys = self.keys
651 sam4 = self.samap
--> 653 gnnmu = _refine_corr(
654 sams,
655 sam4,
656 gnnm,
657 gns_dict,
658 THR=THR,
659 use_seq=False,
660 T1=0,
661 NCLUSTERS=NCLUSTERS,
662 ncpus=ncpus,
663 corr_mode=corr_mode,
664 wscale=wscale
665 )
666 return gnnmu
File /opt/conda/lib/python3.8/site-packages/samap/mapping.py:1004, in _refine_corr(sams, st, gnnm, gns_dict, corr_mode, THR, use_seq, T1, NCLUSTERS, ncpus, wscale)
1001 gn = gns_dict[sid]
1002 gns_dict_sub[sid] = gn[np.in1d(gn,gnsub)]
-> 1004 gnnm2_sub = _refine_corr_parallel(
1005 sams,
1006 st,
1007 gnnm_sub,
1008 gns_dict_sub,
1009 corr_mode=corr_mode,
1010 THR=THR,
1011 use_seq=use_seq,
1012 T1=T1,
1013 ncpus=ncpus,
1014 wscale=wscale
1015 )
1016 GNNMSUBS.append(gnnm2_sub)
1017 GNSUBS.append(gnsub)
File /opt/conda/lib/python3.8/site-packages/samap/mapping.py:1558, in _refine_corr_parallel(sams, st, gnnm, gns_dict, corr_mode, THR, use_seq, T1, ncpus, wscale)
1555 for sid in sidss:
1556 sixs.append(np.where(species==sid)[0])
-> 1558 vals = _refine_corr_kernel(p,ps,sidss,sixs,Xavg.indptr,Xavg.indices,Xavg.data,Xavg.shape[0], corr_mode)
1559 vals[np.isnan(vals)]=0
1561 CORR = dict(zip(to_vn(np.vstack((gnO[p[:,0]],gnO[p[:,1]])).T),vals))
File /opt/conda/lib/python3.8/site-packages/numba/core/dispatcher.py:468, in _DispatcherBase._compile_for_args(self, *args, **kws)
464 msg = (f"{str(e).rstrip()} \n\nThis error may have been caused "
465 f"by the following argument(s):\n{args_str}\n")
466 e.patch_message(msg)
--> 468 error_rewrite(e, 'typing')
469 except errors.UnsupportedError as e:
470 # Something unsupported is present in the user code, add help info
471 error_rewrite(e, 'unsupported_error')
File /opt/conda/lib/python3.8/site-packages/numba/core/dispatcher.py:409, in _DispatcherBase._compile_for_args..error_rewrite(e, issue_type)
407 raise e
408 else:
--> 409 raise e.with_traceback(None)
TypingError: Failed in nopython mode pipeline (step: nopython frontend)
Failed in nopython mode pipeline (step: native lowering)
Cannot cast float64 to [unichr x 2]: double %"arg.key"
During: lowering "castedkey = call $2load_global.0(key, $6load_deref.2, func=$2load_global.0, args=[Var(key, dictobject.py:757), Var($6load_deref.2, dictobject.py:757)], kws=(), vararg=None, varkwarg=None, target=None)" at /opt/conda/lib/python3.8/site-packages/numba/typed/dictobject.py (757)
During: typing of intrinsic-call at /opt/conda/lib/python3.8/site-packages/samap/mapping.py (1471)
File "../../opt/conda/lib/python3.8/site-packages/samap/mapping.py", line 1471:
def _refine_corr_kernel(p, ps, sids, sixs, indptr,indices,data, n, corr_mode):
a1, a2 = ps1[j], ps2[j]
ix1 = d[a1]
^