Code Monkey home page Code Monkey logo

Comments (1)

enblacar avatar enblacar commented on June 18, 2024

Hi @ShashTrip1,

Thanks for using my package!

I see where the problems is:

  • You are feeding a diverging palette to sequential.palette parameter. Normally, this should throw an error, but somehow it is not happening. I will fix that for the next update.
  • Since the error is not being called, you actually get the side effect of the diverging palette being treated as sequential, for which I add a white and black end to the palette. That is why you are getting the error.

I did not intend this function to accept diverging palettes, as I thought there was no use case for it. I will implement its usage for the next update. For now, I would suggest you to use a sequential palette.

However, if you really want to use it with a diverging palette, given the side effect, you can just remove the behaviour of adding the white and black end to sequential color palettes with:

options("SCpubr.ColorPaletteEnds" = FALSE)

This should give you the output you want. But please, be mindful that when I update to fix this side effect, this will no longer work. Here is an example:

Current behaviour

options("SCpubr.ColorPaletteEnds" = TRUE)
SCpubr::do_DotPlot(sample, features = Seurat::VariableFeatures(sample)[1:10], sequential.palette = "RdBu")
Screenshot 2024-01-05 at 12 10 26

Hotfix

options("SCpubr.ColorPaletteEnds" = FALSE)
SCpubr::do_DotPlot(sample, features = Seurat::VariableFeatures(sample)[1:10], sequential.palette = "RdBu")
Screenshot 2024-01-05 at 12 10 37

Hope that works! Feel free to reopen the issue if not!

Best,
Enrique

from scpubr.

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.