I am using sushi package for visualizing genome data.
My data frame looks like this:
head (mydata) chrom start end name score strand row 1 COSN17118087 23 36 AP2D_f1 0 . 1 2 COSN17118087 15 34 BHE41_f1 0 . 2 3 COSN17118087 7 15 COT1_si 0 . 3 4 COSN17118087 6 15 COT2_f1 0 . 4
tail (mydata) 22 COSN17118087 7 16 THB_f1 0 . 20 23 COSN17118087 21 30 TWST1_f1 0 . 21 24 COSN17118087 32 40 ZIC3_f1 0 . 22
My R code is: mydata = read.table ("svlfctrs.bed" , header = T)
chrom = "COSN17118087" chromstart = 1 chromend = 41 mydata$color =maptocolors(mydata$row,col=SushiColors(6)) plotBed(beddata = mydata,chrom = chrom, chromstart = chromstart,chromend =chromend, rownumber = mydata$row, type = "region", color=mydata$color,row="given",plotbg="grey95",rowlabels=unique(mydata$name),rowlabelcol=unique(mydata$color),rowlabelcex=0.75) labelgenome(chrom,chromstart,chromend,n=10,scale="bp")
The problem is with the plot (I did not find attach option to attach my plot here at BioStars). The data point of first line, that is, 1 COSN17118087 23 36 AP2D_f1 0 . 1 merges with the last data point of my data frame, that is, 24 COSN17118087 32 40 ZIC3_f1 0 . 22
Is there any way to solve the issue?
You do not have to restrict just to one package if you cant figure it out. If you want to plot bed file you can take a look at this thread . Alternatively you can also take a look at this . There are different tools to do plot bed like this. If you have a genome file then you must be having a bam file. Index it and then upload both in the IGV browser and then the corresponding bed of interest. Then you can actually visualize you coverage over the bed file as well and based on desired zooming you can just take a png output format. You can also take a look at this
You can upload the plot here, and include it in your post like this:
It would also be helpful if you included example code that leads to the problem you're having.
Thanks vchris_ngs for providing me the links. I will look deep into that.
My scenario is a bit different. I amusing Sushi PACKAGE (https://www.bioconductor.org/packages/3.3/bioc/vignettes/Sushi/inst/doc/Sushi.pdf) and have a data like shown in my question posted. This data have the same format like as in Sushi example:
and If i run the example code:
It generates a plot as shown in page 17 of the pdf link mentioned above.
I also have the same formatted data and it gives me a plot of my data but the only problem is (see the attached figure):
My plot shows that the last data point or data value of my data dont know why combines or merges with the first data point.
Any help appreciated,
Here is your image, since you didn't have the correct url in your post:
I don't know how to solve your problem, but if you haven't figured it out in a few days you could post a question on the Bioconductor support site. The Sushi author seems to be active there.
Thanks stianlagstad, yeah, I will ask that..,,,,,!!!!!
From the image below does not seems to have a problem of the command. It is the dimension. You have to reduce the fontsize of the texts and also the size of the bed regions , to reduce the dimensions which might help to have a better view.
That's not the case. You can see the AP2D_f1 is plotted at right place as it is one with start and ending of 23-36.
ZIC3_f1 should be at the top of TWST_f1 but it merges with the AP2D_f1 and its data points that si 32-40 are not plotted. This is the issue.
Is there any thing to avoid the wrong plotting of ZIC3_f1?
Then you would have to put your bed file in some link so that someone from the community can run it to diagnose the problem. It is a problem of plotting dimension as far as I can understand. From what I understand from your unformatted code is that you have 20 genes in chr 15 for which you are plotting the bed regions and each block corresponds to peak length right? We need to see your data to see where the code is going wrong. Since it is plotting so the problem is not with the function rather the plotting dimension where you have less less and it is squished. Please try to few lines from the bed file you have and also try to format the command and then we can say something. Is your bed file in the same format as that of the
and also add
Try to increase the chrend to 50
It is a problem of the scale since you chrname is quite big as you can see it crosses the first x axis interval of 10. So try to fix the scale. Try to run thre above and see if it works else we would have to take a look at your bed file