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

Bioconductor Warnings #159

Merged
merged 19 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
9a13be8
fix: error with summarizeSensitivity Profiles on LongTables where it …
jjjermiah Feb 7, 2024
3d54535
add column arguments to drugDoseResponseCurve
jjjermiah Feb 8, 2024
650d0e5
Update cellline parameter in drugDoseResponseCurve function
jjjermiah Feb 21, 2024
ed19577
docs: add documentation for summarizeSensitivityProfiles
jjjermiah Mar 1, 2024
4e38299
fix: Refactor buildComboProfiles function in computeSynergy.R example…
jjjermiah Apr 8, 2024
a7d8565
fix: Add sample_col and treatment_col arguments to drugDoseResponseCu…
jjjermiah Apr 8, 2024
5e17a0c
fix: remove unlinked [boolean] term as it causes warnings
jjjermiah Apr 8, 2024
c197d9d
chore: delete CreatingPharmacoSet.R Remove CreatingPharmacoSet.R vign…
jjjermiah Apr 8, 2024
7361b1e
fix: Update CreatingPharmacoSet.Rmd to install required packages if n…
jjjermiah Apr 8, 2024
f9eb62e
docs: update Vignette to reflect new changes
jjjermiah Apr 8, 2024
048e913
chore: .Rbuildignore and DESCRIPTION Update .Rbuildignore and DESCRIP…
jjjermiah Apr 8, 2024
f5ae5e1
update CreatingPharmacoSet.Rmd Refactor vignette code to install requ…
jjjermiah Apr 8, 2024
c52e6c6
Update version to 3.7.5 in DESCRIPTION file
jjjermiah Apr 12, 2024
b71fff2
docs: update all docs with roxygen.
jjjermiah Apr 12, 2024
032e864
refactor: Refactor code in R/methods-[.R, R/updateObject-methods.R, s…
jjjermiah Apr 12, 2024
592a42e
ci: update R-CMD-check-bioc.yml Update branch filter in R-CMD-check-b…
jjjermiah Apr 12, 2024
9324b7d
Update branch filter in R-CMD-check-bioc.yml workflow
jjjermiah Apr 12, 2024
4a80e0b
Update branch filter in R-CMD-check-bioc.yml workflow
jjjermiah Apr 12, 2024
c4967cc
Merge pull request #158 from bhklab/156-warning-on-bioc
jjjermiah Apr 12, 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 .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ CONTRIBUTING.md
^docs$
^pkgdown$
^LICENSE\.md$
.github
4 changes: 0 additions & 4 deletions .github/workflows/R-CMD-check-bioc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@

on:
push:
branches:
- master
- main
- devel
pull_request:
branches:
- master
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: PharmacoGx
Type: Package
Title: Analysis of Large-Scale Pharmacogenomic Data
Version: 3.7.2
Date: 2024-02-02
Version: 3.7.5
Date: 2024-04-08
Authors@R: c(
person(given="Petr", family="Smirnov", email="[email protected]",
role=c("aut")),
Expand Down
16 changes: 0 additions & 16 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ importClassesFrom(CoreGx,CoreSet)
importClassesFrom(CoreGx,LongTable)
importClassesFrom(CoreGx,TreatmentResponseExperiment)
importClassesFrom(MultiAssayExperiment,MultiAssayExperiment)
importClassesFrom(S4Vectors,DataFrame)
importClassesFrom(S4Vectors,List)
importFrom(Biobase,AnnotatedDataFrame)
importFrom(BiocParallel,bplapply)
importFrom(CoreGx,"sampleInfo<-")
Expand Down Expand Up @@ -145,7 +143,6 @@ importFrom(CoreGx,sampleNames)
importFrom(CoreGx,subsetByFeature)
importFrom(CoreGx,treatmentNames)
importFrom(CoreGx,updateSampleId)
importFrom(MultiAssayExperiment,MultiAssayExperiment)
importFrom(S4Vectors,DataFrame)
importFrom(S4Vectors,SimpleList)
importFrom(S4Vectors,metadata)
Expand All @@ -162,22 +159,11 @@ importFrom(SummarizedExperiment,colData)
importFrom(SummarizedExperiment,rowData)
importFrom(boot,boot)
importFrom(boot,boot.ci)
importFrom(checkmate,assert)
importFrom(checkmate,assertCharacter)
importFrom(checkmate,assertClass)
importFrom(checkmate,assertDataFrame)
importFrom(checkmate,assertDataTable)
importFrom(checkmate,assertInt)
importFrom(checkmate,assertList)
importFrom(checkmate,assertLogical)
importFrom(checkmate,assertNumeric)
importFrom(checkmate,assertSubset)
importFrom(coop,pcor)
importFrom(data.table,":=")
importFrom(data.table,as.data.table)
importFrom(data.table,data.table)
importFrom(data.table,merge.data.table)
importFrom(data.table,tstrsplit)
importFrom(downloader,download)
importFrom(grDevices,dev.off)
importFrom(grDevices,palette)
Expand Down Expand Up @@ -225,8 +211,6 @@ importFrom(utils,sessionInfo)
importFrom(utils,setTxtProgressBar)
importFrom(utils,txtProgressBar)
importFrom(utils,write.table)
importMethodsFrom(BiocGenerics,"annotation<-")
importMethodsFrom(BiocGenerics,annotation)
importMethodsFrom(CoreGx,"annotation<-")
importMethodsFrom(CoreGx,"curation<-")
importMethodsFrom(CoreGx,"datasetType<-")
Expand Down
124 changes: 0 additions & 124 deletions R/PharmacoSet-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -341,130 +341,6 @@ checkPsetStructure <-
}
}

# #####
# # Checking cell
# #####
# if('tissueid' %in% colnames(sampleInfo(object))) {
# if('unique.tissueid' %in% colnames(curation(object)$tissue))
# {
# if(length(intersect(rownames(curation(object)$tissue),
# sampleNames(object)) != nrow(sampleInfo(object))) {
# message('rownames of curation tissue slot should be the same as cell
# slot (curated cell ids)')
# } else{
# if(length(intersect(sampleInfo(object)$tissueid,
# curation(object)$tissue$unique.tissueid)) !=
# length(table(sampleInfo(object)$tissueid))){
# message('tissueid should be the same as unique tissue id from tissue
# curation slot')
# }
# }
# } else {
# message('unique.tissueid which is curated tissue id across data set
# should be a column of tissue curation slot')
# }
# if(any(is.na(sampleInfo(object)[,'tissueid']) | sampleInfo(object)[,'tissueid']=='',
# na.rm=TRUE)){
# message(sprintf('There is no tissue type for this cell line(s): %s',
# paste(rownames(sampleInfo(object))[which(is.na(
# sampleInfo(object)[,'tissueid']) |
# sampleInfo(object)[,'tissueid']=='')], collapse=' ')))
# }
# } else {
# warning('tissueid does not exist in cell slot')
# }
#
# if('unique.sampleid' %in% colnames(curation(object)$cell)) {
# if(length(intersect(curation(object)$cell$unique.sampleid,
# sampleNames(object)) != nrow(sampleInfo(object))) {
# print('rownames of cell slot should be curated cell ids')
# }
# } else {
# print('unique.sampleid which is curated cell id across data set should be a
# column of cell curation slot')
# }
## if("sampleid" %in% colnames(sampleInfo(object))) {
## if(length(intersect(curation(object)$cell$sampleid, sampleNames(object))
## != nrow(sampleInfo(object))) {
## print('values of sampleid column should be curated cell line ids')
## }
## } else {
## print('sampleid which is curated cell id across data set should be a column of cell slot')
## }
#
# if(length(intersect(rownames(curation(object)$cell),
# sampleNames(object)) != nrow(sampleInfo(object))) {
# print('rownames of curation cell slot should be the same as cell slot
# (curated cell ids)')
# }
#
# if('unique.treatmentid' %in% colnames(curation(object)$treatment)) {
# if(length(intersect(curation(object)$treatment$unique.treatmentid,
# rownames(treatmentInfo(drug)))) != nrow(treatmentInfo(drug))) {
# print('rownames of drug slot should be curated drug ids')
# }
# } else {
# print('unique.treatmentid which is curated drug id across data set should be a
# column of drug curation slot')
# }
#
## if("treatmentid" %in% colnames(treatmentInfo(drug))) {
## if(length(intersect(curation(object)$treatment$treatmentid,
## rownames(treatmentInfo(drug)))) != nrow(treatmentInfo(drug))) {
## print('values of treatmentid column should be curated drug ids')
## }
## } else {
## print('treatmentid which is curated drug id across data set should be a
## column of drug slot')
## }
#
# if(length(intersect(rownames(curation(object)$cell),
# sampleNames(object)) != nrow(sampleInfo(object))) {
# print('rownames of curation drug slot should be the same as drug
# slot (curated drug ids)')
# }
#
# if(!is(sampleInfo(object), 'data.frame')) {
# warning('cell slot class type should be dataframe')
# }
# if(!is(treatmentInfo(drug), 'data.frame')) {
# warning('drug slot class type should be dataframe')
# }
# if(datasetType(object) %in% c('sensitivity', 'both'))
# {
# if(!is(sensitivityInfo(object), 'data.frame')) {
# warning('sensitivity info slot class type should be dataframe')
# }
# if("sampleid" %in% colnames(sensitivityInfo(object))) {
# if(!all(sensitivityInfo(object)[,"sampleid"] %in% sampleNames(object)){
# warning('not all the cell lines in sensitivity data are in cell slot')
# }
# }else {
# warning('sampleid does not exist in sensitivity info')
# }
# if("treatmentid" %in% colnames(sensitivityInfo(object))) {
# drug.ids <- unique(sensitivityInfo(object)[,"treatmentid"])
# drug.ids <- drug.ids[grep('///',drug.ids, invert=TRUE)]
# if(!all(drug.ids %in% rownames(treatmentInfo(drug)))) {
# print('not all the drugs in sensitivity data are in drug slot')
# }
# }else {
# warning('treatmentid does not exist in sensitivity info')
# }
#
# if(any(!is.na(sensitivityRaw(object)))) {
# if(!all(dimnames(sensitivityRaw(object))[[1]] %in%
# rownames(sensitivityInfo(object)))) {
# warning('For some experiments there is raw sensitivity data but no
# experiment information in sensitivity info')
# }
# }
# if(!all(rownames(sensitivityProfiles(object)) %in%
# rownames(sensitivityInfo(object)))) {
# warning('For some experiments there is sensitivity profiles but no
# experiment information in sensitivity info')
# }
# }
}


Expand Down
4 changes: 3 additions & 1 deletion R/computeSynergy.R
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,9 @@ setMethod("computeZIPdelta", signature(object = "TreatmentResponseExperiment"),
#' @examples
#' \dontrun{
#' ## ZIP is optional. Will be recomputed if not provided.
#' combo_profiles <- CoreGx::buildComboProfiles(tre, c("HS", "EC50", "E_inf", "ZIP", "combo_viability"))
#' combo_profiles <- CoreGx::buildComboProfiles(
#' tre,
#' c("HS", "EC50", "E_inf", "ZIP", "combo_viability"))
#' combo_profiles[,
#' .computeZIPdelta(
#' treatment1id = treatment1id,
Expand Down
56 changes: 34 additions & 22 deletions R/drugDoseResponseCurve.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#'
#' # Generate a plot from one or more PSets
#' data(GDSCsmall)
#' drugDoseResponseCurve(drug="Doxorubicin", cellline="22RV", pSets=GDSCsmall)
#' drugDoseResponseCurve(drug="Doxorubicin", cellline="22RV1", pSets=GDSCsmall)
#' }
#'
#' @param drug `character(1)` A drug name for which the drug response curve should be
Expand Down Expand Up @@ -61,6 +61,8 @@
#' @param legend.loc And argument passable to xy.coords for the position to place the legend.
#' @param trunc `logical(1)` Should the viability values be truncated to lie in \[0-100\] before doing the fitting
#' @param verbose `logical(1)` Should warning messages about the data passed in be printed?
#' @param sample_col `character(1)` The name of the column in the profiles assay that contains the sample IDs.
#' @param treatment_col `character(1)` The name of the column in the profiles assay that contains the treatment IDs.
#'
#' @return Plots to the active graphics device and returns an invisible NULL.
#'
Expand Down Expand Up @@ -91,7 +93,9 @@ function(drug,
cex = 0.7,
cex.main = 0.9,
legend.loc = "topright",
verbose=TRUE) {
verbose=TRUE,
sample_col = "sampleid",
treatment_col = "treatmentid") {
if(!missing(pSets)){
if (!is(pSets, "list")) {
if (is(pSets, "PharmacoSet")) {
Expand Down Expand Up @@ -167,28 +171,42 @@ function(drug,
}
}

common.range.star <- FALSE

if (missing(plot.type)) {
plot.type <- "Actual"
}

if(is(treatmentResponse(pSets[[1]]), "LongTable")){
pSets[[1]] <- subsetByTreatment(pSets[[1]], treatments=drug)
}
pSets[[1]] <- subsetBySample(pSets[[1]], samples=cellline)

doses <- list(); responses <- list(); legend.values <- list(); j <- 0; pSetNames <- list()
if(!missing(pSets)){
for(i in seq_len(length(pSets))) {
exp_i <- which(sensitivityInfo(pSets[[i]])[ ,"sampleid"] == cellline & sensitivityInfo(pSets[[i]])[ ,"treatmentid"] == drug)
exp_i <- which(sensitivityInfo(pSets[[i]])[ ,sample_col] == cellline & sensitivityInfo(pSets[[i]])[ ,treatment_col] == drug)
if(length(exp_i) > 0) {
if (summarize.replicates) {
pSetNames[[i]] <- name(pSets[[i]])
if (length(exp_i) == 1) {
drug.responses <- as.data.frame(cbind("Dose"=as.numeric(as.vector(sensitivityRaw(pSets[[i]])[exp_i, , "Dose"])),
drug.responses <- as.data.frame(cbind("Dose"=as.numeric(as.vector(sensitivityRaw(pSets[[i]])[exp_i, , "Dose"])),
"Viability"=as.numeric(as.vector(sensitivityRaw(pSets[[i]])[exp_i, , "Viability"]))), stringsAsFactors=FALSE)
drug.responses <- drug.responses[complete.cases(drug.responses), ]
}else{
drug.responses <- as.data.frame(cbind("Dose"=apply(sensitivityRaw(pSets[[i]])[exp_i, , "Dose"], 2, function(x){median(as.numeric(x), na.rm=TRUE)}),
"Viability"=apply(sensitivityRaw(pSets[[i]])[exp_i, , "Viability"], 2, function(x){median(as.numeric(x), na.rm=TRUE)})), stringsAsFactors=FALSE)
drug.responses <- drug.responses[complete.cases(drug.responses), ]
}
drug.responses <- drug.responses[complete.cases(drug.responses), ]
# tryCatch(
# drug.responses <- as.data.frame(cbind("Dose"=as.numeric(as.vector(sensitivityRaw(pSets[[i]])[exp_i, , "Dose"])),
# "Viability"=as.numeric(as.vector(sensitivityRaw(pSets[[i]])[exp_i, , "Viability"]))), stringsAsFactors=FALSE)
# drug.responses <- drug.responses[complete.cases(drug.responses), ]
# , error = function(e) {
# if (length(exp_i) == 1) {
# drug.responses <- as.data.frame(cbind("Dose"=as.numeric(as.vector(sensitivityRaw(pSets[[i]])[exp_i, , "Dose"])),
# "Viability"=as.numeric(as.vector(sensitivityRaw(pSets[[i]])[exp_i, , "Viability"]))), stringsAsFactors=FALSE)
# drug.responses <- drug.responses[complete.cases(drug.responses), ]
# }else{
# drug.responses <- as.data.frame(cbind("Dose"=apply(sensitivityRaw(pSets[[i]])[exp_i, , "Dose"], 1, function(x){median(as.numeric(x), na.rm=TRUE)}),
# "Viability"=apply(sensitivityRaw(pSets[[i]])[exp_i, , "Viability"], 2, function(x){median(as.numeric(x), na.rm=TRUE)})), stringsAsFactors=FALSE)
# drug.responses <- drug.responses[complete.cases(drug.responses), ]
# }
# })


doses[[i]] <- drug.responses$Dose
responses[[i]] <- drug.responses$Viability
names(doses[[i]]) <- names(responses[[i]]) <- seq_len(length(doses[[i]]))
Expand All @@ -201,7 +219,7 @@ function(drug,
legend.values[[i]] <- sprintf("%s = %s", legends.label, round(as.numeric(sensitivityProfiles(pSets[[i]])[exp_i, legends.label]), digits=2))
}
} else {
legend.values[[i]] <- ""
legend.values[i] <- ""
}
}else {
for (exp in exp_i) {
Expand All @@ -224,7 +242,7 @@ function(drug,
}
} else {
tt <- unlist(strsplit(rownames(sensitivityInfo(pSets[[i]]))[exp], split="_"))
if (tt[1] == "treatmentid") {
if (tt[1] == treatment_col) {
legend.values[[j]] <- tt[2]
}else{
legend.values[[j]] <- rownames(sensitivityInfo(pSets[[i]]))[exp]
Expand Down Expand Up @@ -323,13 +341,7 @@ function(drug,
legends<- c(legends, sprintf("%s%s", pSetNames[[i]], legend.values[[i]]))
legends.col <- c(legends.col, mycol[i])
}
if (common.range.star) {
if (length(doses) > 1) {
for (i in seq_len(length(doses))) {
points(common.ranges[[i]], responses[[i]][names(common.ranges[[i]])], pch=8, col=mycol[i])
}
}
}

legend(legend.loc, legend=legends, col=legends.col, bty="n", cex=cex, pch=c(15,15))
return(invisible(NULL))
}
Expand Down
2 changes: 0 additions & 2 deletions R/methods-[.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# ==== PharmacoSet Class


#'`[`
#'
#' @examples
Expand Down
Loading
Loading