Git Product home page Git Product logo

Comments (3)

mvfki avatar mvfki commented on July 2, 2024 1

@Obtusah Package rliger has been massively updated. During the development cycle, it is just not expected that single-cell data would be presented in "data.frame" form due to the inefficiency in memory use. Single-cell data, especially RNAseq data, tends to be sparse, and is always recommended to be presented with "dgCMatrix" class, which is supported by package Matrix. A simple fix for you would be something like below:

for (i in seq_along(samples))
{
  print(paste0("Reading sample", i))
  fname <- fnames[i]
  myCount <- fread(fname, header = TRUE)
  # No need to do as.data.frame
  # myCount = as.data.frame(myCount)
  # genenames can still be extracted with this syntax
  genenames <- myCount$Gene
  rownames(myCount) <- genenames
  print("Added gene names")
  suff <- samples[[i]]
  myCount <- myCount[, -1]
  colnames(myCount) <- paste(suff, colnames(myCount), sep = "_")
  print("Added colnames")
  # Coerce the data.table into a matrix
  # which can be then converted into "dgCMatrix" with `as(., "CsparseMatrix")`
  mypanel4[[suff]] <- as(as.matrix(myCount), "CsparseMatrix")
  print(myCount[1:5,1:5])
}

You might need to library(Matrix) if R says it has issue understanding what "CsparseMatrix" is.

Given such a case, support for "data.frame" would be added back in the next release. Though we still strongly suggest considering using the memory efficient form of representation through out the workflow.

Meanwhile, from your source code I noticed that you defined quite a lot plotting functions where I can see a lot of data access using @ symbol. @ access to clusters, tsne.coords and etc. are no longer available now due to structural changes to the liger object. In the new version of rliger we provided accessor functions (getter and setter) for accessing all data you need. It is now generally not suggested to use @ symbol for accessing data because scripts can easily get broken if developers again need to do structural updates like we did. Please see resources below for ways to update them:

  1. Access cell metadata
  2. Access dimensionality reduction
  3. Other access can be seen on the same web page.

Please feel free to reach out if you need more help.

Yichen

from liger.

Obtusah avatar Obtusah commented on July 2, 2024 1

Thank you for detailed answer!
The error was solved with the code you gave. I am changing other deprecated methods too.

from liger.

theAeon avatar theAeon commented on July 2, 2024

this sounds like a matrix ABI issue-can you get a sessionInfo()?

from liger.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.