Skip to content

Commit

Permalink
Disable ENCODE and Zebrafish support.
Browse files Browse the repository at this point in the history
The requireNamespace() calls cause a WARNING if the packages are not
in the Suggests line of DESCRIPTION.  The warnign causes GitHub CI
to stop in error.  Adding the packages in Suggests causes the CI
to crash at package install time because they are only available
from http://promshift.genereg.net/CAGEr/PackageSource.  I attempted
to solve this using the following in DESCRIPTION

Remotes:
    - url::http://promshift.genereg.net/CAGEr/PackageSource/ENCODEprojectCAGE_1.0.1.tar.gz,
    - url::http://promshift.genereg.net/CAGEr/PackageSource/ZebrafishDevelopmentalCAGE_0.99.0.tar.gz

However, this causes crashes because ENCODEprojectCAGE needs
pdflatex to build.  I do not know how to support that in Win
and Mac, therefore I am giving up for the momment.

The best solution would be to get these packages in Bioconductor too.
  • Loading branch information
Charles Plessy committed May 13, 2024
1 parent cc7cba6 commit e812daf
Showing 1 changed file with 69 additions and 67 deletions.
136 changes: 69 additions & 67 deletions R/ImportMethods.R
Original file line number Diff line number Diff line change
Expand Up @@ -822,44 +822,45 @@ setGeneric("importPublicData",
}

.importPublicData_ENCODE <- function (dataset, group = NULL, sample = NULL) {
if (length(unique(dataset))>1) stop ("Merging datasets not supported yet.")
if (! requireNamespace("ENCODEprojectCAGE"))
stop ("This function requires the ", dQuote("ENCODEprojectCAGE"), " package.",
" package; please install it from http://promshift.genereg.net/CAGEr/PackageSource/.")
if (dataset == "ENCODEtissueCAGEfly") {
if (group != "embryo") stop("Only 'embryo' is allowed as group for dataset 'ENCODEtissueCAGEfly'.")
if (sample != "mixed_embryos_0-24hr") stop("Only 'mixed_embryos_0-24hr' is allowed as sample for dataset 'ENCODEtissueCAGEfly'.")
if (! requireNamespace("BSgenome.Dmelanogaster.UCSC.dm3"))
stop ("This function requires the ", dQuote("BSgenome.Dmelanogaster.UCSC.dm3"), " package.")
genome.name <- "BSgenome.Dmelanogaster.UCSC.dm3"
ENCODEtissueCAGEfly <- NULL
data("ENCODEtissueCAGEfly", package = "ENCODEprojectCAGE", envir = environment())
df <- ENCODEtissueCAGEfly$embryo
} else {
if (! requireNamespace("BSgenome.Hsapiens.UCSC.hg19"))
stop ("This function requires the ", dQuote("BSgenome.Hsapiens.UCSC.hg19"), " package.")
genome.name <- "BSgenome.Hsapiens.UCSC.hg19"
ENCODEhumanCellLinesSamples <- NULL
data("ENCODEhumanCellLinesSamples", package = "ENCODEprojectCAGE", envir = environment())
info.df <- ENCODEhumanCellLinesSamples
if(!(all(dataset %in% info.df$dataset)))
stop("Specified dataset(s) not found! Call data(ENCODEhumanCellLinesSamples) and check 'dataset' column for available ENCODE datasets!")
if(!(all(group %in% info.df[info.df$dataset == dataset,"group"])))
stop("Some of the provided groups cannot be found in the specified dataset!")
if(!(all(sample %in% info.df[,"sample"])))
stop("Some of the provided samples cannot be found!")
data(list= dataset, package = "ENCODEprojectCAGE", envir = environment())
df <- get(dataset)[[group]]
}
se <- .df2SE(df, sample, genome.name)
ce <- CAGEexp(genomeName = genome.name,
colData = DataFrame( sampleLabels = make.names(sample),
inputFiles = NA,
inputFilesType = 'ctss',
librarySizes = sapply(assay(se), sum),
row.names = make.names(sample)))
CTSStagCountSE(ce) <- se
ce
stop("ENCODE data support disabled until I find a way to suggest ENCODEprojectCAGE without causing CI crash in GitHub because of WARNING.")
# if (length(unique(dataset))>1) stop ("Merging datasets not supported yet.")
# if (! requireNamespace("ENCODEprojectCAGE"))
# stop ("This function requires the ", dQuote("ENCODEprojectCAGE"), " package.",
# " package; please install it from http://promshift.genereg.net/CAGEr/PackageSource/.")
# if (dataset == "ENCODEtissueCAGEfly") {
# if (group != "embryo") stop("Only 'embryo' is allowed as group for dataset 'ENCODEtissueCAGEfly'.")
# if (sample != "mixed_embryos_0-24hr") stop("Only 'mixed_embryos_0-24hr' is allowed as sample for dataset 'ENCODEtissueCAGEfly'.")
# if (! requireNamespace("BSgenome.Dmelanogaster.UCSC.dm3"))
# stop ("This function requires the ", dQuote("BSgenome.Dmelanogaster.UCSC.dm3"), " package.")
# genome.name <- "BSgenome.Dmelanogaster.UCSC.dm3"
# ENCODEtissueCAGEfly <- NULL
# data("ENCODEtissueCAGEfly", package = "ENCODEprojectCAGE", envir = environment())
# df <- ENCODEtissueCAGEfly$embryo
# } else {
# if (! requireNamespace("BSgenome.Hsapiens.UCSC.hg19"))
# stop ("This function requires the ", dQuote("BSgenome.Hsapiens.UCSC.hg19"), " package.")
# genome.name <- "BSgenome.Hsapiens.UCSC.hg19"
# ENCODEhumanCellLinesSamples <- NULL
# data("ENCODEhumanCellLinesSamples", package = "ENCODEprojectCAGE", envir = environment())
# info.df <- ENCODEhumanCellLinesSamples
# if(!(all(dataset %in% info.df$dataset)))
# stop("Specified dataset(s) not found! Call data(ENCODEhumanCellLinesSamples) and check 'dataset' column for available ENCODE datasets!")
# if(!(all(group %in% info.df[info.df$dataset == dataset,"group"])))
# stop("Some of the provided groups cannot be found in the specified dataset!")
# if(!(all(sample %in% info.df[,"sample"])))
# stop("Some of the provided samples cannot be found!")
# data(list= dataset, package = "ENCODEprojectCAGE", envir = environment())
# df <- get(dataset)[[group]]
# }
# se <- .df2SE(df, sample, genome.name)
# ce <- CAGEexp(genomeName = genome.name,
# colData = DataFrame( sampleLabels = make.names(sample),
# inputFiles = NA,
# inputFilesType = 'ctss',
# librarySizes = sapply(assay(se), sum),
# row.names = make.names(sample)))
# CTSStagCountSE(ce) <- se
# ce
}

.importPublicData_F34 <- function (dataset, group = NULL, sample = NULL) {
Expand Down Expand Up @@ -945,35 +946,36 @@ setGeneric("importPublicData",
}

.importPublicData_ZF <- function(group = "development", sample = NULL) {
if (group != "development")
stop("Invalid group name! There is only one group in this dataset named 'development'.")
if (! requireNamespace("ZebrafishDevelopmentalCAGE"))
stop ("This function requires the ", dQuote("ZebrafishDevelopmentalCAGE"),
" package; please install it from http://promshift.genereg.net/CAGEr/PackageSource/.")
if (! requireNamespace("BSgenome.Drerio.UCSC.danRer7"))
stop ("This function requires the ", dQuote("BSgenome.Drerio.UCSC.danRer7"), " package.")

ZebrafishSamples <- NULL
data("ZebrafishSamples", package = "ZebrafishDevelopmentalCAGE", envir = environment())

validSampleNames <- levels(ZebrafishSamples$sample)
if (is.null(sample )) sample <- validSampleNames
if ( ! all(sample %in% validSampleNames))
stop("At least one sample name is not valid. ",
"Valid sample names are: ", paste(validSampleNames, collapse = ", "), ".")

ZebrafishCAGE <- NULL
data("ZebrafishCAGE", package = "ZebrafishDevelopmentalCAGE", envir = environment())
# The vignette of ZebrafishDevelopmentalCAGE states that the provided coordinates are 1-based.
ctssSE <- .df2SE(ZebrafishCAGE$development, sample, "BSgenome.Drerio.UCSC.danRer7")
ce <- CAGEexp(genomeName = "BSgenome.Drerio.UCSC.danRer7",
colData = DataFrame( sampleLabels = sample,
inputFiles = NA,
inputFilesType = 'ctss',
librarySizes = sapply(assay(ctssSE), sum),
row.names = sample))
CTSStagCountSE(ce) <- ctssSE
ce
stop("Zebrafish data support disabled until I find a way to suggest ZebrafishDevelopmentalCAGE without causing CI crash in GitHub because of WARNING.")
# if (group != "development")
# stop("Invalid group name! There is only one group in this dataset named 'development'.")
# if (! requireNamespace("ZebrafishDevelopmentalCAGE"))
# stop ("This function requires the ", dQuote("ZebrafishDevelopmentalCAGE"),
# " package; please install it from http://promshift.genereg.net/CAGEr/PackageSource/.")
# if (! requireNamespace("BSgenome.Drerio.UCSC.danRer7"))
# stop ("This function requires the ", dQuote("BSgenome.Drerio.UCSC.danRer7"), " package.")
#
# ZebrafishSamples <- NULL
# data("ZebrafishSamples", package = "ZebrafishDevelopmentalCAGE", envir = environment())
#
# validSampleNames <- levels(ZebrafishSamples$sample)
# if (is.null(sample )) sample <- validSampleNames
# if ( ! all(sample %in% validSampleNames))
# stop("At least one sample name is not valid. ",
# "Valid sample names are: ", paste(validSampleNames, collapse = ", "), ".")
#
# ZebrafishCAGE <- NULL
# data("ZebrafishCAGE", package = "ZebrafishDevelopmentalCAGE", envir = environment())
# # The vignette of ZebrafishDevelopmentalCAGE states that the provided coordinates are 1-based.
# ctssSE <- .df2SE(ZebrafishCAGE$development, sample, "BSgenome.Drerio.UCSC.danRer7")
# ce <- CAGEexp(genomeName = "BSgenome.Drerio.UCSC.danRer7",
# colData = DataFrame( sampleLabels = sample,
# inputFiles = NA,
# inputFilesType = 'ctss',
# librarySizes = sapply(assay(ctssSE), sum),
# row.names = sample))
# CTSStagCountSE(ce) <- ctssSE
# ce
}

#' @rdname importPublicData
Expand Down

0 comments on commit e812daf

Please sign in to comment.