YosefLab / Compass

In-Silico Modeling of Metabolic Heterogeneity using Single-Cell Transcriptomes
BSD 3-Clause "New" or "Revised" License
96 stars 29 forks source link

ValueError("No objects to concatenate") #45

Open sunyx25 opened 3 years ago

sunyx25 commented 3 years ago

I have been trying to use compass but I get the following error, but given my limited knowledge I'm not able to find the issue.

This is my script

compass --data expression.tsv --num-processes 10 --species homo_sapiens

And here is the error:

Evaluating Reaction Penalties... Traceback (most recent call last): File "/home/date/anaconda3/envs/py2/bin/compass", line 33, in <module> sys.exit(load_entry_point('compass-sc==0.9.9.5', 'console_scripts', 'compass')()) File "/home/date/anaconda3/envs/py2/lib/python3.6/site-packages/compass_sc-0.9.9.5-py3.6-linux-x86_64.egg/compass/main.py", line 548, in entry args) File "/home/date/anaconda3/envs/py2/lib/python3.6/site-packages/compass_sc-0.9.9.5-py3.6-linux-x86_64.egg/compass/compass/penalties.py", line 101, in eval_reaction_penalties input_knn=input_knn, output_knn=output_knn, latent_input=latent_input) File "/home/date/anaconda3/envs/py2/lib/python3.6/site-packages/compass_sc-0.9.9.5-py3.6-linux-x86_64.egg/compass/compass/penalties.py", line 164, in eval_reaction_penalties_shared reaction_expression = pd.concat(reaction_expression, axis=1) File "/home/date/anaconda3/envs/py2/lib/python3.6/site-packages/pandas/core/reshape/concat.py", line 284, in concat sort=sort, File "/home/date/anaconda3/envs/py2/lib/python3.6/site-packages/pandas/core/reshape/concat.py", line 331, in __init__ raise ValueError("No objects to concatenate") ValueError: No objects to concatenate

schel337 commented 3 years ago

Is this on the example dataset?

I am not certain why this error would be occurring, but it looks like the expression dataframe in pandas is somehow not getting iterated through correctly in the loop on line 157 of penalties.py. I would recommend trying to parse the file in python using pandas.read_csv("expression.tsv", sep="\t", index_col=0) and see if the data is being parsed correctly. If it is not, then the data might need to be reformatted and pandas might need to be upgraded.

If you can share the pandas version that might also help.

sunyx25 commented 3 years ago

Thanks for your reply! 1) I used the example dataset (expression.tsv) on github as the input file for compass , and i got the error above. However, i successfully ran compass when put the expression.tsv into the folder with knn.tsv / knn_distance.tsv/ random_latent.tsv, which indicated that expression.tsv may not be used as the input file alone.

2) I got the same error as #issue40 when i used the --data.mtx format, and the input matrix i used was the mtx file i got from the GEO. However, when I used the command 'expr <- GetAssayData(scRNA , assay= "RNA", slot = "data")' from 'Seurat' . And then used the commamd 'wtriteMM' from R package 'Matrix' to output the mtx file(expr), the problem above did not occur.

schel337 commented 3 years ago

I'm glad it sounds like it works after some workarounds, but I'm not sure what's going on as I just verified I can run Compass on the example data using a fresh python 3.6 conda environment with Cplex 12.10. I've been running it in new empty directories generally for each run.

  1. Those files should not be relevant for the command you showed above, the main thing to be wary of is having previous Compass results in the same directory but there is a message that will appear for that. I would try making a new directory for each Compass run and see if that fixes it, as that is usually how I run Compass.

  2. That sounds potentially useful to see if there are other formats for gene data in matrix market format / mtx. Ideally if there are multiple matrix market formats I would be able to find something to parse them all. Is there a specific GEO dataset you were using?

naveena-ujagar commented 1 year ago

Hi @sunyx25

Could explain in a bit more detail how you your error #2, similar to issue #40, because I am getting the same error. I posted my error message and log file contents on issue#40 if you want to refer to that. This is my first time coding so I'm a bit lost.

Thanks

cjrodriguez98 commented 9 months ago

Hey, I am getting this error and do not understand what is going on or if there is a solution.

Thanks!