How to extract all the IDs of VCF file for GWAS analyses?
1
Hi,
How can I extract the genotyped ID out of the VCF file?
I need to select a subset of samples for GWAS analyses.
Thanks!
VCF
GWAS
ID
sample
• 1.7k views
Take a look:
bcftools view -h Merge.UnFiltered.TumorOnly.vcf.gz | tail -1 ;
..or:
bcftools view -h Merge.UnFiltered.TumorOnly.vcf.gz | tail -1 |\
awk -F "\t" '{for (i=1; i<=NF; i++) {if (i>9) {print $(i)}}}' ;
1174-N
1174-T
1292_CD19-T
1292_noCD19-N
1299-N
1299-T
1347-N
1347-T
1378-N
1378-T
1584-N
1584-T
1696-N
1696-T
1700-N
1700-T
1823-N
1823-T
2111-N
2111-T
...
...or:
bcftools view -h Merge.UnFiltered.TumorOnly.vcf.gz | tail -1 |\
sed 's/\t/\n/g' | sed '1,9d' ;
1174-N
1174-T
1292_CD19-T
1292_noCD19-N
1299-N
1299-T
1347-N
1347-T
1378-N
1378-T
1584-N
1584-T
1696-N
1696-T
1700-N
1700-T
1823-N
1823-T
2111-N
2111-T
...
Kevin
Login before adding your answer.
Traffic: 3483 users visited in the last hour
How to extract info of samples of interest from VCF file?
Hi Kevin,
The problem is slightly different. Here I only want the list IDs, not VCF file containing information of a subset of IDs.
Some simple way to extract all IDs? Thanks!
what do you mean with ID ? ID is the 3rd column of the VCF.