If you're going to output the data as a BED file, then you're probably
better off with:

rtracklayer::export(targets, "my.bed")

That makes it an actual BED, e.g. it converts the intervals to zero-based
half-open.

Michael

On Thu, Apr 19, 2012 at 8:29 AM, nathalie <nac@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@r-project.org
> https://stat.ethz.ch/mailman/**listinfo/bioconductor<https://stat.ethz.ch/mailman/listinfo/bioconductor>
> Search the archives: http://news.gmane.org/gmane.**
> science.biology.informatics.**conductor<http://news.gmane.org/gmane.science.biology.informatics.conductor>
>

	[[alternative HTML version deleted]]

