Teichlab / cellphonedb

MIT License
342 stars 105 forks source link

Pvalue Threshold Error #339

Open Pedramto89 opened 3 years ago

Pedramto89 commented 3 years ago

I want to put a threshold for CFDB results. For example greater and/or equal to 0.05. What's the command: Is sth like this:

ellphonedb method statistical_analysis meta_subtype2new.txt counts_subtype2new.txt --counts-data=hgnc_symbol --pvalue>0.05

Even I tried this, but did not work: Again I got the same error. ellphonedb method statistical_analysis meta_subtype2new.txt counts_subtype2new.txt --counts-data=hgnc_symbol --pvalue>=0.05

When I use the above commands, I get the following error: Error: --pvalue option requires an argument

prete commented 3 years ago

Hi @Pedramto89 thank you for using CellPhoneDB. The P-value threshold option (--pvalue) for statistical_analysis method takes a number and uses it to filter out significant_means output. The comparison is done internally, you don't have to provide the >= or >, only the number. It's a strict comparison ( value > pvalue ) that sets NaN to all those values.

You should use it like this:

cellphonedb method statistical_analysis meta_subtype2new.txt counts_subtype2new.txt --counts-data hgnc_symbol --pvalue 0.05
Pedramto89 commented 3 years ago

Screenshot from 2021-07-30 17-31-07

Thank you @prete . I got the results but I expected only to get circles with diameter 2 and 3 as I set the pvalue to 0.05. But, there are many other smaller circles. Overall, I am not comfortable with legends and their inference.

prete commented 3 years ago

Hi @Pedramto89 the pvalue filter only adds NaN to the filtered values, but the interactions are still there in the output file. If you see a row/column filled with 0 values (smallest dot) that you don't want to plot them you need to use the rows and columns options when invoking cellphonedb plot dot_plot:

If that's not suitable for you, perhaps you could elaborate a bit more on what questions you want the data to answer for you and what legends/interface would suit you best. We can use that information to improve.