Error while using sc.pp.calculate_qc_metrics

Hi, I’m interested in your helpful tool. I’m studying to use your tool follow your tutotial. The data I use is also your tutorial suggested. But in the process of preprocessing and clustering 3K PBMCs, when I use sc.pp.calculate_qc_metrics: sc.pp.calculate_qc_metrics(adata, qc_vars=['mt'], percent_top=None, log1p=False, inplace=True), I encounted an error shown as below:


ValueError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_28872/2443974508.py in
----> 1 sc.pp.calculate_qc_metrics(adata, qc_vars=[‘mt’], percent_top=None, log1p=False, inplace=True)

~\anaconda3\envs\stlearn\lib\site-packages\scanpy\preprocessing_qc.py in calculate_qc_metrics(adata, expr_type, var_type, qc_vars, percent_top, layer, use_raw, inplace, log1p, parallel)
286 X.eliminate_zeros()
287
→ 288 obs_metrics = describe_obs(
289 adata,
290 expr_type=expr_type,

~\anaconda3\envs\stlearn\lib\site-packages\scanpy\preprocessing_qc.py in describe_obs(adata, expr_type, var_type, qc_vars, percent_top, layer, use_raw, log1p, inplace, X, parallel)
126 )
127 obs_metrics[f"pct_{expr_type}{qc_var}"] = (
→ 128 obs_metrics[f"total
{expr_type}{qc_var}"]
129 / obs_metrics[f"total
{expr_type}"]
130 * 100

~\anaconda3\envs\stlearn\lib\site-packages\pandas\core\ops\common.py in new_method(self, other)
67 other = item_from_zerodim(other)
68
—> 69 return method(self, other)
70
71 return new_method

~\anaconda3\envs\stlearn\lib\site-packages\pandas\core\arraylike.py in truediv(self, other)
114 @unpack_zerodim_and_defer(“truediv”)
115 def truediv(self, other):
→ 116 return self._arith_method(other, operator.truediv)
117
118 @unpack_zerodim_and_defer(“rtruediv”)

~\anaconda3\envs\stlearn\lib\site-packages\pandas\core\series.py in _arith_method(self, other, op)
5526 result = ops.arithmetic_op(lvalues, rvalues, op)
5527
→ 5528 return self._construct_result(result, name=res_name)
5529
5530

~\anaconda3\envs\stlearn\lib\site-packages\pandas\core\series.py in _construct_result(self, result, name)
2943 # We do not pass dtype to ensure that the Series constructor
2944 # does inference in the case where result has object-dtype.
→ 2945 out = self._constructor(result, index=self.index)
2946 out = out.finalize(self)
2947

~\anaconda3\envs\stlearn\lib\site-packages\pandas\core\series.py in init(self, data, index, dtype, name, copy, fastpath)
428 index = ibase.default_index(len(data))
429 elif is_list_like(data):
→ 430 com.require_length_match(data, index)
431
432 # create/copy the manager

~\anaconda3\envs\stlearn\lib\site-packages\pandas\core\common.py in require_length_match(data, index)
529 “”"
530 if len(data) != len(index):
→ 531 raise ValueError(
532 “Length of values "
533 f”({len(data)}) "

ValueError: Length of values (1) does not match length of index (2700)

can you give me some advices? Thanks in advance.