lmweber / diffcyt

R package for differential discovery analyses in high-dimensional cytometry data
MIT License
19 stars 12 forks source link

markers_to_test = what? #20

Open amerji93 opened 4 years ago

amerji93 commented 4 years ago

Can you please provide a list of the options that the argument markers_to_test can take? I would like to do differential states analysis using the type markers.

markers_to_test = id_type_markers is not working. markers_to_test = type_markers(sce) is also not working. Using specifics marker names such as markers_to_test = "CD11b" also did not work.

I cannot find any examples in the package vignette. Any help would be appreciated. Thank you.

PS. This comment has been edited.

HelenaLC commented 4 years ago

Could you please clarify which function you are referring to? I cannot think of an argument markers_to_use in the current version of CATALYST and diffcyt.

With any issue, please provide the output of your session info so we can rule out version-related issues.

Lastly, what exactly do you mean by “did not work”? Could you provide the code you ran leading up to the issue, and paste here the error you get? Ideally, do you have a minimal reproducible example (eg using the package example data) that would let us reproduce this?

amerji93 commented 4 years ago

Hi Helena,

This is for the diffcyt() function. (Sorry it's markers_to_test not markers_to_use! My apologies!)

image

If I use = id_state_markers or id_type_markers as suggested in the diffcyt package vignette, I get this: image

If I use a string character of the name of a marker, I get this error: image

sessioninfo()

R version 4.0.2 (2020-06-22) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Catalina 10.15.2

Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages: [1] parallel stats4 stats graphics grDevices utils datasets methods base

other attached packages: [1] magrittr_1.5 readxl_1.3.1 writexl_1.3 scater_1.16.2
[5] diffcyt_1.8.8 flowCore_2.0.1 cowplot_1.0.0 CATALYST_1.12.2
[9] SingleCellExperiment_1.10.1 SummarizedExperiment_1.18.2 DelayedArray_0.14.1 matrixStats_0.56.0
[13] Biobase_2.48.0 GenomicRanges_1.40.0 GenomeInfoDb_1.24.2 IRanges_2.22.2
[17] S4Vectors_0.26.1 BiocGenerics_0.34.0 forcats_0.5.0 stringr_1.4.0
[21] dplyr_1.0.2 purrr_0.3.4 readr_1.3.1 tidyr_1.1.1
[25] tibble_3.0.3 ggplot2_3.3.2 tidyverse_1.3.0

loaded via a namespace (and not attached): [1] backports_1.1.8 circlize_0.4.10 drc_3.0-1 plyr_1.8.6
[5] igraph_1.2.5 ConsensusClusterPlus_1.52.0 splines_4.0.2 BiocParallel_1.22.0
[9] TH.data_1.0-10 digest_0.6.25 viridis_0.5.1 fansi_0.4.1
[13] CytoML_2.0.5 cluster_2.1.0 limma_3.44.3 openxlsx_4.1.5
[17] ComplexHeatmap_2.4.3 modelr_0.1.8 RcppParallel_5.0.2 sandwich_2.5-1
[21] flowWorkspace_4.0.6 cytolib_2.0.3 jpeg_0.1-8.1 colorspace_1.4-1
[25] blob_1.2.1 rvest_0.3.6 ggrepel_0.8.2 haven_2.3.1
[29] crayon_1.3.4 RCurl_1.98-1.2 jsonlite_1.7.0 hexbin_1.28.1
[33] graph_1.66.0 lme4_1.1-23 survival_3.1-12 zoo_1.8-8
[37] glue_1.4.1 gtable_0.3.0 nnls_1.4 zlibbioc_1.34.0
[41] XVector_0.28.0 GetoptLong_1.0.2 ggcyto_1.16.0 car_3.0-9
[45] BiocSingular_1.4.0 Rgraphviz_2.32.0 shape_1.4.4 abind_1.4-5
[49] scales_1.1.1 mvtnorm_1.1-1 edgeR_3.30.3 DBI_1.1.0
[53] Rcpp_1.0.5 plotrix_3.7-8 viridisLite_0.3.0 clue_0.3-57
[57] foreign_0.8-80 rsvd_1.0.3 FlowSOM_1.20.0 tsne_0.1-3
[61] httr_1.4.2 RColorBrewer_1.1-2 ellipsis_0.3.1 farver_2.0.3
[65] pkgconfig_2.0.3 XML_3.99-0.5 dbplyr_1.4.4 utf8_1.1.4
[69] locfit_1.5-9.4 labeling_0.3 tidyselect_1.1.0 rlang_0.4.7
[73] reshape2_1.4.4 munsell_0.5.0 cellranger_1.1.0 tools_4.0.2
[77] cli_2.0.2 generics_0.0.2 broom_0.7.0 ggridges_0.5.2
[81] yaml_2.2.1 fs_1.5.0 zip_2.1.0 nlme_3.1-148
[85] RBGL_1.64.0 xml2_1.3.2 compiler_4.0.2 rstudioapi_0.11
[89] beeswarm_0.2.3 curl_4.3 png_0.1-7 reprex_0.3.0
[93] statmod_1.4.34 stringi_1.4.6 lattice_0.20-41 Matrix_1.2-18
[97] nloptr_1.2.2.2 vctrs_0.3.2 pillar_1.4.6 lifecycle_0.2.0
[101] BiocManager_1.30.10 GlobalOptions_0.1.2 BiocNeighbors_1.6.0 data.table_1.13.0
[105] bitops_1.0-6 irlba_2.3.3 R6_2.4.1 latticeExtra_0.6-29
[109] gridExtra_2.3 RProtoBufLib_2.0.0 rio_0.5.16 vipor_0.4.5
[113] codetools_0.2-16 boot_1.3-25 MASS_7.3-51.6 gtools_3.8.2
[117] assertthat_0.2.1 rjson_0.2.20 withr_2.2.0 multcomp_1.4-13
[121] GenomeInfoDbData_1.2.3 hms_0.5.3 ncdfFlow_2.34.0 grid_4.0.2
[125] minqa_1.2.4 DelayedMatrixStats_1.10.1 carData_3.0-4 Rtsne_0.15
[129] lubridate_1.7.9 base64enc_0.1-3 ggbeeswarm_0.6.0

HelenaLC commented 4 years ago

This is probably better suited for @lmweber, but

  1. id_state/type_markers need to be defined first before passing them to diffcyt() via id_state/type_markers = state/type_markers(sce)

  2. I believe diffcyt(), by default, subsets the state markers only for differential testing, so type markers are “out of bounds”. If you want to test them anyways, I suggest setting all marker classes to “state” via rowData(sce)$marker_class <- “type”

poconnel3 commented 4 years ago

I have been having the same issue. The work around Helena suggested above does work, but it might be nice to have a permanent solution in a future update.

HelenaLC commented 4 years ago

Agree. @Lukas, one option might be to default to testing all state markers, but testing the markers specified by markers_to_test when it is not NULL.