Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specifying colors for genomicPosTransformLines #15

Closed
edurand opened this issue Feb 24, 2016 · 2 comments
Closed

Specifying colors for genomicPosTransformLines #15

edurand opened this issue Feb 24, 2016 · 2 comments

Comments

@edurand
Copy link

edurand commented Feb 24, 2016

What is the best way to specify colors for individual posTransform lines? The following code snippet works, but does not respect the ordering of columns (i.e. the lines are colored with the wrong color)

i_track = get.cell.meta.data("track.index") 
circos.genomicPosTransformLines(bedwithcolor, track.height=0.05,
    posTransform = function(region, value) {
                        posTransform.default(region, y = 0,
                                             labels = value[[1]], 
                                             cex = 0.8, padding = 0.2, 
                                             track.index = i_track)
                   },
    direction = "outside", col=bedwithcolor$Color, lwd=2
)
@jokergoo
Copy link
Owner

Thanks for reporting this!

I will check it!

@jokergoo
Copy link
Owner

That was a bug in the code and now I have fixed it.

circos.initializeWithIdeogram()

bed = generateRandomBed(nr = 100, nc = 4)

circos.genomicPosTransformLines(bed, posTransform = posTransform.default,
    horizontalLine = "top", track.height = 0.1, 
    col = rep(1:24, times = tapply(bed[[1]], bed[[1]], length)))

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants