Git Product home page Git Product logo

Comments (5)

tiramisutes avatar tiramisutes commented on July 24, 2024 1

Hi,
Thanks for your reply.
It's working when adjusting the scripts sequence. The kpPlotDensity function should be followed to plotKaryotype.

from karyoploter.

bernatgel avatar bernatgel commented on July 24, 2024

Hi @tiramisutes,

I'll take a look at it.

Could it be that you closed the plot created by plotKaryotype before executing kpPlotDensity? all plottig functions assume that a plot is active and they never create a new one.

And could you tell if you are using Bioconductor 3.7 or the 3.8 released just yesterday? (the ouput from sessionInfo() would be perfect)

from karyoploter.

tiramisutes avatar tiramisutes commented on July 24, 2024

Hi,
I find in the mycytobands.txt file the only accepted colors are gneg, gpos25, gpos75, gpos100, gvar, acen and stalk. How can I set the color by myself?

from karyoploter.

bernatgel avatar bernatgel commented on July 24, 2024

If you want to change the color of the standard cytobands you can use the color.table argument in kpAddCytobands to give a named vector of colors.

Using custom named cytobands is not supported in the current version but it's in the TODO list. Meanwhile, you can force it in a not very elegant way:

  • The cytoband names MUST be in a column called gieStain, but they can actually be whatever you want
  • Build a color table matching your names

Something like this will create a ranbow colored genome

library(karyoploteR)
kp <- plotKaryotype(ideogram.plotter = NULL)

cytobands <- unlist(tileGenome(tilewidth = 10e6, seqlengths = kp$chromosome.lengths))

cytobands$gieStain <- paste0("color", as.character(seq_along(cytobands)))

color.table <- rainbow(length(cytobands))
names(color.table) <- paste0("color", as.character(seq_along(cytobands)))

kp$cytobands <- cytobands #This is needed because kpAddCytobands does not accept a cytobands parameter
kpAddCytobands(kp, color.table = color.table)

If what you actually want is to highlight certain regions in the genome, you can combine kpRect with the new (released last week with Bioconductor 3.8) data.panel="ideogram" to plot anything ON the ideogram itself

Hope this helps

from karyoploter.

mchlou avatar mchlou commented on July 24, 2024

@bernatgel I am really sorry but I can't quite figure this out. I am trying to color a specific cytoband and the color would depend on the cytoband names. I tried making a cytoband color dataframe that would match a color to a given cytoband name. I also did not catch why we need to paste color values under the gieStain column; particularly this line of code cytobands$gieStain <- paste0("color", as.character(seq_along(cytobands)))? What should i do if I want a particular color for a specific cytoband present in multiple chromosomes? Sorry if this comes as stupid.

from karyoploter.

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.