Question: GWASTools vcfWrite function
0
gravatar for Stephanie M. Gogarten
15 months ago by
University of Washington
Stephanie M. Gogarten670 wrote:

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
gwastools • 200 views
ADD COMMENTlink modified 15 months ago • written 15 months ago by Stephanie M. Gogarten670
Answer: GWASTools vcfWrite function
0
gravatar for Stephanie M. Gogarten
15 months ago by
University of Washington
Stephanie M. Gogarten670 wrote:

Note the warning messages in your output:

1: In getSnpVariable(genoData, id.col) : snp annotation not found
2: In getScanVariable(genoData, sample.col) : scan annotation not found

You need to include scan annotation and SNP annotation in your GenotypeData object in order to get scanID and alleles in your output. Unfortunately the function is not smart enough to look in the GDS file itself for scanID if you specify sample.col="scanID"; it calls the getScanVariable function which only looks in the scan annotation. (The same is true for the alleles and SNP annotation.)

ADD COMMENTlink written 15 months ago by Stephanie M. Gogarten670
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 164 users visited in the last hour