How to grep scaffold from the vcf file
Hi, I have a list of 50 scaffold ids (file1.txt) and another merged file of 90 vcfs (1.4GB) (file2.vcf). I am looking to fetch the scaffolds from the file2.vcf based on the scaffolds id from the file1.txt. Please suggest a script, I am new in writing the python script. I tried the grep command "grep -A 1 -wFf file1.txt file2.vcf > output.vcf", however, I am uncertain that it is correct.
Example:::
file 1:
Scaffold_90832
Scaffold_192565
Scaffold_345678
file 2: a merged vcf file
• 1,314 views
•
link
1 answer
bcftools view --regions-file file1.txt input.vcf
• 0 views
•
link
Log in to answer this question.