Bedtools intersect tab and bed files
How can you call Bedtools intersect on a tab and bed file? without getting the typical error shown below?
Differing number of BED fields encountered at line: #. Exiting...
My bed file has 15 columns and my tab file has 18
• 6,800 views
•
link
1 answer
Expanding on komal.rathi's comment,
Create a BED file out of your tab file, follow the steps below:
- Add this line:
#dummy headerto a new empty file - Use
awkorcutto 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. - Use bedtools intersect on the BED files that you have now.
• 0 views
•
link
Log in to answer this question.
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.