Question: Bedtools intersect tab and bed files
0
gravatar for smartsean
6.1 years ago by
smartsean0
United States
smartsean0 wrote:

How can you call Bedtools intersect on a tab and bed file? without getting the typical:

"Differing number of BED fields encountered at line: #. Exiting..."

Error.

My bed file has 15 columns and my tab file has 18

 

 

tab intersect bed bedtools • 4.0k views
ADD COMMENTlink modified 6.1 years ago by RamRS30k • written 6.1 years ago by smartsean0

I don't think you can use bedtools intersect to intersect a BED file with a tab-delimited file that is not in BED format. Even though a BED file is essentially a tab-delimited file, it has a particular format. If you can convert your tab-file to BED format then maybe it will work.

ADD REPLYlink written 6.1 years ago by komal.rathi3.7k
0
gravatar for RamRS
6.1 years ago by
RamRS30k
Baylor College of Medicine, Houston, TX
RamRS30k wrote:

Expanding on komal.rathi's comment,

Create a BED file out of your tab file, follow the steps below:

  1. Add this line: #dummy header to a new empty file
  2. Use awk or cut to extract from your tab-delimited file the fields corresponding to the BED file you already have. Redirect and append (>>) the output of this command to the file created above.
  3. Use bedtools intersect on the BED files that you have now.
ADD COMMENTlink modified 6.1 years ago • written 6.1 years ago by RamRS30k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1564 users visited in the last hour