Plotting bed8 with Sushi possible?
0
0
Entering edit mode
maltethodberg ▴ 180
@maltethodberg-9690
Last seen 11 days ago
Denmark

I've been trying to use Sushi to plot a bed8-file, containing the location of a cluster and the location of the cluster "peak" in the thickStart/thickEnd columns:

library(Sushi)
bed8 <- data.frame(chrom="chr18",
                                     chromStart=100,
                                     chromEnd=125,
                                     name="ClusterX",
                                     score=0,
                                     strand="+",
                                     thickStart=110,
                                     thickStart=111)

There doesn't seem to be a custom function for this in Sushi, so I played around with plotGenes (Which can do the thin/thick plotting):

d <- data.frame(chrom=c("chr18", "chr18", "chr18"),
                                     chromStart=c(100, 110, 111),
                                     chromEnd=c(110, 111, 125),
                                     name=c("ClusterX", "ClusterX", "ClusterX"),
                                     score=0,
                                     strand=c("+", "+", "+"),
                                     type=c("utr", "exon", "utr"))

chrom <- "chr18"
chromStart <- 1
chromEnd <- 300

# Decent plot produced, but return strange output as well:
plotGenes(d, chrom=chrom, chromstart = chromStart, chromend = chromEnd, type=d$type)
[[1]]
NULL

[[2]]
function (n) 
{
    x <- ramp(seq.int(0, 1, length.out = n))
    if (ncol(x) == 4L) 
        rgb(x[, 1L], x[, 2L], x[, 3L], x[, 4L], maxColorValue = 255)
    else rgb(x[, 1L], x[, 2L], x[, 3L], maxColorValue = 255)
}
<bytecode: 0x11269a928>
<environment: 0x116c82c98>

Warning messages:
1: In Ops.factor(strand, bprange) : ‘*’ not meaningful for factors
2: In Ops.factor(strand, bprange) : ‘*’ not meaningful for factors

Is this bug or am I misspecifying something? Is there perhaps a better way of plotting bed8 files?

sushi bed • 815 views
ADD COMMENT

Login before adding your answer.

Traffic: 1088 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6