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

Facet in plotbed #16

Open
DanitzaS opened this issue Mar 6, 2019 · 2 comments
Open

Facet in plotbed #16

DanitzaS opened this issue Mar 6, 2019 · 2 comments

Comments

@DanitzaS
Copy link

DanitzaS commented Mar 6, 2019

Hello @dphansti

I have questions with respect plotBed function.
I have been trying to do a graphic's set, like the facet function, but i can't. is possible to do it with plotBed?
Moreover, I have to Bed archive with only 2 datas to graph, and i can't to do a graphic with it, which is the minimum number of datas i need to use to graph ?

I will grateful for your response
Danitza

@dphansti
Copy link
Collaborator

dphansti commented Mar 7, 2019

I am sorry but I am not sure I understand your first question exactly. Could you explain in more detail what you are trying to achieve? Example code is always helpful.

Regarding question 2, you should be able to make plots with only two data points. Maybe you could post the exact code and data you are trying to plot.

@DanitzaS
Copy link
Author

DanitzaS commented Mar 7, 2019

Thank you for your quick response.
I will explain to you better, in others libraries to do graphs on R exists a function called "facet" , it allow to make multi panel plots with differentes properties each one but relationship among.
For example in ggplot2, can to do subdivisions like show this page https://plot.ly/ggplot2/facet/ , is the same graph, but showing differents properties by panel, and i would want to do the same in plotBed, but I don't know if is possible.

With respect to second question, I am using the next code, in particular works well, but with a little bit data shows errors like the next. When I using more data I don't have any problems.

My data is this (bed archive):

chrom | start | end | name | score | strand
chr5 | 128410262 | 142205103 | hispanic or latino | 100 | 1
chr5 | 137907761 | 143020018 | hispanic or latino | 200 | 1

The Error is this:
" Error in cut.default(vec, c(-Inf, breaks, Inf), labels = cols) :
'breaks' are not unique "

Code:

`plotBed(beddata = dato,chrom = chrom,chromstart = chromstart,
chromend = chromend,colorby = dato$strand,
colorbycol =mis.colores , row = "auto", wiggle=0.2 )
title(main= paste('TCGA-',cancer,sep=""))

zoomsregion(zoomregion1,col=NA,zoomborder="black",lty=1,lwd=2,extend=c(0.02,0.04),wideextend=80,offsets=c(1,0),highlight=TRUE)
labelgenome(chrom,chromstart,chromend,n=5, scale="Kb")
legend("topleft",inset=0,legend=c(unique(long)),fill= mis.colores(length(long)),
border=mis.colores(length(long)),text.font=2,cex=0.75, title = "CNV")`

I hope this time I have explained it better.
Thank you for your help and time.
Danitza

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