Skip to content

Log2 transformed bigWig not opening in IGV/exporting correctly #11

@alicekcassel

Description

@alicekcassel

When I try to export the log2 transformed bigWig file to IGV, I get no visual peaks and the [NaN-NaN] message (see screenshot).
My code:

newBigWig <- myBigWig
newBigWig <- log2(newBigWig)

export.bw(newBigWig,"log2bigWig.bw")

Screen Shot 2020-06-26 at 10 59 07 AM

The rest of my code from the exercise so far in case the problem is earlier (all has worked so far through making geom_area plot):

#Friday lecture: starting with slides 4
#genomic scores
suppressPackageStartupMessages(library(rtracklayer))
suppressPackageStartupMessages(library(GenomicRanges))

importRegion <- GRanges(seqnames="chr1",ranges=IRanges(133040000,133149400))
mySelection <- BigWigSelection(importRegion)
myBigWig <- import.bw("data/ENCFF940MBK.bigWig",selection=mySelection,as="RleList")
myBigWig

theMax <- max(myBigWig$chr1[133040000:133149400])
theMax

theMin <- min(myBigWig$chr1[133040000:133149400])
theMin

library(ggplot2)

TStartSite <- seq(133131166-500,133131166+500)
TSSdf <- as.data.frame(myBigWig$chr1[TStartSite])
TSSdf$position <- TStartSite

ggplot(TSSdf,aes(x=position,y=value))+geom_area()+theme_minimal()

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions