HI, Phil,
I used the following codes and run it overnight for 15 hours, this morning,
I stopped it. It seems it is still not efficient.
On 11/05/2010 09:13 AM, Changbin Du wrote:
HI, Phil,
I used the following codes and run it overnight for 15 hours, this morning,
I stopped it. It seems it is still not efficient.
On 11/05/2010 09:42 AM, Martin Morgan wrote:
## first time only
source(http://bioconductor.org;)
oops, source(http://bioconductor.org/biocLite.R;)
biocLite(IRanges)
##
library(IRanges)
contigs = IRanges(start=1, width=matt$reads)
cvg = coverage(contigs) ## an RLE summarizing coverage,
Thanks Martin! I will try it and will let your guys know how it goes.
On Fri, Nov 5, 2010 at 9:42 AM, Martin Morgan mtmor...@fhcrc.org wrote:
On 11/05/2010 09:13 AM, Changbin Du wrote:
HI, Phil,
I used the following codes and run it overnight for 15 hours, this
morning,
I stopped it.
wdunlap tibco.com
-Original Message-
From: r-help-boun...@r-project.org
[mailto:r-help-boun...@r-project.org] On Behalf Of Changbin Du
Sent: Friday, November 05, 2010 9:14 AM
To: Phil Spector
Cc: r-help@r-project.org
Subject: Re: [R] how to work with long vectors
HI, Phil,
I used
05, 2010 9:14 AM
To: Phil Spector
Cc: r-help@r-project.org
Subject: Re: [R] how to work with long vectors
HI, Phil,
I used the following codes and run it overnight for 15 hours,
this morning,
I stopped it. It seems it is still not efficient.
matt-read.table(/house/groupdirs
Of William Dunlap
Sent: Friday, November 05, 2010 9:58 AM
To: Changbin Du
Cc: r-help@r-project.org
Subject: Re: [R] how to work with long vectors
The following cover_per_3 uses sorting to solve
the problem more quickly. It still has room
for improvement.
cover_per_3 - function (data
HI, Dear R community,
I have one data set like this, What I want to do is to calculate the
cumulative coverage. The following codes works for small data set (#rows =
100), but when feed the whole data set, it still running after 24 hours.
Can someone give some suggestions for long vector?
id
Is this what you want:
x
id reads
1 Contig79:1 4
2 Contig79:2 8
3 Contig79:313
4 Contig79:414
5 Contig79:517
6 Contig79:620
7 Contig79:725
8 Contig79:827
9 Contig79:932
10 Contig79:1033
11 Contig79:1134
x$percent -
Try this:
rev(100 * cumsum(matt$reads 1) / length(matt$reads) )
On Thu, Nov 4, 2010 at 1:46 PM, Changbin Du changb...@gmail.com wrote:
HI, Dear R community,
I have one data set like this, What I want to do is to calculate the
cumulative coverage. The following codes works for small data
Thanks, Jim!
This is not what I want, What I want is calculate the percentage of reads
bigger or equal to that reads in each position.MY output is like the
following:
for row 1, all the reads is = 4, so the cover_per is 100,
for row 2, 99 % reads =4, so the cover_per is 99.
head(final)
HI, Henrique,
Thanks for the great help!
I compared the output from your codes:
te-rev(100 * cumsum(matt$reads 1) / length(matt$reads) )
te
[1] 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84
83
[19] 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66
65
On 11/04/2010 09:45 AM, Changbin Du wrote:
Thanks, Jim!
This is not what I want, What I want is calculate the percentage of reads
bigger or equal to that reads in each position.MY output is like the
following:
Hi Changbin -- I might be repeating myself, but the Bioconductor
packages
Thanks Martin, I will try this.
On Thu, Nov 4, 2010 at 10:06 AM, Martin Morgan mtmor...@fhcrc.org wrote:
On 11/04/2010 09:45 AM, Changbin Du wrote:
Thanks, Jim!
This is not what I want, What I want is calculate the percentage of
reads
bigger or equal to that reads in each position.MY
Changbin -
Does
100 * sapply(matt$reads,function(x)sum(matt$reads = x))/length(matt$reads)
give what you want?
By the way, if you want to use a loop (there's nothing wrong with that),
then try to avoid the most common mistake that people make with loops in R:
having your result grow
Thanks Phil, that is great! I WILL try this and let you know how it goes.
On Thu, Nov 4, 2010 at 10:16 AM, Phil Spector spec...@stat.berkeley.eduwrote:
Changbin -
Does
100 * sapply(matt$reads,function(x)sum(matt$reads =
x))/length(matt$reads)
give what you want?
By the way, if
16 matches
Mail list logo