Hello,
I have a vcf file with 100 genotypes. I want to extract information on 10 specific genotypes and I have a list of their ID's. Any ideas which tool could be used?
Hello,
I have a vcf file with 100 genotypes. I want to extract information on 10 specific genotypes and I have a list of their ID's. Any ideas which tool could be used?
Yes, now I found a solution:
bcftools view -S in.txt in.vcf > out.vcf
If you were polite and just wrote your latest comment, we would have avoided upsetting each other. Don't take for granted that understanding some concepts are easy for everybody like they are for you. Sometimes we just need one keyword to move on. Thanks
I'm glad you found a solution. "You need to read (the documentation) more" and "Read the manual" are not upsetting statements, they are plain facts. The disconnect was between the words you were using to think about the problems and the words the community uses to describe those concepts.
When we encounter an obstacle, we can either choose to learn or complain how difficult it is for us. On a personal note, I struggle with this a lot myself too. We cannot expect people to coddle us, especially in a professional setting.
Do you mean you have the SNP IDs?
bcftools view -i ID==@text file_of_SNP_IDs yourvcf > output.vcf
Further to your question I think you want:
bcftools view -s sample1,sample2 file.vcf > filtered.vcf
bcftools view -S sample_file.txt file.vcf > filtered.vcf
if you are not willing to help, just do not comment
Please don't take things so personally. If you were to read the comment properly, you'd see I gave you the exact keywords to search for in the manual. subset
and samples
are the keywords you need to get to where you want. Use those and you won't be stuck.
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
bcftools is the go to for me in such cases.
a bit more details would be much appreciated, as I studied it, but without any success.
You need to study and experiment with it more, then. It's a pretty straightforward tool.
I've edited my answer above