IMB-Computational-Genomics-Lab / ascend

R package - Analysis of Single Cell Expression, Normalisation and Differential expression (ascend)
21 stars 7 forks source link

update AEMSet to EMSet #7

Closed slukowski closed 6 years ago

slukowski commented 6 years ago

An object created with an older version of ASCEND doesn't seem to be readable in the new version. I guess this is due to the structural changes. If I load an old version of ASCEND and read it in, then load the new version over the top, is there a way to update the object to the new type and retain all the processing logs etc?

slukowski commented 6 years ago

I have come up with a workaround by creating a new EMSet directly from the old object, doing a quick conversion for the old 'batch' (which was a list), then resaving. Loads fine with new ascend.

new <- NewEMSet(
ExpressionMatrix = old@ExpressionMatrix, 
CellInformation = old@CellInformation, 
GeneInformation = old@GeneInformation, 
Controls = old@Controls
)

new@PCA = old@PCA
new@Clusters = old@Clusters
new@Metrics = old@Metrics
new@Log = old@Log

new@CellInformation$batch <- as.character(unlist(new@CellInformation$batch))
slukowski commented 6 years ago

I was too quick to say it worked properly. I get this error when trying to load the updated dataset:

Loading required package: ASCEND
Error in .requirePackage(package) : 
  unable to find required package ‘ASCEND’
In addition: Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called ‘ASCEND’

The new version of ASCEND is actually lower-case 'ascend', so its trying to load the old one still

asenabouth commented 6 years ago

Most users will not have access to these old objects so such a function is best kept separate from the main package.