Skip to content

Commit

Permalink
correct a few class == tests
Browse files Browse the repository at this point in the history
  • Loading branch information
amcdavid committed Nov 30, 2022
1 parent 16e90b4 commit 339c6a7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/Fluidigm-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ getConcordance <- function(singleCellRef, singleCellcomp, groups=NULL, fun.natur
m <- as(scL[[i]], 'data.table')
tmp <- reshape2::dcast(m, firstForm, fun.aggregate=fun.natural)
##exponential average per gene, scaled by number of cells
if(class(m[['ncells']]) == 'factor'){
if(inherits(m[['ncells']], 'factor')){
warning("ncells is a factor rather than numeric.\n I'll continue, but this may cause problems down the line")
tmp[['ncells']] <- as.numeric(as.character(tmp[["ncells"]]))
}
Expand Down
2 changes: 1 addition & 1 deletion R/Hypothesis.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Hypothesis <- CoefficientHypothesis <- function(hypothesis, terms){
generateHypothesis <- function(h, terms){
stopifnot(inherits(h, 'Hypothesis') | inherits(h, 'CoefficientHypothesis'))
## if(length(h@transformed)>0) return(h)
if(class(h) =='Hypothesis'){
if(class(h) =='Hypothesis'){ #we need to test for this exact class, not just inheritance
## makeContrasts can't handle non-syntactic names :-/
## So we'll use this instead
cm <- makeContrasts2(contrasts=h@.Data, levels=terms)
Expand Down
2 changes: 1 addition & 1 deletion R/Readers.R
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ if(getRversion() >= "2.15.1") globalVariables(c('Ct Call', 'Ct Value', 'Gene'))
##Function to read fluidigm from xls file
read.fluidigm.xls<-function(x,header.size=2,skip=8){
colmap<-c(`Chamber ID`="Chamber.ID",`Sample Name`="SampleName",`Sample Type`="SampleType",`Sample rConc`="SampleRConc",`FAM-MGB Name`="Gene",`FAM-MGB Type`="AssayType",`Ct Quality`="CtQuality",`Ct Threshold`="CtThreshold")
if(!class(x)=="character"){
if(!inherits(x, "character")){
message("Argument must be of type character")
}
if(!file.exists(x)){
Expand Down

0 comments on commit 339c6a7

Please sign in to comment.