[Bioc-sig-seq] Linear interpolation for BED formatted data

Wolfgang Huber huber at ebi.ac.uk
Wed Apr 8 21:18:55 CEST 2009


Dear Ivan

Have a look at:

   ? approxfun

Best wishes
      Wolfgang

------------------------------------------------
Wolfgang Huber, EMBL, http://www.ebi.ac.uk/huber

ig2ar-saf2 at yahoo.co.uk wrote:
> Hello,
> 
> I have a BED file that needs some basic linear interpolation.
> 
> For example, this is how only a few lines might originally look like
> 
> chr2    23    24  property1  0.0  property2  10
> chr2  1000  1001  property1  0.5  property2  40
> chr2  3000  3001  property1  1.5  property2  42
> chr2  3500  3501  property1  2.4  property2  56
> chr2  4500  4501  property1  2.6  property2  60
> ...
> 
> My question: Is there any BioC package that will interpolate properties every, say every 2000 base positions?
> 
> So, for that particular example, I'll need the interpolations at chromosome positions 2000, 4000, etc. So, the output should look like this
> 
> chr2 2000 2001 property1 1.0 property2 41
> chr2 4000 4001 property1 2.5 property2 58
> chr2 6000 blah blah...
> ...
> 
> I know that it can be solved with R's standard approxfun() but it is such a common task that it might already exist in BioC.
> 
> Thank you,
> 
> Ivan
> 
>> sessionInfo()
> R version 2.9.0 Under development (unstable) (2009-03-10 r48103) 
> x86_64-unknown-linux-gnu 
> 
> locale:
> LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=C;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C
> 
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base     
> 
> other attached packages:
> [1] IRanges_1.1.48
> 
> 
>       
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> Bioc-sig-sequencing mailing list
> Bioc-sig-sequencing at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing



More information about the Bioc-sig-sequencing mailing list