GWASTools vcfWrite function
1
0
Entering edit mode
@stephanie-m-gogarten-5121
Last seen 28 days ago
University of Washington

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 • 897 views
ADD COMMENT
0
Entering edit mode
@stephanie-m-gogarten-5121
Last seen 28 days ago
University of Washington

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 COMMENT

Login before adding your answer.

Traffic: 970 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6