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

Issue with SNP Effect Calculation in GAPIT 3.4 #163

Open
PetrosRoth opened this issue Dec 3, 2024 · 5 comments
Open

Issue with SNP Effect Calculation in GAPIT 3.4 #163

PetrosRoth opened this issue Dec 3, 2024 · 5 comments

Comments

@PetrosRoth
Copy link

Dear Dr. Jiabo Wang,

I have been using GAPIT 3.4 to perform GWAS in a wheat panel and have encountered an issue regarding the SNP effect calculation.

After reading the user manual, I set the major.allele.zero argument to TRUE. However, I have found several cases where, although the minor allele shows a beneficial effect based on the distribution plots, the calculated effect size is negative. According to the manual, setting major.allele.zero = TRUE should mean that the sign of the allelic effect estimate is with respect to the minor allele. In other words, a positive allelic effect estimate should indicate that the minor allele is favorable. However, in the case I am attaching below, this is not the case.

For context, I am importing my genotypic data in Hapmap format. Everything else appears to work correctly.

Could you please provide guidance on this issue?

Thank you in advance for your kind help.

Best regards,
Petros

image

image

@jiabowang
Copy link
Owner

Hi Petros,
Thanks for your report.
Recently, we also have observed the mistake in converting HapMap genotype to numeric genotype. In some case, it does not work. So we fixed this BUG.
Could you tell me whether you used the newest GAPIT function?
Please source("https://github.com/jiabowang/GAPIT/blob/master/gapit_functions.txt")
Now this link is same as ZZLAB GAPIT link.
After converting, you can use below code to validate.

myGAPIT<-GAPIT(G=myG,PCA.total=0,kinship.algorithm="",Major.allele.zero = T,file.output=F)# or Major.allele.zero = F
myGD=myGAPIT$GD
i=9 # this number can be random set
table(myGD[,i])
table(as.character(myG[i,-c(1:11)]))

In our case, the genotype were accurately converted.

@PetrosRoth
Copy link
Author

Thank you so much for your reply.

So far, we have not converted the HapMap genotype to numeric format first. Instead, we directly called the GAPIT function using the following code:

gwas_results <- GAPIT(
Y = phenotype_data,
G = gen_data, # HapMap format
model = "BLINK",
PCA.total = 0,
file.output = TRUE,
Major.allele.zero = TRUE
)
Do you suggest converting the genotype data to numeric format separately before running GWAS?

I will also make sure that we use the correct source file.

Thanks again,
Petros

@jiabowang
Copy link
Owner

Yes, please convert your HapMap file to numeric format at first. Then check whether genotype is correct.
At last, run GAPIT with correct genotype with phenotype. So that the result can be considered as correct.

@PetrosRoth
Copy link
Author

Dear Jiabo,

Thank you very much for your help with this.

I followed the steps you suggested, but I noticed another issue after sourcing from https://github.com/jiabowang/GAPIT/blob/master/gapit_functions.txt

The issue I am having now concerns MAF and heterozygosity. As shown in the plot below, I have many SNPs with MAF = 0.5 and heterozygosity = 1. It’s worth noting that when I ran GAPIT in the older version, the graph did not look like this.

image

Upon checking the tables and genotypic files, I found that this is happening to all monomorphic markers. Below, you can find the table with heterozygosity values and MAF as exported by GAPIT, along with the respective genotypes based on the GD file. Therefore it appears that all monomorphic SNPs got MAF=0.5 and heterozygosity=1.

image

image

Could you please look into this?

Thank you in advance for your kind help!

Best regards,
Petros

@jiabowang
Copy link
Owner

Hi Petros,
Thanks for your figure. That is an estimation mistake for those monomorphic genotype. Now I have fixed it. Please try again with the new GAPIT function.
https://raw.githubusercontent.com/jiabowang/GAPIT/refs/heads/master/gapit_functions.txt

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