dviraran / xCell

Cell types enrichment analysis
180 stars 60 forks source link

Different results between online analysis and R software #65

Open YKH810325 opened 2 years ago

YKH810325 commented 2 years ago

Dear all, I face a problem that reveals the different results between online server and R software.

The results of online servser: <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">

  | X868N | X879N | X888N | X1268N | X868K | X879K | X888K | X1268K | X1866_1 -- | -- | -- | -- | -- | -- | -- | -- | -- | -- aDC | 382.8578 | 40.43974 | 178.9125 | 742.0114 | 1394.624 | 1230.12 | 1115.967 | 1867.441 | 52.3757 Adipocytes | 2247.73 | 1700.62 | 629.2453 | 1800.12 | 0 | 838.5027 | 216.2571 | 570.4954 | 2044.795 Astrocytes | 534.5511 | 126.4531 | 445.6113 | 347.6849 | 979.0361 | 589.6684 | 382.6429 | 596.2315 | 688.1574 Basophils | 700.9111 | 627.7844 | 382.2197 | 484.5543 | 609.3579 | 626.2382 | 350.6588 | 234.7838 | 479.8278 B-cells | 151.546 | 74.85261 | 102.2584 | 167.2138 | 651.2887 | 228.27 | 413.6087 | 1184.226 | 41.58247

The results of R software (I perform "xCellAnalysis" function.): <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">

  | X868N | X879N | X888N | X1268N | X868K | X879K | X888K | X1268K | X1866_1 -- | -- | -- | -- | -- | -- | -- | -- | -- | -- aDC | 4.63E-21 | 1.67E-18 | 4.64E-21 | 0.019692 | 0.110267 | 0.075325 | 0.051219 | 0.18708 | 0 Adipocytes | 0.02524 | 0.010217 | 0 | 0.010961 | 0 | 2.24E-21 | 0 | 0 | 0.014607 Astrocytes | 0 | 0 | 0 | 0 | 2.11E-18 | 0 | 3.24E-18 | 0 | 6.11E-20 Basophils | 0.090306 | 0.075668 | 0.017097 | 0.0248 | 0.043113 | 0.060791 | 0.009643 | 5.25E-18 | 0.029714 B-cells | 0 | 1.18E-19 | 2.15E-20 | 3.12E-18 | 1.16E-18 | 1.36E-18 | 0.008258 | 0.079919 | 0

Why are they different? How can I get similiar results in R software?

dviraran commented 2 years ago

Hi,

The first table is the raw scores (first link in the email you received), while the second table is the final xCell scores. We recommend using the final scores. You can extract the raw scores from the package using just the rawEnrichmentAnalysis function.

Best, Dvir

YKH810325 commented 2 years ago

Got it.

When I perform "rawEnrichmentAnalysis(a, genes = rownames(a))", I get another error "argument "signatures" is missing, with no default ".

dviraran commented 2 years ago

Should be something like this:

raw.scores = rawEnrichmentAnalysis(as.matrix(expr),
  xCell.data$signatures,
  xCell.data$genes)

You can find this, and other examples, in this paper: https://link.springer.com/protocol/10.1007/978-1-0716-0327-7_19