jiabowang / GAPIT

Genome Association Predict Integrate Tools
168 stars 53 forks source link

Issues with hapmap format #141

Open jensenjoseph opened 2 months ago

jensenjoseph commented 2 months ago

Hello,

I'm getting the following error with the hapmap format on some new data that I'm trying to run along with old data that has worked in the past.

Error in FUN(newX[, i], ...) : invalid 'type' (character) of argument

I was able to recode my genotyping data to the numeric system and it appears to be working but I thought I should bring this error to your attention. I tried messing with my head setting when loading in the data but that didn't help and I made sure I'm loading in the most current version of GAPIT from GitHub. Let me know if I need to share my files to help with with.

Thank you

jiabowang commented 1 month ago

Please check whether there are multiple mutation in the HapMap file.If you can code a function to convert your HapMap file to numeric file. That will be OK. The numeric format should be payed attention. There are no-missing values or NA in the numeric file.

jensenjoseph commented 23 hours ago

It looks like something might be wrong with my transformation code and nothing has changed on being able to run the HapMap format. It also looks like the error is happening earlier in the code now as well.

"--------------------- Welcome to GAPIT ----------------------------" [1] "FarmCPU" [1] "--------------------Processing traits----------------------------------" [1] "Phenotype provided!" [1] "The 1 model in all." [1] "FarmCPU" [1] "GAPIT.DP in process..." [1] "Converting genotype..." [1] "Converting HapMap format to numerical under model of Major" [1] "Perform numericalization" [1] "Succesfuly finished converting HapMap which has bits of 2" [1] "Converting genotype done." Error in FUN(newX[, i], ...) : invalid 'type' (character) of argument In addition: Warning messages: 1: 'memory.size()' is no longer supported 2: 'memory.size()' is no longer supported 3: 'memory.size()' is no longer supported 4: 'memory.size()' is no longer supported 5: 'memory.size()' is no longer supported 6: 'memory.size()' is no longer supported 7: 'memory.size()' is no longer supported 8: In order(as.numeric(as.character(chor_taxa))) : NAs introduced by coercion 9: In unique(as.numeric(as.matrix(GD[sample(1:nrow(GD), 5), ]))) : NAs introduced by coercion

jiabowang commented 15 hours ago

Please try traceback() and paste what did R report.

jensenjoseph commented 2 hours ago

I had some more time to play around with it and it looks like SNP.impute may have been causing some of my problems so I removed that. I've attached the traceback data as well but thank you for your help.

Step 2: Run GAPIT

by continent

myGAPIT <- GAPIT(

  • Y=myY,
  • G=myG,
  • SNP.impute = "Major",
  • PCA.total=0,
  • group.from = 167,
  • group.to = 167,
  • group.by = 1,
  • model = c("FarmCPU"),
  • Major.allele.zero = TRUE
  • ) [1] "--------------------- Welcome to GAPIT ----------------------------" [1] "FarmCPU" [1] "--------------------Processing traits----------------------------------" [1] "Phenotype provided!" [1] "The 1 model in all." [1] "FarmCPU" [1] "GAPIT.DP in process..." [1] "Converting genotype..." [1] "Converting HapMap format to numerical under model of Major" [1] "Perform numericalization" [1] "Succesfuly finished converting HapMap which has bits of 2" [1] "Converting genotype done." Error in FUN(newX[, i], ...) : invalid 'type' (character) of argument In addition: Warning messages: 1: 'memory.size()' is no longer supported 2: 'memory.size()' is no longer supported 3: 'memory.size()' is no longer supported 4: 'memory.size()' is no longer supported 5: 'memory.size()' is no longer supported 6: 'memory.size()' is no longer supported 7: 'memory.size()' is no longer supported 8: In order(as.numeric(as.character(chor_taxa))) : NAs introduced by coercion 9: In unique(as.numeric(as.matrix(GD[sample(1:nrow(GD), 5), ]))) : NAs introduced by coercion traceback() 4: apply(GD, 2, sum) 3: GAPIT.Genotype(G = G, GD = GD, GM = GM, KI = KI, PCA.total = PCA.total, kinship.algorithm = kinship.algorithm, SNP.fraction = SNP.fraction, SNP.test = FALSE, file.path = file.path, file.from = file.from, file.to = file.to, file.total = file.total, file.fragment = file.fragment, file.G = file.G, file.Ext.G = file.Ext.G, file.GD = file.GD, file.GM = file.GM, file.Ext.GD = file.Ext.GD, file.Ext.GM = file.Ext.GM, SNP.MAF = SNP.MAF, FDR.Rate = FDR.Rate, SNP.FDR = SNP.FDR, SNP.effect = SNP.effect, SNP.impute = SNP.impute, NJtree.group = NJtree.group, NJtree.type = NJtree.type, LD.chromosome = LD.chromosome, LD.location = LD.location, LD.range = LD.range, PCA.legend = PCA.legend, GP = GP, GK = GK, bin.size = NULL, inclosure.size = NULL, WS0 = WS0, Aver.Dis = Aver.Dis, sangwich.top = sangwich.top, sangwich.bottom = sangwich.bottom, GTindex = NULL, file.output = file.output, Create.indicator = Create.indicator, Major.allele.zero = Major.allele.zero, Geno.View.output = Geno.View.output, PCA.col = PCA.col, PCA.3d = PCA.3d) 2: GAPIT.DP(G = G, GD = GD, GM = GM, KI = KI0, Z = Z, CV = CV, CV.Extragenetic = CV.Extragenetic, group.from = group.from, group.to = group.to, group.by = group.by, FDRcut = FDRcut, Major.allele.zero = Major.allele.zero, kinship.cluster = kinship.cluster, kinship.group = kinship.group, kinship.algorithm = kinship.algorithm, NJtree.group = NJtree.group, NJtree.type = NJtree.type, PCA.col = PCA.col, PCA.3d = PCA.3d, sangwich.top = sangwich.top, sangwich.bottom = sangwich.bottom, bin.from = bin.from, bin.to = bin.to, bin.by = bin.by, inclosure.from = inclosure.from, inclosure.to = inclosure.to, inclosure.by = inclosure.by, SNP.P3D = SNP.P3D, SNP.effect = SNP.effect, SNP.impute = SNP.impute, PCA.total = PCA.total, SNP.fraction = SNP.fraction, seed = NULL, SNP.test = SNP.test, SNP.MAF = SNP.MAF, FDR.Rate = 1, SNP.FDR = SNP.FDR, Inter.Plot = Inter.Plot, Inter.type = Inter.type, N.sig = N.sig, Multi_iter = Multi_iter, num_regwas = num_regwas, QTN.gs = QTN.gs, cutOff = cutOff, Model.selection = Model.selection, output.numerical = output.numerical, Random.model = Random.model, PCA.legend = PCA.legend, PCA.View.output = PCA.View.output, WS0 = WS0, Aver.Dis = Aver.Dis, memo = memo0, WS = WS, maxOut = maxOut, QTN.position = QTN.position, output.hapmap = output.hapmap, file.output = file.output, Geno.View.output = Geno.View.output, SUPER_GS = SUPER_GS, model = model) 1: GAPIT(Y = myY, G = myG, SNP.impute = "Major", PCA.total = 0, group.from = 167, group.to = 167, group.by = 1, model = c("FarmCPU"), Major.allele.zero = TRUE)