I've been trying to take some samples out of a file but it appears its only taken some of the information out. When I tried to run a code I had in R that works for all the samples it gave me an error about the number of samples not matching the population map file which I also updated. When I opened the vcf in excel I noticed that there was still columns for what I removed from the file. perhaps I didn't properly remove everything? The file is smaller and a lot of snps are deleted however there's a bit of leftover data from the 3 files I thought I removed.
I used the following code
bcftools query -l filename.vcf| grep "file1\|file2\|etc\|"> Fall22C.txt #(For what I wanted to keep) bcftools view -S Fall22C.txt Fall22beetle.vcf > Fall22C.vcf #To make a new file
Error in R:
Error in `pop<-`(`*tmp*`, value = c("AL", "AL", "VA", "VA", "VA", "GA", : Vector length does no match number of individuals"