Entering edit mode
Sang Chul Choi
▴
230
@sang-chul-choi-5066
Last seen 10.2 years ago
Hi,
I wish to smooth rugged coverage of short reads by using seqbias R
package. I followed the vignette of seqbias R package to see some
bias in mapping of short reads from experiment. I computed bias
values for each site of a bacterial genome using the package. Because
each site is given a bias value and the value is used as a weight to
each site, I think that I could give the weight to short reads that
start at the site.
Now that I have weight real values not integers for mapped short
reads, I wish to compute coverage of short reads with weight (real
numbers). I've found out that I can give integer weights as an
argument to the function "coverage" of IRanges package as follows. I,
however, could not find a similar function to give real numbered
weights. I've realized that given real numbered weight, one has to
handle real numbers and cannot use Rle functions. I'm wondering if
there are ways of sidestepping this problem. I will appreciate any
answers.
Thank you,
SangChul
.coverage example with double weights on each of ranges.
=====================
x <- IRanges(start=c(-2L, 6L, 9L, -4L, 1L, 0L, -6L, 10L),
width=c( 5L, 0L, 6L, 1L, 4L, 3L, 2L, 3L))
> coverage(x)
'integer' Rle of length 14 with 6 runs
Lengths: 2 2 4 1 3 2
Values : 3 1 0 1 2 1
> coverage(x,weight=rep(2L,8))
'integer' Rle of length 14 with 6 runs
Lengths: 2 2 4 1 3 2
Values : 6 2 0 2 4 2
=====================