You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm in the process of trying to use SAMap to look at sea lamprey (my own) and mouse (previously published) scRNA-seq data. I have been hitting a roadblock with the SAMap step, and I am not sure whether this is consequence of issues with my use of the gene name conversion functionality, or if it relates to my input file format.
I used RefSeq annotation files to map my reads in CellRanger and have created np.arrays for converting protein id's to gene names. From a cursory check, I feel relatively confident that my protein IDs in my conversion tables match the ones in my BLAST outputs.
In order to get my input scRNAseq data into the appropriate .h5ad format, I read my data into Seurat in RStudio and then used the following to export it as a .h5ad file:
File ~/miniconda3/envs/myenv/lib/python3.9/site-packages/scipy/sparse/_data.py:333, in _minmax_mixin.max(self, axis, out)
303 def max(self, axis=None, out=None):
304 """
305 Return the maximum of the matrix or maximum along an axis.
306 This takes all elements into account, not just the non-zero ones.
(...)
331
332 """
--> 333 return self._min_or_max(axis, out, np.maximum)
File ~/miniconda3/envs/myenv/lib/python3.9/site-packages/scipy/sparse/_data.py:217, in _minmax_mixin._min_or_max(self, axis, out, min_or_max)
214 axis += 2
216 if (axis == 0) or (axis == 1):
--> 217 return self._min_or_max_axis(axis, min_or_max)
218 else:
219 raise ValueError("axis out of range")
File ~/miniconda3/envs/myenv/lib/python3.9/site-packages/scipy/sparse/_data.py:168, in _minmax_mixin._min_or_max_axis(self, axis, min_or_max)
166 N = self.shape[axis]
167 if N == 0:
--> 168 raise ValueError("zero-size array to reduction operation")
169 M = self.shape[1 - axis]
170 idx_dtype = self._get_index_dtype(maxval=M)
ValueError: zero-size array to reduction operation`
It is not clear to me what this issue relates to - I saw that another poster (#114) had the same error and resolved it by preprocessing their transcript files for BLAST. As far as I can tell this should not be necessary provided appropriate use of the 'names' term in the SAMAP function.
I would really appreciate any suggestions about the likely origin of this error - thanks in advance!
The text was updated successfully, but these errors were encountered:
Hi,
I'm in the process of trying to use SAMap to look at sea lamprey (my own) and mouse (previously published) scRNA-seq data. I have been hitting a roadblock with the SAMap step, and I am not sure whether this is consequence of issues with my use of the gene name conversion functionality, or if it relates to my input file format.
I used RefSeq annotation files to map my reads in CellRanger and have created np.arrays for converting protein id's to gene names. From a cursory check, I feel relatively confident that my protein IDs in my conversion tables match the ones in my BLAST outputs.
In order to get my input scRNAseq data into the appropriate .h5ad format, I read my data into Seurat in RStudio and then used the following to export it as a .h5ad file:
`t24 <- Read10X(data.dir = "/Users/larabusby/Dropbox/Berkeley/jupyter/Analysis station/Remap lamprey/T24_RefSeq/outs/filtered_feature_bc_matrix")
t24 <- CreateSeuratObject(counts = t24, project = "t24", min.cells = 3, min.features = 200)
SaveH5Seurat(t24, filename = "t24_refseq.h5Seurat")
Convert("t24_refseq.h5Seurat", dest = "h5ad")
`
I have tried to run SAMap as follows:
`fn1 = 't24_refseq.h5ad'
fn2 = 'e95.h5ad'
filenames = {'pm':fn1,'mm':fn2}
n1 = np.array(Pm_attrib_Prot_correct)
n2 = np.array(Mm_attrib_Prot_correct)
sm = SAMAP(
filenames,
f_maps = 'maps/fixed/',
names = {'pm' : n1, 'mm' : n2})`
The error that I get is as follows:
` Traceback (most recent call last)
Cell In[277], line 4
1 n1 = np.array(Pm_attrib_Prot_correct)
2 n2 = np.array(Mm_attrib_Prot_correct)
----> 4 sm = SAMAP(
5 filenames,
6 f_maps = 'maps/fixed/',
7 names = {'pm' : n1, 'mm' : n2})
File ~/miniconda3/envs/myenv/lib/python3.9/site-packages/samap/mapping.py:149, in SAMAP.init(self, sams, f_maps, names, keys, resolutions, gnnm, save_processed, eval_thr)
144 if names is not None:
145 gnnm, gns_dict, gns = _coarsen_blast_graph(
146 gnnm, gns, names
147 )
--> 149 gnnm = _filter_gnnm(gnnm, thr=0.25)
150 else:
151 gnnm, gns, gns_dict = gnnm
File ~/miniconda3/envs/myenv/lib/python3.9/site-packages/samap/mapping.py:1362, in _filter_gnnm(gnnm, thr)
1360 def _filter_gnnm(gnnm, thr=0.25):
1361 x, y = gnnm.nonzero()
-> 1362 mas = gnnm.max(1).A.flatten()
1363 gnnm4 = gnnm.copy()
1364 gnnm4.data[gnnm4[x, y].A.flatten() < mas[x] * thr] = 0
File ~/miniconda3/envs/myenv/lib/python3.9/site-packages/scipy/sparse/_data.py:333, in _minmax_mixin.max(self, axis, out)
303 def max(self, axis=None, out=None):
304 """
305 Return the maximum of the matrix or maximum along an axis.
306 This takes all elements into account, not just the non-zero ones.
(...)
331
332 """
--> 333 return self._min_or_max(axis, out, np.maximum)
File ~/miniconda3/envs/myenv/lib/python3.9/site-packages/scipy/sparse/_data.py:217, in _minmax_mixin._min_or_max(self, axis, out, min_or_max)
214 axis += 2
216 if (axis == 0) or (axis == 1):
--> 217 return self._min_or_max_axis(axis, min_or_max)
218 else:
219 raise ValueError("axis out of range")
File ~/miniconda3/envs/myenv/lib/python3.9/site-packages/scipy/sparse/_data.py:168, in _minmax_mixin._min_or_max_axis(self, axis, min_or_max)
166 N = self.shape[axis]
167 if N == 0:
--> 168 raise ValueError("zero-size array to reduction operation")
169 M = self.shape[1 - axis]
170 idx_dtype = self._get_index_dtype(maxval=M)
ValueError: zero-size array to reduction operation`
It is not clear to me what this issue relates to - I saw that another poster (#114) had the same error and resolved it by preprocessing their transcript files for BLAST. As far as I can tell this should not be necessary provided appropriate use of the 'names' term in the SAMAP function.
I would really appreciate any suggestions about the likely origin of this error - thanks in advance!
The text was updated successfully, but these errors were encountered: