zhengxwen / SNPRelate

R package: parallel computing toolset for relatedness and principal component analysis of SNP data (Development version only)
http://www.bioconductor.org/packages/SNPRelate
98 stars 25 forks source link

snpgdsGDS2PED() sample annotation #47

Closed AAvalos82 closed 4 years ago

AAvalos82 commented 5 years ago

Is it intended for the function snpgdsGDS2PED() to discard sample annotation fields from the GDS when creating corresponding PED files?

I have a snp GDS where I have added a data frame containing phenotype and family IDs manually following the tutorial but when I try to output PLINK format files it seems to not consider any of the annotation fields. The result is a PED file where annotation columns are 0-filled (or -9 in the case of the phenotype).

smgogarten commented 5 years ago

You could try using plinkWrite() in the GWASTools package. You would need to create a ScanAnnotationDataFrame object with your annotation and then combine it with the GDS in a GenotypeData object.

AAvalos82 commented 5 years ago

Thank you, that approach worked once I realized I was hitting the "chromosome labels are hard-coded" wall. Since I study a non-model organism, that wall and I are old friends.