bedtools intersect correct usage
Hello, I am trying to compare genome vcf file with bed file, to get out from genome file only these positions present in bed file
which syntax could be correct: bedtools intersect -a file.vcf -b file1.bed or bedtools intersect -a file1.bed -b file.vcf ?
I am confused, and also second variant seems to be correct, but is not working
• 2,132 views
•
link
1 answer
Hello! It would be better if you use the parameter -wa, which can report the original overlap entry in file A.
bedtools intersect -a file.vcf -b file1.bed -wa > res.txt
This command will report the positions in file.vcf that are overlapped with file1.bed.
The following pic would show you how -wa works. (Source: bedtools official website)

• 0 views
•
link
Log in to answer this question.
Thank you! But now I got this:
this is not VCF file or a BED file. Show us the header of both files.