Skip to content

Commit

Permalink
fix loading again for new fds and remove warning for test data
Browse files Browse the repository at this point in the history
  • Loading branch information
ischeller committed May 2, 2024
1 parent 1397a9e commit 291cfcc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 3 additions & 1 deletion R/example_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ createTestFraserSettings <- function(workingDir="FRASER_output"){
# check that NHDF is NA group
sampleTable[gene=='NHDF', condition:=NA]

# set strand specificity column in colData
sampleTable[, strand := 0L]

# create FRASER object
fds <- FraserDataSet(colData=sampleTable, workingDir=workingDir)
strandSpecific(fds) <- 'no'

# dont use hdf5 for example data set
dontWriteHDF5(fds) <- TRUE
Expand Down
10 changes: 9 additions & 1 deletion R/saveHDF5Objects.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,15 @@ loadFraserDataSet <- function(dir, name=NULL, file=NULL, upgrade=FALSE){
attributes(fds)$class <- structure("FraserDataSet", package="FRASER")

# ensure strandSpecific slot is up-to-date with new vector format
strandSpecific(fds) <- slot(fds, "strandSpecific")
if("strandSpecific" %in% slotNames(fds)){
strandSpecific(fds) <- slot(fds, "strandSpecific")
} else{
# adapt type of strandSpecific if needed (changed logical -> integer)
if(is.logical(strandSpecific(fds))){
strandSpecific(fds) <- as.integer(strandSpecific(fds))
}
}


e <- try(assays(fds), silent=TRUE)
if(is.error(e)){
Expand Down

0 comments on commit 291cfcc

Please sign in to comment.