Skip to content

Several Issues When Running CCCvelo #1

@Higashi0505

Description

@Higashi0505

While running cccvelo following the official scripts, I encountered multiple blocking issues related to missing scripts, missing databases, undocumented dependencies, hard-coded absolute paths, and inconsistent internal data structure assumptions.
These issues currently prevent the LR–TF workflow from running successfully.

1.Missing R script referenced in SelectLRTG.R (line 15)

source('/home/yll/velocity_methods/01_analysis/apply_in_stereo_cortex/R/create_multilayer_network.R')
No alternative path or implementation is found.

2.Missing Databases.rds and no generation method

Databases <- readRDS('/home/yll/velocity_methods/01_analysis/prior_knowledge/Databases.rds')
No code or documentation explains how this file is generated or what its expected structure is

3.Missing jsonlite import for write_json() in SelectLRTG.R (line 56)

write_json(TGs_list, path=paste0(output_fpath,"TGs_list.json"), pretty = TRUE, auto_unbox = TRUE)
The function write_json() is used but jsonlite is never imported

### 4.Expression matrices need transposition but not documented in SelectLRTG.R (line 61)
df_count <- as.matrix(GetAssayData(ser_obj, "data", "Spatial"))
rownames(exprMat.Impute) = rownames(df_count)
df_count = df_count[rownames(exprMat.Impute),]

df_count = t(df_count)
exprMat.Impute <- as.matrix(exprMat.Impute)
exprMat.Impute = t(exprMat.Impute)
adata = ReadData(
count_file='raw_expression_mtx.csv',
imput_file='imputation_expression_mtx.csv',
meta_file='cell_meta.csv',
loca_file='cell_location.csv'
)


ValueError Traceback (most recent call last)
Cell In[11], line 14
7 data_files = {
8 'count_file': 'raw_expression_mtx.csv',
9 'imput_file': 'imputation_expression_mtx.csv',
10 'meta_file': 'cell_meta.csv',
11 'loca_file': 'cell_location.csv'
12 }
13 paths = {key: os.path.join(input_dir, fname) for key, fname in data_files.items()}
---> 14 adata = ReadData(**paths)

File ~/python/cccvelo/models/Input_prepare.py:40, in ReadData(count_file, imput_file, meta_file, loca_file)
38 adata.obs['Cluster'] = df_meta['Cluster'].values
39 adata.obsm['spatial'] = df_loca.values.astype(np.float64)
---> 40 adata.layers['Imputate'] = df_imput.values
41 return adata

File ~/miniconda3/envs/cccvelo/lib/python3.8/site-packages/anndata/_core/aligned_mapping.py:181, in AlignedActualMixin.setitem(self, key, value)
180 def setitem(self, key: str, value: V):
--> 181 value = self._validate_value(value, key)
182 self._data[key] = value

File ~/miniconda3/envs/cccvelo/lib/python3.8/site-packages/anndata/_core/aligned_mapping.py:77, in AlignedMapping._validate_value(self, val, key)
72 raise ValueError(
73 f"The AwkwardArray is of variable length in dimension {i}.",
74 f"Try ak.to_regular(array, {i}) before including the array in AnnData",
75 )
76 else:
---> 77 raise ValueError(
78 f"Value passed for key {key!r} is of incorrect shape. "
79 f"Values of {self.attrname} must match dimensions "
80 f"{self.axes} of parent. Value had shape {actual_shape} while "
81 f"it should have had {right_shape}."
82 )
84 if not self._allow_df and isinstance(val, pd.DataFrame):
85 name = self.attrname.title().rstrip("s")

ValueError: Value passed for key 'Imputate' is of incorrect shape. Values of layers must match dimensions (0, 1) of parent. Value had shape (15131, 3988) while it should have had (3988, 15131).

The output matrices must be transposed before being read into Python, otherwise dimensions do not match.

5.Hard-coded absolute paths in RunMLnet.py, and the name of LigRec.DB should be corrected as LigRecDB (line 45)

if Databases is None:
print("Load default database")
LigRecDB = pd.read_csv("./data/Database/LigRec.DB.csv")
RecTFDB = pd.read_csv("./data/Database/RecTFDB.csv")
TFTGDB = pd.read_csv("./data/Database/TFTGDB.csv")
Databases = {
'LigRecDB': LigRecDB,
'RecTFDB': RecTFDB,
'TFTGDB': TFTGDB
}

6.Inconsistent assumptions about mulNetList structure in cccvelo notebook code (critical)

When running:
loop_calculate_LRTF_allscore(
adata=adata,
ex_mulnetlist=ex_mulnetlist,
receiver_celltype="CAF_niche",
diff_LigRecDB_path='./data/Database/diff_LigRecDB.csv',
cont_LigRecDB_path='./data/Database/cont_LigRecDB.csv',
OutputDir="."
)


ValueError Traceback (most recent call last)
Cell In[10], line 1
----> 1 loop_calculate_LRTF_allscore(
2 adata=adata,
3 ex_mulnetlist=ex_mulnetlist,
4 receiver_celltype="CAF_niche",
5 diff_LigRecDB_path='./data/Database/diff_LigRecDB.csv',
6 cont_LigRecDB_path='./data/Database/cont_LigRecDB.csv',
7 OutputDir="."
8 )
10 # Processing LR–TF signaling scores
11 TFLR_all_score = get_TFLR_allactivity(
12 mulNetList=ex_mulnetlist,
13 OutputDir="."
14 )

File ~/python/cccvelo/models/calculateLRscore.py:77, in loop_calculate_LRTF_allscore(adata, ex_mulnetlist, receiver_celltype, diff_LigRecDB_path, cont_LigRecDB_path, OutputDir)
74 Receiver = receiver
75 Sender = None
---> 77 LRTF_allscore = calculate_LRTF_allscore(
78 adata=adata,
79 mulNetList=ex_mulnetlist,
80 diff_LigRecDB=diff_LigRecDB,
81 cont_LigRecDB=cont_LigRecDB,
82 Receiver=Receiver,
83 Sender=Sender,
84 )
86 if len(LRTF_allscore['LRs_score']) != 0:
87 filename = os.path.join(wd_model, f"LRTF_allscore_TME-{Receiver}.pkl")

File ~/python/cccvelo/models/calculateLRscore.py:129, in calculate_LRTF_allscore(adata, mulNetList, diff_LigRecDB, cont_LigRecDB, Receiver, Sender, group, far_ct, close_ct, downsample)
126 merged = ligrec.merge(rectf, on='Receptor').merge(tftg, on='TF')[['Ligand', 'Receptor', 'TF', 'Target']]
127 mulNet_tab.append(merged.sort_values(by=['Ligand', 'Receptor']).reset_index(drop=True))
--> 129 mulNet_tab = pd.concat(mulNet_tab, ignore_index=True)
131 diff_mulNet_tab = mulNet_tab[
132 mulNet_tab['Ligand'].isin(diff_LigRecDB['source']) & mulNet_tab['Receptor'].isin(diff_LigRecDB['target'])
133 ].copy()
134 diff_LRTF_allscore = calculate_diff_LRTF_score(exprMat, distMat, annoMat, Receiver,Sender=Sender,mulNet_tab=diff_mulNet_tab,
135 group=group,far_ct=far_ct,close_ct=close_ct, downsample=downsample)

File ~/miniconda3/envs/cccvelo/lib/python3.8/site-packages/pandas/core/reshape/concat.py:372, in concat(objs, axis, join, ignore_index, keys, levels, names, verify_integrity, sort, copy)
369 elif copy and using_copy_on_write():
370 copy = False
--> 372 op = _Concatenator(
373 objs,
374 axis=axis,
375 ignore_index=ignore_index,
376 join=join,
377 keys=keys,
378 levels=levels,
379 names=names,
380 verify_integrity=verify_integrity,
381 copy=copy,
382 sort=sort,
383 )
385 return op.get_result()

File ~/miniconda3/envs/cccvelo/lib/python3.8/site-packages/pandas/core/reshape/concat.py:429, in _Concatenator.init(self, objs, axis, join, keys, levels, names, ignore_index, verify_integrity, copy, sort)
426 objs = list(objs)
428 if len(objs) == 0:
--> 429 raise ValueError("No objects to concatenate")
431 if keys is None:
432 objs = list(com.not_none(*objs))

ValueError: No objects to concatenate

pip list

Package Version


anndata 0.9.2
asttokens 3.0.0
backcall 0.2.0
click 8.1.7
cmake 4.2.1
colorama 0.4.6
comm 0.2.2
contourpy 1.1.1
cycler 0.12.1
debugpy 1.8.14
decorator 5.2.1
dfply 0.3.3
executing 2.2.0
filelock 3.15.4
fonttools 4.53.0
get-annotations 0.1.2
h5py 3.11.0
importlib_metadata 8.0.0
importlib_resources 6.4.0
ipykernel 6.29.5
ipython 8.12.3
jedi 0.19.2
Jinja2 3.1.4
joblib 1.4.2
jupyter_client 8.6.3
jupyter_core 5.8.1
kiwisolver 1.4.5
lisaanalysistools 1.0.17
lit 18.1.8
llvmlite 0.41.1
loompy 3.0.7
MarkupSafe 2.1.5
matplotlib 3.7.5
matplotlib-inline 0.1.7
mpmath 1.3.0
natsort 8.4.0
nest-asyncio 1.6.0
networkx 3.1
numba 0.58.1
numpy 1.24.4
numpy_groupies 0.9.22
nvidia-cublas-cu11 11.10.3.66
nvidia-cuda-cupti-cu11 11.7.101
nvidia-cuda-nvrtc-cu11 11.7.99
nvidia-cuda-runtime-cu11 11.7.99
nvidia-cudnn-cu11 8.5.0.96
nvidia-cufft-cu11 10.9.0.58
nvidia-curand-cu11 10.2.10.91
nvidia-cusolver-cu11 11.4.0.1
nvidia-cusparse-cu11 11.7.4.91
nvidia-nccl-cu11 2.14.3
nvidia-nvtx-cu11 11.7.91
packaging 24.1
pandas 2.0.3
parso 0.8.4
patsy 0.5.6
pexpect 4.9.0
pickleshare 0.7.5
pillow 10.4.0
pip 23.2.1
platformdirs 4.3.6
progressbar2 4.5.0
prompt_toolkit 3.0.51
psutil 6.0.0
ptyprocess 0.7.0
pure_eval 0.2.3
pygam 0.9.1
Pygments 2.19.2
pynndescent 0.5.13
pyparsing 3.1.2
python-dateutil 2.9.0.post0
python-utils 3.8.2
pytz 2024.1
pyzmq 27.0.0
scanpy 1.9.8
scikit-learn 1.3.2
scipy 1.10.1
scvelo 0.3.2
seaborn 0.13.2
session_info 1.0.0
setuptools 68.2.0
six 1.16.0
stack-data 0.6.3
statsmodels 0.14.1
stdlib-list 0.10.0
sympy 1.12.1
threadpoolctl 3.5.0
torch 2.0.1
tornado 6.4.2
tqdm 4.66.4
traitlets 5.14.3
triton 2.0.0
typing_extensions 4.12.2
tzdata 2024.1
umap-learn 0.5.6
wcwidth 0.2.13
wheel 0.41.2
zipp 3.19.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions