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

Improve documentation and package imports #308

Draft
wants to merge 40 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f3bcb06
resolve tidyomics conflicts and docs clean up
chilampoon Sep 16, 2023
bd82a3c
rm ggplot2 dep and add .Rinstignore
chilampoon Sep 17, 2023
4d8a45b
Merge remote-tracking branch 'upstream/master'
chilampoon Sep 17, 2023
89b106f
try to find the warning source
chilampoon Sep 17, 2023
d7690dd
update R ver and check-bioc
chilampoon Sep 19, 2023
8709db9
imports conflict
chilampoon Sep 19, 2023
b6fdbc4
set _R_CHECK_FORCE_SUGGESTS_ to false
chilampoon Sep 19, 2023
0c1670a
add pkgconfig
chilampoon Sep 19, 2023
1a0c713
Merge branch 'master' into master
stemangiola Sep 19, 2023
c564934
Set automatic Bioconductor and R build-check versions
william-hutchison Jan 4, 2024
243532c
Replace check-bioc with rworkflows workflow file
william-hutchison Jan 4, 2024
25c605d
Update workflow branch triggers
william-hutchison Jan 4, 2024
bfe5ac8
Update function imports
william-hutchison Jan 5, 2024
c98891b
Update EPIC and EGSEA function imports
william-hutchison Jan 5, 2024
5188581
Fix vignette error
william-hutchison Jan 8, 2024
02dfccc
Remove unneeded files
william-hutchison Jan 8, 2024
50a94ab
Update suggested packages
william-hutchison Jan 8, 2024
a162b8e
Replace README example data
william-hutchison Jan 8, 2024
d8862e2
Update README tidyomics ecosystem links
william-hutchison Jan 8, 2024
225c005
Version up
william-hutchison Jan 8, 2024
eea34de
Remove EGSEA import
william-hutchison Jan 8, 2024
d59b0a4
Version up
william-hutchison Jan 8, 2024
0f60ddd
Remove unneeded whole package imports
william-hutchison Jan 9, 2024
fd170a8
Remove unneeded whole dplyr import
william-hutchison Jan 9, 2024
9a9542e
Replace EPIC import with message
william-hutchison Jan 9, 2024
9baac9c
Version up
william-hutchison Jan 9, 2024
7af3822
Update README
william-hutchison Jan 9, 2024
2193a71
Version up
william-hutchison Jan 9, 2024
989009a
Merge branch 'master' into chilampoon-improve-documentation
stemangiola Jan 9, 2024
c54b441
Merge branch 'master' into chilampoon-improve-documentation
stemangiola Feb 7, 2024
6671ed2
Merge remote-tracking branch 'stemangiola/master' into chilampoon-imp…
chilampoon Feb 12, 2024
e174749
resovle line char notes and some warnings
chilampoon Feb 12, 2024
fba863a
resolve doc warnings
chilampoon Feb 12, 2024
89c2244
merge try 1
chilampoon Feb 12, 2024
59862f2
Merge branch 'master' into chilampoon-improve-documentation
stemangiola Feb 12, 2024
2d2b508
replace one_of in functions.R
chilampoon Feb 12, 2024
ea0072b
resolve doc warnings and pull udpates
chilampoon Feb 12, 2024
e3f50e7
Merge branch 'chilampoon-improve-documentation'
william-hutchison Sep 3, 2024
6ba2954
Remove merge resolution comment
william-hutchison Sep 3, 2024
6f2b55a
Merge branch 'master' into chilampoon-improve-documentation
stemangiola Oct 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .Rinstignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dev/
2 changes: 0 additions & 2 deletions .coveralls.yml

This file was deleted.

Empty file modified .gitignore
100755 → 100644
Empty file.
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

65 changes: 32 additions & 33 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -36,57 +36,56 @@ Imports:
methods,
S4Vectors,
crayon,
Matrix
Matrix,
pkgconfig,
AnnotationDbi,
DESeq2,
Rtsne,
Seurat,
betareg,
boot,
broom,
class,
clusterProfiler,
e1071,
edgeR,
functional,
glmmSeq,
glmmTMB,
limma,
lme4,
matrixStats,
msigdbr,
org.Hs.eg.db,
org.Mm.eg.db,
pbapply,
pbmcapply,
survival,
survminer,
Comment on lines +41 to +64
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking this through!

I really think the dependency structure should go back as before. Please try to remove dependency gradually and see if error appear.

Is there any reason to add tidySummarizedExperiment in Suggests?

*please open a new branch for this

Comment on lines +41 to +64
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chilampoon and @william-hutchison we need to drop all these new Imports. If Bioconductor does not accept on-the-fly installation anymore, we rather print the message to install if the packages are not installed, and then use

<package>::<function>

but without adding those dependendies to @importFrom, not in DESCRIPTION as Imports

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yead I agree on too many Imports, however directly add <package>::<function> inside a function without specifying `@importFrom' will trigger a warning saying '::' or ':::' imports not declared from: xyz packages...

sva,
uwot,
widyr
Suggests:
tidySummarizedExperiment,
tidyHeatmap,
BiocStyle,
testthat,
vctrs,
AnnotationDbi,
BiocManager,
Rsubread,
e1071,
edgeR,
limma,
org.Hs.eg.db,
org.Mm.eg.db,
sva,
GGally,
knitr,
qpdf,
covr,
Seurat,
KernSmooth,
Rtsne,
ggplot2,
widyr,
clusterProfiler,
msigdbr,
DESeq2,
broom,
survival,
boot,
betareg,
tidyHeatmap,
pasilla,
ggrepel,
devtools,
functional,
survminer,
tidySummarizedExperiment,
markdown,
uwot,
matrixStats,
igraph,
EGSEA,
IRanges,
here,
glmmSeq,
pbapply,
pbmcapply,
lme4,
glmmTMB,
MASS,
pkgconfig
MASS
VignetteBuilder:
knitr
RdMacros:
Expand Down
36 changes: 20 additions & 16 deletions NAMESPACE
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,29 @@ S3method(rename,tidybulk)
S3method(right_join,tidybulk)
S3method(rowwise,tidybulk)
S3method(summarise,tidybulk)
S3method(summarize,tidybulk)
S3method(ungroup,tidybulk)
S3method(unnest,nested_tidybulk)
S3method(validation,tidybulk)
export("%>%")
export(adjust_abundance)
export(aggregate_duplicates)
export(arrange)
export(as_SummarizedExperiment)
export(as_matrix)
export(as_tibble)
export(bind_cols)
export(cluster_elements)
export(deconvolve_cellularity)
export(describe_transcript)
export(distinct)
export(do)
export(ensembl_to_symbol)
export(fill_missing_abundance)
export(filter)
export(full_join)
export(get_bibliography)
export(group_by)
export(identify_abundant)
export(impute_missing_abundance)
export(inner_join)
export(keep_abundant)
export(keep_variable)
export(left_join)
export(log10_reverse_trans)
export(logit_trans)
export(mutate)
export(nest)
export(pivot_sample)
export(pivot_transcript)
export(quantile_normalise_abundance)
Expand All @@ -56,10 +48,8 @@ export(rename)
export(resolve_complete_confounders_of_non_interest)
export(right_join)
export(rotate_dimensions)
export(rowwise)
export(scale_abundance)
export(select)
export(summarise)
export(symbol_to_entrez)
export(test_differential_abundance)
export(test_differential_cellularity)
Expand All @@ -70,14 +60,16 @@ export(test_stratification_cellularity)
export(tibble)
export(tidybulk)
export(tidybulk_SAM_BAM)
export(unnest)
export(validation_default)
exportMethods(as_SummarizedExperiment)
exportMethods(quantile_normalise_abundance)
exportMethods(scale_abundance)
exportMethods(tidybulk)
exportMethods(tidybulk_SAM_BAM)
import(SummarizedExperiment)
import(e1071)
import(lifecycle)
import(lme4)
import(methods)
import(parallel)
import(preprocessCore)
Expand All @@ -91,6 +83,9 @@ importFrom(SummarizedExperiment,assays)
importFrom(SummarizedExperiment,colData)
importFrom(SummarizedExperiment,rowData)
importFrom(SummarizedExperiment,rowRanges)
importFrom(betareg,betareg)
importFrom(boot,logit)
importFrom(broom,tidy)
importFrom(dplyr,across)
importFrom(dplyr,anti_join)
importFrom(dplyr,arrange)
Expand Down Expand Up @@ -123,7 +118,10 @@ importFrom(dplyr,slice)
importFrom(dplyr,starts_with)
importFrom(dplyr,summarise)
importFrom(dplyr,summarise_all)
importFrom(dplyr,summarize)
importFrom(dplyr,ungroup)
importFrom(functional,Compose)
importFrom(glmmTMB,glmmTMBControl)
importFrom(lifecycle,deprecate_soft)
importFrom(lifecycle,deprecate_warn)
importFrom(magrittr,"%$%")
Expand All @@ -134,7 +132,12 @@ importFrom(magrittr,extract2)
importFrom(magrittr,multiply_by)
importFrom(magrittr,set_colnames)
importFrom(magrittr,set_rownames)
importFrom(matrixStats,colSds)
importFrom(parallel,clusterExport)
importFrom(parallel,makeCluster)
importFrom(parallel,mclapply)
importFrom(pbapply,pblapply)
importFrom(pbmcapply,pbmclapply)
importFrom(purrr,as_mapper)
importFrom(purrr,map)
importFrom(purrr,map2)
Expand All @@ -151,7 +154,6 @@ importFrom(rlang,":=")
importFrom(rlang,dots_list)
importFrom(rlang,dots_values)
importFrom(rlang,enquo)
importFrom(rlang,enquos)
importFrom(rlang,flatten_if)
importFrom(rlang,inform)
importFrom(rlang,is_spliced)
Expand All @@ -178,9 +180,7 @@ importFrom(stats,model.matrix)
importFrom(stats,na.omit)
importFrom(stats,p.adjust)
importFrom(stats,pchisq)
importFrom(stats,plogis)
importFrom(stats,prcomp)
importFrom(stats,qlogis)
importFrom(stats,rnorm)
importFrom(stats,sd)
importFrom(stats,setNames)
Expand All @@ -192,6 +192,10 @@ importFrom(stringr,str_remove)
importFrom(stringr,str_replace)
importFrom(stringr,str_replace_all)
importFrom(stringr,str_split)
importFrom(survival,coxph)
importFrom(survival,survdiff)
importFrom(survminer,ggsurvplot)
importFrom(survminer,surv_fit)
importFrom(tibble,as_tibble)
importFrom(tibble,enframe)
importFrom(tibble,rowid_to_column)
Expand Down
22 changes: 22 additions & 0 deletions R/attach.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
core <- c("dplyr", "tidyr", "ttservice")

core_unloaded <- function() {
search <- paste0("package:", core)
core[!search %in% search()]
}


same_library <- function(pkg) {
loc <- if (pkg %in% loadedNamespaces())
dirname(getNamespaceInfo(pkg, "path"))
library(pkg, lib.loc=loc, character.only=TRUE, warn.conflicts=FALSE)
}

tidyverse_attach <- function() {
to_load <- core_unloaded()

suppressPackageStartupMessages(
lapply(to_load, same_library))

invisible(to_load)
}
11 changes: 4 additions & 7 deletions R/cibersort.R
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,11 @@ call_core = function(itor, Y, X, P, pval, CoreAlg){
}


#' @import e1071
#' @import parallel
#' @import preprocessCore
#' @importFrom stats sd
#' @importFrom utils install.packages
#' @importFrom matrixStats colSds
#'
#' @keywords internal
#'
Expand Down Expand Up @@ -255,12 +258,6 @@ my_CIBERSORT <- function(Y, X, perm=0, QN=TRUE, cores = 3, exp_transform = FALSE
))
Y=Y[,colSums(Y)>0, drop=FALSE]

# Check if package is installed, otherwise install
if (find.package("matrixStats", quiet = TRUE) %>% length %>% equals(0)) {
message("tidybulk says: Installing matrixStats needed for cibersort")
install.packages("matrixStats", repos = "https://cloud.r-project.org")
}

# Eliminate sd == 0
Comment on lines -258 to 261
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reinstate this would also be part of the effort of dependencies.

if(length(which(matrixStats::colSds(Y)==0))>0)
warning(sprintf(
Expand Down
Loading
Loading