saigegit / SAIGE

Development for SAIGE and SAIGE-GENE(+)
GNU General Public License v3.0
64 stars 26 forks source link

Error in SPAGMMATtest ... merge bmerge Incompatible join types: x.ID (integer) and i.SNP (character) #137

Open alix-lacoste opened 5 months ago

alix-lacoste commented 5 months ago

Hello, I'm getting a cryptic error that I believe is related to reading the groupFile. The groupFile is properly formatted, so I don't know who could be causing the typing error. Here are the most recent logs producing the error: Thank you in advance for the help

chromosome  21  model results are removed to save memory
chromosome  22  model results are removed to save memory
P-values of genetic variants with MAC <=  4  will be calculated via effecient resampling.
variance Ratio null is  0.8724423 
dosageFile type is  plink 
allele order in the plink file is  ref-first .
Reading bim file....
Reading fam file....
Setting position of samples in PLINK files....
Start  TRUE 
End  FALSE 
SKAT-O test will be performed. P-values for BURDEN and SKAT tests will also be output
is_single_in_groupTest = TRUE. Single-variant assoc tests results will be output
Start extracting marker-level information from 'groupFile' of groupFile.txt ....
indexChunk is  0 
indexChunk  0 
nRegions  3736 
Error in bmerge(i, x, leftcols, rightcols, roll, rollends, nomatch, mult,  : 
  Incompatible join types: x.ID (integer) and i.SNP (character)
Calls: SPAGMMATtest ... merge -> merge.data.table -> [ -> [.data.table -> bmerge
Execution halted

Note that I formatted the groupFile according to the doc and the example files, which is chr:pos:ref:alt, NOT according to the helper function, which shows chr:pos_ref/alt

My command is the following:

step2_SPAtests.R \
      --bedFile=plink_step_2.bed \
      --bimFile=plink_step_2.bim \
      --famFile=plink_step_2.fam \
      --AlleleOrder=ref-first \
      --minMAF=0 \
      --minMAC=0.5 \
      --GMMATmodelFile=step_1_output.rda \
      --varianceRatioFile=step_1_output.varianceRatio.txt \
      --groupFile=groupFile.txt \
      --annotation_in_groupTest="ptv;ptv,missense-path" \
      --maxMAF_in_groupTest=0.1 \
      --r.corr=0 \
      --chrom=1 \
      --OutputFile=step_2_out
alix-lacoste commented 5 months ago

I believe I found the issue (based on browsing through previous issues, such as @evatosco's response here). It looks like the variant IDs in the plink files need to be strings; mine were integers.