Coder Social home page Coder Social logo

Sorting logic in `index_chains()` about scirpy HOT 3 CLOSED

nh3 avatar nh3 commented on July 18, 2024
Sorting logic in `index_chains()`

from scirpy.

Comments (3)

grst avatar grst commented on July 18, 2024

Hi,

thanks for the question. I don't think that the read count for chains with equal UMI count provides any useful information about true abundance. But it's also not worse than random. There are two reasons it's implemented that way:

  • the sorting gets more reproducible as it doesn't depend on random order in the case of ties
  • the same default sorting keys can be used for datasets that do and don't provide umi counts

You have a point that it's currently not possible to specify whether to sort ascending/descending in the index_chains function. I'm a bit wary thought to introduce even more complexity to that function.

Would something like

adata.obsm["airr"]["sort_key2"] = -adata.obsm["airr"]["sort_key"] 
ir.pp.index_chains(adata, sort_chains_by = {"sort_key2": float("-inf")})

work for you as a workaround?

from scirpy.

nh3 avatar nh3 commented on July 18, 2024

Hi @grst,

Thank you for the quick reply. In the context of 10X VDJ sequencing, abundance of reads is largely determined by, on top of UMI abundance, efficiency of PCR amplification and luck of sampling during sequencing. In other words, read count represents number of observations. Unique molecules that require higher number of observations to be found are likely less abundant than those require fewer observations. That's the rationale. In practice, it would affect only a very small subset of cells.

Thank you for the workaround. I can live with that :). Thanks!

from scirpy.

grst avatar grst commented on July 18, 2024

Closing because you said you could live with the workaround. Let me know if there are any other issues.

from scirpy.

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.