R/LoomToSeurat.R

Defines functions LoomToSeurat LoomToSeuratStop LoomToSeuratRds

LoomToSeurat = function(infile,outfile) {
  if(missing(outfile)) {
    LoomToSeuratStop(infile)
  } else {
    LoomToSeuratRds(infile,outfile)
  }
}

LoomToSeuratStop = function(infile){
  LoadLoom = loomR::connect(filename = infile)
  methods(class = "loom")
  Seurat::as.Seurat(LoadLoom)
}

LoomToSeuratRds = function(infile,outfile){
  LoadLoom = loomR::connect(filename = infile)
  methods(class = "loom")
  newObject = Seurat::as.Seurat(LoadLoom)
  saveRDS(newObject,file = outfile)
  newObject
}
AndersonButler/ABCC.Seurat documentation built on Oct. 30, 2019, 4:49 a.m.