how to extract all the gene in chromosome X in bed file using R package (rtacklayer)
1
0
Entering edit mode
7.1 years ago
enterid ▴ 10

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).

R • 2.3k views
ADD COMMENT
0
Entering edit mode

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?

ADD REPLY
2
Entering edit mode
7.1 years ago

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.

ADD COMMENT

Login before adding your answer.

Traffic: 3093 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6