How to apply bedtools intersect function with GNU parallel for bacth BED file comparison?
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.
• 1,967 views
•
link
1 answer
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".
• 0 views
•
link
Log in to answer this question.