livnatje / DIALOGUE

DIALOGUE is a dimensionality reduction method that uses cross-cell-type associations to identify multicellular programs (MCPs) and map the cell transcriptome as a function of its environment.
Other
106 stars 16 forks source link

Impossible to reproduce the code #31

Closed elissonlopes closed 1 year ago

elissonlopes commented 1 year ago

Please upload this package ASAP. Many functions without any explanation how to use or set parameters. I never saw a package with so little documentation.
Even running examples I got error messages. The nature paper is beautiful but the package needs to be update or is impossible to reproduce the results you presented.

livnatje commented 1 year ago

Are you experiencing any specific problem?

Have you seen the tutorial? https://github.com/livnatje/DIALOGUE/wiki/Tutorial And the toy example? https://github.com/livnatje/DIALOGUE/wiki/Example

The documentation of the package is also provided in the R embedded "help" feature, which you can access by using "?" followed by the function name

elissonlopes commented 1 year ago

Yes. Since the first function I got error (following the tutorial). I solved it adding a missing "NK" to generate the r2. It took me a time to do it, because of this lack of descriptions.

Its a potential package and great ideia.

But more than 2k lines of R code without explanation about parameters (input and output), how to adapt the run to different types of data etc.

I would like to recommend you to add more info, please. It would help a lot for anyone how wants at least reproduce what you presented in the paper.

livnatje commented 1 year ago

@elissonlopes, I think you might have a more specific problem. If you could tell me what error you got when running the toy example that would make it easier to help you. Please make sure to install the latest version of the package.

I just double checked and ran the toy example myself. There was no issue getting all the outputs (see below).

> library(DIALOGUE)
> rA<-readRDS(system.file("Data", "test.example.rds", package = "DIALOGUE"))
> summary(rA)
  Length Class     Mode
A 1      cell.type S4  
B 1      cell.type S4  
C 1      cell.type S4  
> R<-DIALOGUE.run(rA = rA,main = "test",k = 2,results.dir = "~/Desktop/DIALOGUE.results/",
+                 plot.flag = T,conf = "cellQ",pheno = "pathology",n.genes = 100)
[1] "#************DIALOGUE Step I: PMD ************#"
[1] "A: Removing 0 of 30 features."
[1] "B: Removing 0 of 30 features."
[1] "C: Removing 0 of 30 features."
[1] "#************DIALOGUE Step II: HLM ************#"
[1] "#************DIALOGUE Step II (multilevel modeling): A vs. B ************#"
[1] "2 MCPs identified for these cell types."
[1] "#************DIALOGUE Step II (multilevel modeling): A vs. C ************#"
[1] "2 MCPs identified for these cell types."
[1] "#************DIALOGUE Step II (multilevel modeling): B vs. C ************#"
[1] "2 MCPs identified for these cell types."
[1] "#************Finalizing the scores************#"
[1] "~/Desktop/DIALOGUE.results//DIALOGUE2_test.rds"
[1] "Removing MCP3"
[1] "Removing MCP4"
[1] "Removing MCP5"
[1] "Removing MCP3"
[1] "Removing MCP4"
[1] "Removing MCP5"
NULL
NULL
NULL
Warning message:
In dir.create(results.dir) :
  '/Users/livnatjerby/Desktop/DIALOGUE.results' already exists
> hist(R$scores$A$MCP1,100,xlab = "MCP1 (cell type A)",main = "MCP1")
> print(round(R$phenoZ,2))
     MCP1  MCP2
A   -3.04  1.39
B   -3.30  1.07
C   -4.43 -1.05
All -3.86  0.86
> summary(unlist(R$MCPs,recursive = F))
            Length Class  Mode     
MCP1.A.up   100    -none- character
MCP1.B.up    99    -none- character
MCP1.C.up   100    -none- character
MCP1.A.down  95    -none- character
MCP1.B.down  91    -none- character
MCP1.C.down  94    -none- character
MCP2.A.up    66    -none- character
MCP2.B.up    13    -none- character
MCP2.C.up    58    -none- character
MCP2.A.down 100    -none- character
MCP2.B.down  69    -none- character
MCP2.C.down  97    -none- character
> R$MCPs$MCP1$A.down
 [1] "ACTR2"     "ADD3"      "AGR3"      "ATP10B"    "ATP1B1"    "ATP5I"     "ATP8B1"    "B3GALT5"   "B3GNT7"    "C14orf2"  
[11] "C15orf48"  "C8orf59"   "CAMK2D"    "CAMK2N1"   "CANX"      "CAPZA1"    "CCDC14"    "CDC42"     "CDH1"      "CERS6"    
[21] "CHP1"      "CLTC"      "COX7B"     "COX7C"     "CTNNB1"    "CTTN"      "DDAH1"     "DDX17"     "DSG2"      "EPB41L4B" 
[31] "FABP2"     "FAM120A"   "FRYL"      "GALNT7"    "GNAQ"      "GOLIM4"    "GTF2H5"    "HIGD1A"    "HNRNPH1"   "INSR"     
[41] "IQGAP1"    "ITGB1"     "LCN2"      "LGR4"      "LINC00657" "LPP"       "MAN2A1"    "MARCKS"    "MDM4"      "MGST2"    
[51] "MT-ATP6"   "MT-CO2"    "MT-ND3"    "MT-ND4L"   "MTRNR2L3"  "N4BP2L2"   "NCKAP1"    "NDUFB1"    "NHSL1"     "NRIP1"    
[61] "PARM1"     "PDCD4"     "PIGR"      "PJA2"      "PKP2"      "PPP1CB"    "PPP3CA"    "PRAC1"     "PRKACB"    "PTBP3"    
[71] "RBM47"     "RPL34"     "RPL37"     "RPL39"     "RPS29"     "S100A6"    "SEC61G"    "SLC12A2"   "SLC26A2"   "SLC38A1"  
[81] "SLC4A4"    "SPINK1"    "SPINK5"    "SPON1"     "SULT1B1"   "TBL1XR1"   "TM9SF3"    "TRA2A"     "TSPAN8"    "TSPYL1"   
[91] "UHMK1"     "UQCRB"     "USMG5"     "WFDC2"     "XIST"     
elissonlopes commented 1 year ago

The examples doesn't concern me. I was able to get the results for toy example too. The initial error that I said was using DIALOGUE_SeuratExample with pbmc data. It was solved adding the NK to r2. I just want to suggest more info about more documentation about what inputs should I use and what the function is doing.

livnatje commented 1 year ago

@elissonlopes, the Seurat wrapper is not an integral part of DIALOGUE. We added this as a curtesy to address GitHub requests and make it easier for users.

You may have had issues with the example because the toy data is fairly small and there was another criteria recently added to ensure sufficient statistical power. This issue was now resolved, and you can see the documentation here https://github.com/livnatje/DIALOGUE/wiki/Toy-example:-Running-DIALOGUE-with-Seurat-object

Note that other than the documentation in GitHub you can also look at the R documentation directly

> ?DIALOGUE.run
> ?make.cell.type
> ?DIALOGUE.plot
> ?DIALOGUE_make.cell.type.seurat

As explained in detail in the ?DIALOGUE.run documentation, you essentially need to provide the gene expression per cell type and number of MCPs. It's fairly plug and play with a lot happening backend in a data driven manner (hence the many lines of code).