[BioC] extract data from RangedData table (IRange TEQC packages)
Ivan Gregoretti
ivangreg at gmail.com
Thu Apr 19 17:43:10 CEST 2012
Hello Nathalie,
Try this
write.table(as.data.frame(targets)[,c(1,2,3)],file="./output.bed",
quote=FALSE, sep="\t", row.names=FALSE, col.names=FALSE)
Ivan
Ivan Gregoretti, PhD
National Institute of Diabetes and Digestive and Kidney Diseases
National Institutes of Health
5 Memorial Dr, Building 5, Room 205.
Bethesda, MD 20892. USA.
Phone: 1-301-496-1592
Fax: 1-301-496-9878
On Thu, Apr 19, 2012 at 11:29 AM, nathalie <nac at sanger.ac.uk> wrote:
>
> Hi,
> I would like to extract a txt file of a RangedData table I have created with
> TEQC package using the get.targets function and a bed target file "file" as
> an input:
>
>> targets<-get.targets("file", chrcol=1,startcol=2,endcol=3, zerobased=F,
>> sep="\t",skip=0)
>
> [1] "read 1243 target regions in total, which are collapsed to 598
> non-overlapping target regions"
>
>> targets
> RangedData with 598 rows and 0 value columns across 18 spaces
> space ranges |
> <factor> <IRanges> |
> 1 Chr1 [115247090, 115250671] |
> 2 Chr1 [115250775, 115250813] |
> 3 Chr1 [115251152, 115251275] |
> 4 Chr1 [115252190, 115252349] |
> 5 Chr1 [115256421, 115256599] |
> 6 Chr1 [115258671, 115258798] |
> 7 Chr1 [115259279, 115259515] |
> 8 Chr10 [ 89622870, 89624305] |
> 9 Chr10 [ 89626430, 89626806] |
> ... ... ... ...
> 590 ChrX [133607389, 133607495] |
> 591 ChrX [133609211, 133609394] |
> 592 ChrX [133620495, 133620560] |
> 593 ChrX [133620692, 133620696] |
> 594 ChrX [133624218, 133624235] |
> 595 ChrX [133627538, 133627620] |
> 596 ChrX [133632420, 133632466] |
> 597 ChrX [133632638, 133632714] |
> 598 ChrX [133634060, 133634698] |
>
>
> I would like to extract the collapsed chromosome start and end points from
> this to a txt file? Any suggestions would be welcome...
>
> output file should contain:
> Chr1 115247090, 115250671
> Chr1 115250775, 115250813
> Chr1 115251152, 115251275
> .....
>
>
> Many thanks,
> Nat
>
>
> --
> The Wellcome Trust Sanger Institute is operated by Genome Research Limited,
> a charity registered in England with number 1021457 and a company registered
> in England with number 2742969, whose registered office is 215 Euston Road,
> London, NW1 2BE.
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor
More information about the Bioconductor
mailing list