Skip to content

Commit

Permalink
Merge pull request #158 from bhklab/156-warning-on-bioc
Browse files Browse the repository at this point in the history
156 warning on bioc
  • Loading branch information
jjjermiah authored Apr 12, 2024
2 parents f5ae5e1 + 4a80e0b commit c4967cc
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 185 deletions.
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
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: PharmacoGx
Type: Package
Title: Analysis of Large-Scale Pharmacogenomic Data
Version: 3.7.3
Version: 3.7.5
Date: 2024-04-08
Authors@R: c(
person(given="Petr", family="Smirnov", email="[email protected]",
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
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
29 changes: 12 additions & 17 deletions R/methods-summarizeSensitivityProfiles.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,18 @@
#' @importMethodsFrom CoreGx summarizeSensitivityProfiles
#' @export
setMethod("summarizeSensitivityProfiles", signature(object="PharmacoSet"),
function(object, sensitivity.measure="auc_recomputed", cell.lines, profiles_assay = "profiles",
treatment_col = "treatmentid", sample_col = "sampleid",
drugs, summary.stat=c("mean", "median", "first", "last", "max", "min"),
fill.missing=TRUE, verbose=TRUE) {
function(
object,
sensitivity.measure="auc_recomputed",
cell.lines,
profiles_assay = "profiles",
treatment_col = "treatmentid",
sample_col = "sampleid",
drugs,
summary.stat=c("mean", "median", "first", "last", "max", "min"),
fill.missing=TRUE,
verbose=TRUE
) {
if (is(treatmentResponse(object), 'LongTable'))
.summarizeSensProfiles(object, sensitivity.measure, profiles_assay = profiles_assay,
treatment_col, sample_col, cell.lines, drugs, summary.stat, fill.missing)
Expand Down Expand Up @@ -177,16 +185,6 @@ setMethod("summarizeSensitivityProfiles", signature(object="PharmacoSet"),
rownames(result) <- drugs
colnames(result) <- cell.lines

# if(verbose){

# message(sprintf("Summarizing %s sensitivity data for:\t%s", sensitivity.measure, annotation(object)$name))
# total <- length(drugs)*length(cell.lines)
# # create progress bar
# pb <- utils::txtProgressBar(min=0, max=total, style=3)
# i <- 1


# }
if(is.factor(dd[, sensitivity.measure]) | is.character(dd[, sensitivity.measure])){
warning("Sensitivity measure is stored as a factor or character in the pSet. This is incorrect.\n
Please correct this and/or file an issue. Fixing in the call of this function.")
Expand All @@ -213,9 +211,6 @@ setMethod("summarizeSensitivityProfiles", signature(object="PharmacoSet"),
pp_dd <- pp_dd[pp_dd[,"sampleid"] %in% cell.lines & pp_dd[,"treatmentid"]%in%drugs,]

tt <- reshape2::acast(pp_dd, treatmentid ~ sampleid, fun.aggregate=summary.function, value.var="sensitivity.measure")
# tt <- tt[drugs, cell.lines]



result[rownames(tt), colnames(tt)] <- tt

Expand Down
6 changes: 5 additions & 1 deletion R/updateObject-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
#' @param object A `PharmacoSet` object to update the class structure for.
#'
#' @return `PharmacoSet` with update class structure.
#'
#'
#' @examples
#' data(GDSCsmall)
#' updateObject(GDSCsmall)
#'
#' @md
#' @importMethodsFrom CoreGx updateObject
#' @export
Expand Down
4 changes: 3 additions & 1 deletion man/dot-computeZIPdelta.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/dot-summarizeSensProfiles.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions man/drugDoseResponseCurve.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 15 additions & 15 deletions man/summarizeSensitivityProfiles-PharmacoSet-method.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions man/updateObject-PharmacoSet-method.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c4967cc

Please sign in to comment.