How to grep scaffold from the vcf file
1
1
Entering edit mode
4 weeks ago
Kumar ▴ 100

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
introns VCF scaffolds • 200 views
ADD COMMENT
1
Entering edit mode
4 weeks ago
bcftools view --regions-file file1.txt input.vcf
ADD COMMENT

Login before adding your answer.

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