I am working on a specific on RNA gene expression project , after prcoessing RNA seq , i get a bed file with all the gene expression , how can i select the all the gene in chromosome X using R package (rtacklayer).
I am working on a specific on RNA gene expression project , after prcoessing RNA seq , i get a bed file with all the gene expression , how can i select the all the gene in chromosome X using R package (rtacklayer).
Given a sorted BED file, you can quickly fillet the desired chromosome with BEDOPS bedextract
:
$ bedextract chrX in.bed > in.chrX.bed
This will be much faster than awk
or other tools, which have to naively look though the entire file before finding the start point of chrX records. The bedextract
tool uses the sort order in the BED file and so doesn't need to do as many searches to find the same start point.
If you need to do this in R, you can use the system()
call. Or you can export your data to BED and run things on the command line.
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Why do you want to use a specific package instead of performing some basic filter in Bash/Awk/R ? Is your BED file stored into an object that is package-dependant?