Closed complexgenome closed 3 years ago
You misuse SAIGEgds, please see:
http://www.bioconductor.org/packages/release/bioc/vignettes/SAIGEgds/inst/doc/SAIGEgds.html#preparing-snp-data-for-genetic-relationship-matrix
SAIGEgds does not use the resulting GDS from snpgdsGRM()
.
And you could use seqSNP2GDS()
in SeqArray to convert SNPRelate GDS to SeqArray GDS.
Thank you. I updated my pipeline as:
library(SNPRelate)
bed.fn<-"updated_mafed.bed"
fam.fn<-"updated_mafed.fam"
bim.fn<-"updated_mafed.bim"
#convert
snpgdsBED2GDS(bed.fn, fam.fn, bim.fn, "MAFed_kinship.gds") ## create gds from SNP data
seqSNP2GDS("MAFed_kinship.gds", "SEQ_MHAS.gds") ## convert SNP gds to seq array
gds <- seqOpen( "SEQ_MHAS.gds") #open
snpset <- snpgdsLDpruning(gds)
snpset.id <- unlist(snpset, use.names=FALSE) # get the variant IDs of a LD-pruned set
head(snpset.id)
grm_fn <- "seqarray_grm_geno.gds" # output file name
seqSetFilter(gds, variant.id=snpset.id)
##export to a GDS genotype file without annotation data
seqExport(gds, grm_fn, info.var=character(), fmt.var=character(), samp.var=character())
seqClose(gds)
I have following questions: 1- Is this workflow correct?
2- is the GRM in .gds read and fitted into the null model as a square matrix?
#convert
snpgdsBED2GDS(bed.fn, fam.fn, bim.fn, "MAFed_kinship.gds") ## create gds from SNP data
seqSNP2GDS("MAFed_kinship.gds", "SEQ_MHAS.gds") ## convert SNP gds to seq array
Please use SeqArray::seqBED2GDS()
directly convert the PLINK dataset to SeqArray GDS:
seqBED2GDS(bed.fn, fam.fn, bim.fn, out.gdsfn, compress.geno="LZMA_RA",
compress.annotation="LZMA_RA", chr.conv=TRUE, optimize=TRUE, digest=TRUE,
parallel=FALSE, verbose=TRUE)
create GRM in .gds file format
Fit model
Error:
Resource: https://uw-gac.github.io/topmed_workshop_2017/computing-a-grm.html
I understand I do not have SEQ data, but genotyped data. Error in
seqOpen(gdsfile)
cannot work on genotyped data. I would not like to convert genotype data into vcf and re-run complete pipeline.Any points to proceed further?