Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug fix: handling of custom colors for numeric annotations #63

Merged
merged 10 commits into from
Jul 15, 2024
4 changes: 2 additions & 2 deletions .github/workflows/build_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ jobs:

- name: Build package
run:
Rscript -e "devtools::install(repos = BiocManager::repositories())"
Rscript --vanilla -e "devtools::install(repos = BiocManager::repositories(), upgrade = FALSE)"

- name: Check package
run:
Rscript -e "devtools::check(vignettes = FALSE, args = '--no-examples')"
Rscript --vanilla -e "devtools::check(vignettes = FALSE, args = '--no-examples')"

- name: Upload check results
if: failure()
Expand Down
27 changes: 25 additions & 2 deletions R/prettyOncoplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,24 @@ prettyOncoplot = function(maf_df,
colnames(tsb.include) = tsbs[!tsbs %in% colnames(mat_origin)]
rownames(tsb.include) = rownames(mat_origin)
mat_origin = cbind(mat_origin, tsb.include)
}else if(length(include_noncoding) > 0){
print(
"You requested to include noncoding mutations and remove non-mutated patients ..."
)
these_have_noncoding <- maf_df %>%
filter(
Tumor_Sample_Barcode %in% patients,
Hugo_Symbol %in% names(include_noncoding),
Variant_Classification %in% unlist(unname(include_noncoding))
) %>%
distinct(
Tumor_Sample_Barcode, Hugo_Symbol, Variant_Classification, Start_Position, End_Position
) %>%
pull(Tumor_Sample_Barcode)
tsb.include = matrix(data = 0, nrow = nrow(mat_origin), ncol = length(these_have_noncoding[!these_have_noncoding %in% colnames(mat_origin)]))
colnames(tsb.include) = these_have_noncoding[!these_have_noncoding %in% colnames(mat_origin)]
rownames(tsb.include) = rownames(mat_origin)
mat_origin = cbind(mat_origin, tsb.include)
}
write.table(mat_origin, file = onco_matrix_path, quote = F, sep = "\t")
}
Expand Down Expand Up @@ -700,8 +718,13 @@ prettyOncoplot = function(maf_df,
replace(is.na(.), "NA")
# Only keep the annotation colors for the remaining patients
for(column in colnames(metadata_df)){
remaining <- unique(metadata_df[column]) %>% pull()
colours[[column]] <- (colours[column] %>% unname %>% unlist)[remaining]
if(missing(numericMetadataColumns)){
remaining <- unique(metadata_df[column]) %>% pull()
colours[[column]] <- (colours[column] %>% unname %>% unlist)[remaining]
}else if(!column %in% numericMetadataColumns){
remaining <- unique(metadata_df[column]) %>% pull()
colours[[column]] <- (colours[column] %>% unname %>% unlist)[remaining]
}
}

ch = ComplexHeatmap::oncoPrint(mat[intersect(genes, genes_kept),patients_kept],
Expand Down
227 changes: 128 additions & 99 deletions envs/r.yaml
Original file line number Diff line number Diff line change
@@ -1,189 +1,218 @@
name: r
name: deps
channels:
- conda-forge
- defaults
dependencies:
- _libgcc_mutex=0.1
- _openmp_mutex=4.5
- _r-mutex=1.0.1
- _sysroot_linux-64_curr_repodata_hack=3
- binutils_impl_linux-64=2.40
- binutils_linux-64=2.40
- bwidget=1.9.14
- bzip2=1.0.8
- c-ares=1.27.0
- ca-certificates=2024.2.2
- cairo=1.18.0
- curl=8.5.0
- c-ares=1.28.1
- ca-certificates=2024.7.4
- cairo=1.16.0
- cmake=3.30.0
- curl=8.8.0
- expat=2.6.2
- font-ttf-dejavu-sans-mono=2.37
- font-ttf-inconsolata=3.000
- font-ttf-source-code-pro=2.038
- font-ttf-ubuntu=0.83
- fontconfig=2.14.2
- fonts-anaconda=1
- fonts-conda-ecosystem=1
- fonts-conda-forge=1
- freetype=2.12.1
- fribidi=1.0.10
- gcc_impl_linux-64=13.2.0
- gettext=0.21.1
- gcc_linux-64=13.2.0
- gettext=0.22.5
- gettext-tools=0.22.5
- gfortran_impl_linux-64=13.2.0
- graphite2=1.3.13
- gsl=2.7
- gxx_impl_linux-64=13.2.0
- harfbuzz=8.3.0
- icu=73.2
- kernel-headers_linux-64=4.18.0
- harfbuzz=7.3.0
- icu=72.1
- kernel-headers_linux-64=2.6.32
- keyutils=1.6.1
- krb5=1.21.2
- krb5=1.21.3
- ld_impl_linux-64=2.40
- lerc=4.0.0
- libasprintf=0.22.5
- libasprintf-devel=0.22.5
- libblas=3.9.0
- libcurl=8.5.0
- libdeflate=1.19
- libcblas=3.9.0
- libcurl=8.8.0
- libdeflate=1.18
- libedit=3.1.20191231
- libev=4.33
- libexpat=2.6.2
- libffi=3.4.2
- libgcc-devel_linux-64=13.2.0
- libgcc-ng=13.2.0
- libgfortran-ng=13.2.0
- libgfortran5=13.2.0
- libgit2=1.7.2
- libglib=2.80.0
- libgomp=13.2.0
- libgcc-ng=14.1.0
- libgettextpo=0.22.5
- libgettextpo-devel=0.22.5
- libgfortran-ng=14.1.0
- libgfortran5=14.1.0
- libgit2=1.5.1
- libglib=2.78.1
- libgomp=14.1.0
- libiconv=1.17
- libjpeg-turbo=3.0.0
- libjpeg-turbo=2.1.5.1
- liblapack=3.9.0
- libnghttp2=1.58.0
- libopenblas=0.3.26
- libnsl=2.0.1
- libopenblas=0.3.27
- libpng=1.6.43
- libsanitizer=13.2.0
- libsqlite=3.46.0
- libssh2=1.11.0
- libstdcxx-devel_linux-64=13.2.0
- libstdcxx-ng=13.2.0
- libtiff=4.6.0
- libstdcxx-ng=14.1.0
- libtiff=4.5.1
- libuuid=2.38.1
- libwebp-base=1.3.2
- libuv=1.48.0
- libwebp-base=1.4.0
- libxcb=1.15
- libxml2=2.12.5
- libzlib=1.2.13
- lz4-c=1.9.4
- libxcrypt=4.4.36
- libxml2=2.11.5
- libzlib=1.3.1
- make=4.3
- ncurses=6.4
- openssl=3.2.1
- pandoc=3.1.12.2
- pango=1.52.1
- pcre2=10.43
- mysql-common=8.3.0
- mysql-connector-c=6.1.11
- mysql-libs=8.3.0
- mysqlclient=2.2.4
- ncurses=6.5
- openssl=3.3.1
- pandoc=2.19.2
- pango=1.50.14
- pcre2=10.40
- pip=24.0
- pixman=0.43.2
- pthread-stubs=0.4
- r-askpass=1.2.0
- r-askpass=1.1
- r-assertthat=0.2.1
- r-base=4.2.3
- r-backports=1.4.1
- r-base=4.1.3
- r-base64enc=0.1_3
- r-biocmanager=1.30.22
- r-brew=1.0_10
- r-brio=1.1.4
- r-bslib=0.6.1
- r-biocmanager=1.30.21
- r-brew=1.0_8
- r-brio=1.1.3
- r-bslib=0.5.0
- r-cachem=1.0.8
- r-callr=3.7.5
- r-cli=3.6.2
- r-callr=3.7.3
- r-cli=3.6.1
- r-clipr=0.8.0
- r-commonmark=1.9.1
- r-commonmark=1.9.0
- r-cpp11=0.4.7
- r-crayon=1.5.2
- r-credentials=2.0.1
- r-curl=5.1.0
- r-desc=1.4.3
- r-credentials=1.3.2
- r-curl=4.3.3
- r-dbi=1.1.3
- r-desc=1.4.2
- r-devtools=2.4.5
- r-diffobj=0.3.5
- r-digest=0.6.35
- r-downlit=0.4.3
- r-digest=0.6.31
- r-downlit=0.4.2
- r-ellipsis=0.3.2
- r-evaluate=0.23
- r-fansi=1.0.6
- r-evaluate=0.21
- r-fansi=1.0.4
- r-fastmap=1.1.1
- r-fontawesome=0.5.2
- r-fs=1.6.3
- r-gert=2.0.1
- r-fontawesome=0.5.1
- r-fs=1.6.2
- r-gert=1.9.2
- r-gh=1.4.0
- r-git2r=0.31.0
- r-gitcreds=0.1.2
- r-glue=1.7.0
- r-glue=1.6.2
- r-highr=0.10
- r-htmltools=0.5.7
- r-htmlwidgets=1.6.4
- r-httpuv=1.6.14
- r-httr=1.4.7
- r-httr2=1.0.0
- r-htmltools=0.5.5
- r-htmlwidgets=1.6.2
- r-httpuv=1.6.11
- r-httr=1.4.6
- r-httr2=0.2.3
- r-ini=0.3.1
- r-jquerylib=0.1.4
- r-jsonlite=1.8.8
- r-knitr=1.45
- r-later=1.3.2
- r-lifecycle=1.0.4
- r-jsonlite=1.8.5
- r-knitr=1.43
- r-later=1.3.1
- r-lattice=0.21_8
- r-lifecycle=1.0.3
- r-magrittr=2.0.3
- r-mass=7.3_58.3
- r-matrix=1.5_4.1
- r-matrixmodels=0.5_0
- r-memoise=2.0.1
- r-mime=0.12
- r-miniui=0.1.1.1
- r-openssl=2.1.1
- r-openssl=2.0.6
- r-pillar=1.9.0
- r-pkgbuild=1.4.2
- r-pbkrtest=0.5.2
- r-pkgbuild=1.4.0
- r-pkgconfig=2.0.3
- r-pkgdown=2.0.7
- r-pkgload=1.3.4
- r-pkgload=1.3.2
- r-praise=1.0.0
- r-prettyunits=1.2.0
- r-processx=3.8.3
- r-prettyunits=1.1.1
- r-processx=3.8.1
- r-profvis=0.3.8
- r-promises=1.2.1
- r-ps=1.7.6
- r-purrr=1.0.2
- r-promises=1.2.0.1
- r-ps=1.7.5
- r-purrr=1.0.1
- r-r6=2.5.1
- r-ragg=1.3.0
- r-ragg=1.2.5
- r-rappdirs=0.3.3
- r-rcmdcheck=1.4.0
- r-rcpp=1.0.12
- r-rcpp=1.0.10
- r-rematch2=2.1.2
- r-remotes=2.4.2.1
- r-rlang=1.1.3
- r-rmarkdown=2.25
- r-roxygen2=7.3.1
- r-rprojroot=2.0.4
- r-rstudioapi=0.15.0
- r-remotes=2.4.2
- r-rlang=1.1.1
- r-rmarkdown=2.22
- r-rmysql=0.10.25
- r-roxygen2=7.2.3
- r-rprojroot=2.0.3
- r-rstudioapi=0.14
- r-rversions=2.1.2
- r-sass=0.4.8
- r-sass=0.4.6
- r-sessioninfo=1.2.2
- r-shiny=1.8.0
- r-shiny=1.7.4
- r-sourcetools=0.1.7_1
- r-stringi=1.8.3
- r-stringr=1.5.1
- r-stringi=1.7.12
- r-stringr=1.5.0
- r-sys=3.4.2
- r-systemfonts=1.0.5
- r-testthat=3.2.1
- r-textshaping=0.3.7
- r-systemfonts=1.0.4
- r-testthat=3.1.8
- r-textshaping=0.3.6
- r-tibble=3.2.1
- r-tinytex=0.49
- r-tinytex=0.45
- r-urlchecker=1.0.1
- r-usethis=2.2.3
- r-utf8=1.2.4
- r-vctrs=0.6.5
- r-waldo=0.5.2
- r-usethis=2.2.0
- r-utf8=1.2.3
- r-vctrs=0.6.2
- r-waldo=0.5.1
- r-whisker=0.4.1
- r-withr=3.0.0
- r-xfun=0.42
- r-xml2=1.3.6
- r-withr=2.5.0
- r-xfun=0.39
- r-xml2=1.3.4
- r-xopen=1.0.0
- r-xtable=1.8_4
- r-yaml=2.3.8
- r-zip=2.3.1
- r-yaml=2.3.7
- r-zip=2.3.0
- readline=8.2
- rhash=1.4.4
- sed=4.8
- sysroot_linux-64=2.28
- setuptools=70.1.1
- sysroot_linux-64=2.12
- tk=8.6.13
- tktable=2.10
- tzdata=2024a
- wheel=0.43.0
- xorg-kbproto=1.0.7
- xorg-libice=1.1.1
- xorg-libsm=1.2.4
- xorg-libx11=1.8.7
- xorg-libx11=1.8.9
- xorg-libxau=1.0.11
- xorg-libxdmcp=1.1.3
- xorg-libxext=1.3.4
Expand All @@ -193,5 +222,5 @@ dependencies:
- xorg-xextproto=7.3.0
- xorg-xproto=7.0.31
- xz=5.2.6
- zlib=1.2.13
- zstd=1.5.5
- zlib=1.3.1
- zstd=1.5.6
Loading