cellphonedb icon indicating copy to clipboard operation
cellphonedb copied to clipboard

Pvalue Threshold Error

Open Pedramto89 opened this issue 4 years ago • 3 comments

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

Pedramto89 avatar Jul 30 '21 16:07 Pedramto89

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

prete avatar Jul 30 '21 19:07 prete

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.

Pedramto89 avatar Jul 30 '21 23:07 Pedramto89

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:

  • --rows: File with a list of rows to plot, one per line
  • --columns: File with a list of columns to plot, one per line

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.

prete avatar Aug 02 '21 09:08 prete