How to apply bedtools intersect function with GNU parallel for bacth BED file comparison?
1
1
Entering edit mode
6.2 years ago

Here is my code:

parallel bedtools intersect -a g7.bed -b {} -wao > {}.bedtools_intersections_results_complete ::: *.bed

I want to compare all .bed files in the directory to a predone g7.bed file with drug resistance mutations therein. Need help on how to apply GNU parallel correctly. Thx. Your forum is very useful.

bedtools parallel intersection • 1.6k views
ADD COMMENT
0
Entering edit mode
6.2 years ago
ATpoint 82k
ls *.bed | parallel "bedtools intersect -a g7.bed -b {} -wao > {.}_.bedtools_intersections_results_complete"

The {} means that the exact file is used that comes from the ls-pipe. {.} will remove the file suffix, so ".bed".

ADD COMMENT

Login before adding your answer.

Traffic: 3239 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