I am trying to plot a genomic region of interest using sushi.
I am able to run the example, however I just can't get running my bed file by myself.
This is my gene list in bed format, from ensembl:
head(gl)
start stop strand gene chrom score
1 66119285 66465398 1 SLC25A26 HG991_PATCH .
2 23551994 23552136 -1 AL157931.1 13 .
3 23708313 23708703 1 HMGA1P6 13 .
4 23726725 23726825 -1 RNY3P4 13 .
5 23743974 23744736 -1 LINC00362 13 .
6 23791571 23791673 -1 RNU6-58P 13 .
str(gl)
'data.frame': 64101 obs. of 6 variables:
$ start : int 66119285 23551994 23708313 23726725 23743974 23791571 23817659 93708910 23841645 23947562 ...
$ stop : int 66465398 23552136 23708703 23726825 23744736 23791673 23821323 93710179 23843289 23948200 ...
$ strand: int 1 -1 1 -1 -1 -1 1 1 1 1 ...
$ gene : chr "SLC25A26" "AL157931.1" "HMGA1P6" "RNY3P4" ...
$ chrom : chr "HG991_PATCH" "13" "13" "13" ...
$ score : chr "." "." "." "." ...
But when I run the plotGenes function I just get a "yes" print.
plotGenes(gl, chrom = "6",6, chromstart = 132647962, chromend = 132947962)
What's the problem?
It's hard to debug without access to your bed file, but just a few thoughts:
plotGenes()
source code, it doesn't look like it every actuall uses thechrom
argument if you pass a bed file. It will try to plot everything in the file, which just hangs my R session if the bed file is large. Perhaps try subsetting the bed file before passing it to the function e.g.I used the followed script:
glsub <-Sushi_transcripts.bed[which(Sushi_transcripts.bed[,"chrom"]=='chr15'&Sushi_transcripts.bed[,"start"] > 73062668 & Sushi_transcripts.bed[,"stop"]< 73091240),]
get an error message:
Error in FUN(X[[i]], ...) :
only defined on a data frame with all numeric variables
I can not figure out, it is similar that when I used my gene bed files.
when I used the example:
pg = plotGenes(Sushi_transcripts.bed,chrom,chromstart,chromend,types = Sushi_transcripts.bed$type,colorby=log10(Sushi_transcripts.bed$score+0.001),colorbycol= SushiColors(5),colorbyrange=c(0,1.0),labeltext=TRUE,maxrows=50,height=0.4,plotgenetype="box")
it work.
Annother question: can I used "read.table" to load my bed files or bedgraph files?