Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flipped $ref and $alt when converting plink binary files to gds format #96

Open
ryshi06 opened this issue Sep 9, 2024 · 2 comments
Open

Comments

@ryshi06
Copy link

ryshi06 commented Sep 9, 2024

No description provided.

@ryshi06
Copy link
Author

ryshi06 commented Sep 9, 2024

Hi, I was trying to convert plink binary files to gds with the command

SeqArray::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),

the command works for most of the SNVs, but it failed for some SNVs as it flipped the ref and alt. For example, the SNV rs12404190 has bim record: 1 rs12404190 0 105020628 G A, and from dbSNP, it shows the reference allele should be G, and the alt should be A. However, when I used the following command to rename the SNPs, it gives me 1-105020628-A-G.

CHR <- as.numeric(seqGetData(genofile, "chromosome")) position <- as.integer(seqGetData(genofile, "position")) REF <- as.character(seqGetData(genofile, "$ref")) ALT <- as.character(seqGetData(genofile, "$alt")) VarInfo_genome <- paste0(CHR,"-",position,"-",REF,"-",ALT)

Is there a way to fix this? Thanks!

Best,
Ruyu

@zhengxwen
Copy link
Owner

Currently, SeqArray has no function to flip the reference and alternative alleles.
You could flip the alleles using PLINK, e.g, https://www.cog-genomics.org/plink/2.0/data#ref_allele

In the early version of PLINK, the allele columns in BIM are defined as the minor and major.
The recent version of PLINK has allowed users to use the ref and alt in the BIM file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants