raymondlouie / MiniMarS

4 stars 2 forks source link

Error with sc2marker #18

Closed dhrutiparikh closed 1 year ago

dhrutiparikh commented 1 year ago

Datasets: dataset2_malt_human/dataset2_malt_human_all_8412cells_14proteinCLRnorm.RDS dataset4_pbmc_human/dataset4_pbmc_human_all_7865cells_14proteinCLRnorm.RDS

list_markers = findClusterMarkers(final_out$training_matrix,

  • final_out$training_clusters,
  • num_markers=15,
  • method="all",
  • verbose=TRUE) Methods used in this analysis: citeFuse, sc2marker, geneBasis, xgBoost

Caclulating markers using citeFuse.

Caclulating markers using sc2marker.

Calculating Markers for 5

Using all genes as input. |=================================================================================================| 100% Calculating Markers for 11

Using all genes as input. |=================================================================================================| 100% Calculating Markers for 3

Using all genes as input. |=================================================================================================| 100% Calculating Markers for 7

Using all genes as input. |=================================================================================================| 100% Calculating Markers for 1

Using all genes as input. |=================================================================================================| 100% Calculating Markers for 2

Using all genes as input. |=================================================================================================| 100% Calculating Markers for 6

Using all genes as input. |=================================================================================================| 100% Calculating Markers for 10

Using all genes as input. |=================================================================================================| 100% Calculating Markers for 4

Using all genes as input. |=================================================================================================| 100% Calculating Markers for 8

Using all genes as input. |=================================================================================================| 100% Calculating Markers for 9

Using all genes as input. |=================================================================================================| 100% Error in curr_df$gene[[1]] : subscript out of bounds In addition: Warning messages: 1: In findClusterMarkers(final_out$training_matrix, final_out$training_clusters, : No method or invalid method selected. Using all methods.

2: In CreateSeuratObject.default(input_matrix, meta.data = data.frame(cell_type = clusters)) : Some cells in meta.data not present in provided counts matrix 3: In mean.fxn(object[features, cells.1, drop = FALSE]) : NaNs produced 4: In mean.fxn(object[features, cells.1, drop = FALSE]) : NaNs produced 5: In mean.fxn(object[features, cells.1, drop = FALSE]) : NaNs produced

raymondlouie commented 1 year ago

Thanks Dhruti.

I'm not getting the same error, although I did modify the code so the names in the meta matches up with the names in the counts matrix. This shouldn't of caused the error though.

Do you mind sending me your final_out object, so I can directly test myself (just type save(final_out,file="test_finalout.RData") in the command prompt, and send me the test_finalout.RData file ). I assume also this error was caused using the latest files in Github Dev branch (because I got the same error as you, but in a previous version).

raymondlouie commented 1 year ago

Hi @dhrutiparikh and @HsiaoChiLiao - thanks Hsiao-Chi for sending the final_out object. The problem though is I still can't reproduce the error. There's no errors when I run it (I also re-install from Dev github each time I run the code).

However, I've modified the code now which might potentially solve the error. Do you mind checking to see if it runs properly now, and if the output is meaningful (hopefully the markers returned shouldn't be empty). Thank you!

dhrutiparikh commented 1 year ago

Hi @raymondlouie,

I'm still getting the same error for these datasets even tho I re-installed it:

I tried to download and install the dev branch, but still got the same error.

I'll email you the final_out object.

raymondlouie commented 1 year ago

Hi @dhrutiparikh and @HsiaoChiLiao - thanks for sending me the objects. Unfortunately, I still don't get an error when I run the code. I've now modified the code further to (temporarily) output some information about the variables used in sc2marker, to hopefully give me a better sense of what's going on. Do you mind please running again (after re-installing the new script in Dev) and showing me the output? Thanks.

dhrutiparikh commented 1 year ago

@raymondlouie I deleted the package, reopened Rstudio and reinstalled the package and sc2marker works now! The other methods work for both datasets as well. I've sent you a copy of the list_markers and list_performance output object via email. Thank you for fixing these.

dhrutiparikh commented 1 year ago

@raymondlouie Sorry, also reran it using the new script and there are no issues that come up for me. The output looks the same.

raymondlouie commented 1 year ago

Great to hear :) Hopefully it'll work for @HsiaoChiLiao as well

HsiaoChiLiao commented 1 year ago

That works for me too!

raymondlouie commented 1 year ago

Great thanks! : )