cantinilab / HuMMuS

Molecular interactions inference from single-cell multi-omics data
https://cantinilab.github.io/HuMMuS/
GNU Affero General Public License v3.0
15 stars 3 forks source link

Error in add_network() function within Running Cicero for Hummus Object #6

Closed inhyeoklee closed 2 months ago

inhyeoklee commented 2 months ago

Hi Rémi,

I hope you're doing well!

I'm mostly through your documentation, but I encountered an error today while trying to run Cicero via this script:

# Compute ATAC peak networks
hummus_case <- compute_atac_peak_network(hummus_case,
                                         atac_assay = "peaks",
                                         verbose = 1,
                                         genome = BSgenome.Hsapiens.UCSC.hg38::BSgenome.Hsapiens.UCSC.hg38,
                                         store_network = FALSE)

hummus_control <- compute_atac_peak_network(hummus_control,
                                            atac_assay = "peaks",
                                            verbose = 1,
                                            genome = BSgenome.Hsapiens.UCSC.hg38::BSgenome.Hsapiens.UCSC.hg38,
                                            store_network = FALSE)

Here's the output and error message I received: [1] "Starting Cicero" [1] "Calculating distance_parameter value" [1] "Running models" [1] "Assembling connections" [1] "Successful cicero models: 10131" [1] "Other models: "

Zero or one element in range 3454 [1] "Models with errors: 0" [1] "Done"

236663 peak edges with a coaccess score > 0 were found. Peak network construction time: 5.47283 Error in add_network(object = hummus, network = atac_peak_network, network_name = network_name, : Object is not a multiplex, a multilayer nor an hummus object.

And, here's what my Hummus objects look like:

> hummus_case
An object of class "Hummus_Object"
<S4 Type Object>
attr(,"assays")
attr(,"assays")$RNA
Assay (v5) data with 36601 features for 15621 cells
First 10 features:
 MIR1302-2HG, FAM138A, OR4F5, AL627309.1, AL627309.3, AL627309.2, AL627309.5, AL627309.4, AP006222.2, AL732372.1 
Layers:
 counts.Gene Expression.RNA_72, counts.Gene Expression.RNA_203, counts.Gene Expression.RNA_271, counts.Gene
Expression.RNA_294 

attr(,"assays")$SCT
SCTAssay data with 27672 features for 15621 cells, and 4 SCTModel(s) 
First 10 features:
 AL627309.1, AL627309.5, AL627309.4, LINC01409, FAM87B, LINC01128, LINC00115, FAM41C, SAMD11, NOC2L 

attr(,"assays")$integrated
SCTAssay data with 3000 features for 15621 cells, and 1 SCTModel(s) 
Top 10 variable features:
 IGKC, VCAN, IGHA1, IGLC2, AL136456.1, LINC02694, IGLC3, TCF7L2, BANK1, GNLY 

attr(,"assays")$prediction.score.celltype.l1
Assay data with 8 features for 15621 cells
First 8 features:
 other T, CD8 T, B, CD4 T, DC, NK, Mono, other 

attr(,"assays")$prediction.score.celltype.l2
Assay data with 30 features for 15621 cells
First 10 features:
 gdT, CD8 TEM, CD8 TCM, dnT, B intermediate, CD4 TCM, pDC, NK, B naive, CD14 Mono 

attr(,"assays")$prediction.score.celltype.l3
Assay data with 57 features for 15621 cells
First 10 features:
 gdT-3, CD8 TEM-2, CD8 TCM-1, dnT-2, B intermediate lambda, CD4 TCM-3, B intermediate kappa, CD8 TEM-1, CD4 TCM-1, pDC 

attr(,"assays")$ATAC
ChromatinAssay data with 170277 features for 15621 cells
Variable features: 170277 
Genome: 
Annotation present: TRUE 
Motifs present: FALSE 
Fragment files: 6 

attr(,"assays")$peaks
ChromatinAssay data with 86762 features for 15621 cells
Variable features: 0 
Genome: 
Annotation present: TRUE 
Motifs present: FALSE 
Fragment files: 6 

attr(,"active.assay")
[1] "ATAC"
attr(,"multilayer")
Multilayer network containing  2  bipartite networks and  2  multiplex networks.

- Multiplex names:  TF, SCT 
- Bipartite names:  tf_peak, atac_rna 
attr(,"motifs_db")
Motifs database object with :
-  1503 motifs
-  914  TFs
-  1540 TF to motif names mapping
> hummus_control
An object of class "Hummus_Object"
<S4 Type Object>
attr(,"assays")
attr(,"assays")$RNA
Assay (v5) data with 36601 features for 8363 cells
First 10 features:
 MIR1302-2HG, FAM138A, OR4F5, AL627309.1, AL627309.3, AL627309.2, AL627309.5, AL627309.4, AP006222.2, AL732372.1 
Layers:
 counts.Gene Expression.RNA_280, counts.Gene Expression.RNA_302 

attr(,"assays")$SCT
SCTAssay data with 27672 features for 8363 cells, and 2 SCTModel(s) 
First 10 features:
 AL627309.1, AL627309.5, AL627309.4, LINC01409, FAM87B, LINC01128, LINC00115, FAM41C, SAMD11, NOC2L 

attr(,"assays")$integrated
SCTAssay data with 3000 features for 8363 cells, and 0 SCTModel(s) 
Top 10 variable features:
 IGKC, VCAN, IGHA1, IGLC2, AL136456.1, LINC02694, IGLC3, TCF7L2, BANK1, GNLY 

attr(,"assays")$prediction.score.celltype.l1
Assay data with 8 features for 8363 cells
First 8 features:
 other T, CD8 T, B, CD4 T, DC, NK, Mono, other 

attr(,"assays")$prediction.score.celltype.l2
Assay data with 30 features for 8363 cells
First 10 features:
 gdT, CD8 TEM, CD8 TCM, dnT, B intermediate, CD4 TCM, pDC, NK, B naive, CD14 Mono 

attr(,"assays")$prediction.score.celltype.l3
Assay data with 57 features for 8363 cells
First 10 features:
 gdT-3, CD8 TEM-2, CD8 TCM-1, dnT-2, B intermediate lambda, CD4 TCM-3, B intermediate kappa, CD8 TEM-1, CD4 TCM-1, pDC 

attr(,"assays")$ATAC
ChromatinAssay data with 170277 features for 8363 cells
Variable features: 170277 
Genome: 
Annotation present: TRUE 
Motifs present: FALSE 
Fragment files: 6 

attr(,"assays")$peaks
ChromatinAssay data with 86762 features for 8363 cells
Variable features: 0 
Genome: 
Annotation present: TRUE 
Motifs present: FALSE 
Fragment files: 6 

attr(,"active.assay")
[1] "ATAC"
attr(,"multilayer")
Multilayer network containing  2  bipartite networks and  2  multiplex networks.

- Multiplex names:  TF, SCT 
- Bipartite names:  tf_peak, atac_rna 
attr(,"motifs_db")
Motifs database object with :
-  1503 motifs
-  914  TFs
-  1540 TF to motif names mapping

I would really appreciate any suggestions on what may be worth trying from here! And, thanks for your help!

Best, Daniel

r-trimbour commented 2 months ago

Dear Daniel,

I was not able to reproduce your error yet, but the error seems to be related to Hummus_Object, the class that I updated between version 0.0.1 and 0.0.2, I'm checking what might be happening.

I pushed a new version with some corrections, notably displaying some additional info in the errors. Could you reinstall HuMMuS with devtools::install_github("cantinilab/HuMMuS", ref="dev_SeuratV5") and give me the new error output if you're still getting one ?

Rémi

inhyeoklee commented 2 months ago

Thank you for the prompt follow-up, Rémi! After the version update, it seems to be working fine! Here's the output I'm now getting:

[1] "Starting Cicero"
[1] "Calculating distance_parameter value"
[1] "Running models"
Connected to your session in progress, last started 2024-Apr-23 18:57:30 UTC (55 minutes ago)
[1] "Assembling connections"
[1] "Successful cicero models:  10131"
[1] "Other models: "

Zero or one element in range 
                        3454 
[1] "Models with errors:  0"
[1] "Done"

 236663 peak edges with a coaccess score > 0 were found.
Peak network construction time: 5.209882    Creating new multiplex :  peaks 

And, I can also confirm that there are 2 bipartite networks and 3 multiplex networks properly stored in my object.

Hummus object containing a multilayer object :
Multilayer network containing  2  bipartite networks and  3  multiplex networks.

- Multiplex names:  TF, SCT, peaks 
- Bipartite names:  tf_peak, atac_rna 

And a Seurat object :

287806 features across samples within 7 assays 
Active assay: ATAC ( features, 170277 variable features)
 6 other assays present: SCT, integrated, prediction.score.celltype.l1, prediction.score.celltype.l2, prediction.score.celltype.l3, peaks

I'm yet to sift through the outputs, but I'll reach out again if I see any abnormal behaviors or have anything to discuss.

Thanks again, Daniel

r-trimbour commented 2 months ago

Great :) I hope the rest of the pipeline will run smoothly on your dataset now. Let me know if you have any new trouble !

Best, Rémi