Entering edit mode
5.0 years ago
gprashant17
▴
110
I would like to filter variants from a VCF file for only specific samples. I have a file (sample_file.txt) that contains a single column of the required Sample IDs.
I used this command:
./bcftools view --force-samples sample_file.txt file.vcf > output.vcf
But I get this error:
Failed to read from sample_file.txt: unknown file type
Should the sample file also contain any header information?
Running the command to view the head of the sample file gives me this:
head sample_file.txt
GTEX-111CU
GTEX-111FC
GTEX-111VG
GTEX-111YS
GTEX-1122O
GTEX-1128S
GTEX-117YX
GTEX-11DXX
GTEX-11DZ1
GTEX-11EI6
Further, I would also like to generate a genotype matrix with GT attribute. Is there any command for this?