pinellolab / STREAM

STREAM: Single-cell Trajectories Reconstruction, Exploration And Mapping of single-cell data
http://stream.pinellolab.org
GNU Affero General Public License v3.0
173 stars 48 forks source link

Error in st.cal_qc #137

Open tianchen2019 opened 2 years ago

tianchen2019 commented 2 years ago

my code is : import stream as st adata=st.read(file_name='/outs/filtered_peak_bc_matrix/matrix.mtx', file_sample='/outs/filtered_peak_bc_matrix/barcodes.tsv', file_feature='/outs/filtered_peak_bc_matrix/peaks.bed', file_format='mtx',workdir='./resultatac') adata.var.index =adata.var[0].astype(str) + '' + adata.var[1].astype(str) +'_' + adata.var[2].astype(str) st.cal_qc(adata2,assay='atac') the error is : ValueError Traceback (most recent call last) /tmp/ipykernel_352024/3261032759.py in ----> 1 st.cal_qc(adata,assay='atac')

~/app/ENTER/envs/stream1/lib/python3.7/site-packages/stream/core.py in cal_qc(adata, expr_cutoff, assay) 438 439 n_counts = adata.X.sum(axis=0) --> 440 adata.var['n_counts'] = n_counts 441 n_cells = (adata.X>=expr_cutoff).sum(axis=0) 442 adata.var['n_cells'] = n_cells

~/app/ENTER/envs/stream1/lib/python3.7/site-packages/pandas/core/frame.py in setitem(self, key, value) 3610 else: 3611 # set column -> 3612 self._set_item(key, value) 3613 3614 def _setitem_slice(self, key: slice, value):

~/app/ENTER/envs/stream1/lib/python3.7/site-packages/pandas/core/frame.py in _set_item(self, key, value) 3782 ensure homogeneity. 3783 """ -> 3784 value = self._sanitize_column(value) 3785 3786 if (

~/app/ENTER/envs/stream1/lib/python3.7/site-packages/pandas/core/frame.py in _sanitize_column(self, value) 4507 4508 if is_list_like(value): -> 4509 com.require_length_match(value, self.index) 4510 return sanitize_array(value, self.index, copy=True, allow_2d=True) 4511

~/app/ENTER/envs/stream1/lib/python3.7/site-packages/pandas/core/common.py in require_length_match(data, index) 530 if len(data) != len(index): 531 raise ValueError( --> 532 "Length of values " 533 f"({len(data)}) " 534 "does not match length of index "

ValueError: Length of values (1) does not match length of index (156605) my package version is: image