Asked by a user via email:
When I used GWASTools to convert gds file to vcf file, my VCF file did not include scanID, allele and allele. Could you let me know why? I used vcfWrite function.
My gds file is imputed gwas 1000 dosage file which created by GWASTools.
Please see the following code and warning message:
> library(GWASTools)
> gds.fn <- "chr-22.gds"
> geno <- GdsGenotypeReader(gds.fn)
> genoData <- GenotypeData(geno)
> genoData
An object of class GenotypeData
| data:
File: chr-22.gds (1.4G)
+ [ ]
|--+ sample.id { Int32 12803, 50.0K }
|--+ snp.id { Int32 711309, 2.7M }
|--+ snp.chromosome { Int32 711309, 2.7M }
|--+ snp.position { Int32 711309, 2.7M }
|--+ snp.allele { VStr8 711309, 2.9M }
\--+ genotype { Float32 12803x711309 ZIP(4.04%), 1.4G } *
| SNP Annotation:
NULL
| Scan Annotation:
NULL
> vcfWrite(genoData, vcf.file="out22.vcf", sample.col="scanID",id.col="snpID", qual.col=NULL, filter.cols=NULL,info.cols=NULL, scan.exclude=NULL, snp.exclude=NULL,scan.order=NULL, ref.allele=NULL, block.size=5000, verbose=TRUE)
Block 1 of 143... 5000 SNPs
Block 2 of 143... 5000 SNPs
Block 3 of 143... 5000 SNPs
^C
Warning messages:
1: In getSnpVariable(genoData, id.col) : snp annotation not found
2: In getScanVariable(genoData, sample.col) : scan annotation not found
Final vcf file has no scanID:
##fileformat=VCFv4.1
##fileDate=2018-04-30
##source=GWASTools::vcfWrite()
##FORMAT=<ID=GT,Number=1,Type=String,Description="Genotype">
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT
22 16050115 . . . GT 1.99800002574921