saigegit / SAIGE

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

Error in paste("This is a", AnalysisType, "level analysis.") : object 'AnalysisType' not found Calls: SPAGMMATtest -> SAIGE.Region -> paste #81

Open daniel-hui opened 1 year ago

daniel-hui commented 1 year ago

Hi,

I'm trying to run step2_SPAtests.R but am getting an error:

Error in paste("This is a", AnalysisType, "level analysis.") :
  object 'AnalysisType' not found
Calls: SPAGMMATtest -> SAIGE.Region -> paste

Below is the command I use (with paths changed): Rscript step2_SPAtests.R --bedFile=chr8_mac1.bed --bimFile=chr8_mac1_nodup.bim --famFile=chr8_mac1.fam --SAIGEOutputFile=results_SAIGE_rare/rare_mac1_PCs1-2 --chrom=8 --AlleleOrder=alt-first --GMMATmodelFile=SAIGE_GRMs/rare_mac1_PCs1-2.rda --varianceRatioFile=SAIGE_GRMs/rare_mac1_PCs1-2.varianceRatio.txt --sparseGRMFile=SAIGE_GRMs/sparseGRM_allChr_maf.01_rm3plus_geno.001_500kb-1-.10_relatednessCutoff_0.125_2000_randomMarkersUsed.sparseGRM.mtx --sparseGRMSampleIDFile=SAIGE_GRMs/sparseGRM_allChr_maf.01_rm3plus_geno.001_500kb-1-.10_relatednessCutoff_0.125_2000_randomMarkersUsed.sparseGRM.mtx.sampleIDs.txt --groupFile=SAIGE_plofs_missense.txt --annotation_in_groupTest=lof,lof:missense --maxMAF_in_groupTest=0.10,0.01,0.001 --is_output_markerList_in_groupTest=TRUE --LOCO=TRUE

Any ideas on what the issue is? Thanks -- below is the full log:

Loading required package: RhpcBLASctl
R version 3.6.3 (2020-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /misc/appl/openblas-0.3.9/lib/libopenblas_haswellp-r0.3.9.dev.so

locale:
[1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
[3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
[5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8  
[7] LC_PAPER=en_US.UTF-8       LC_NAME=C                
[9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C      

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base    

other attached packages:
[1] data.table_1.14.6      optparse_1.7.1         RhpcBLASctl_0.21-247.1
[4] SAIGE_1.1.6.1        

loaded via a namespace (and not attached):
[1] compiler_3.6.3     Matrix_1.3-4       Rcpp_1.0.9         getopt_1.20.3    
[5] grid_3.6.3         RcppParallel_5.1.4 lattice_0.20-45  
$vcfFile
[1] ""

$vcfFileIndex
[1] ""

$vcfField
[1] "DS"

$savFile
[1] ""

$savFileIndex
[1] ""

$bgenFile
[1] ""

$bgenFileIndex
[1] ""

$sampleFile
[1] ""

$bedFile
[1] "chr8_mac1.bed"

$bimFile
[1] "chr8_mac1_nodup.bim"

$famFile
[1] "chr8_mac1.fam"

$AlleleOrder
[1] "alt-first"

$idstoIncludeFile
[1] ""

$rangestoIncludeFile
[1] ""

$chrom
[1] "8"

$is_imputed_data
[1] FALSE

$minMAF
[1] 0

$minMAC
[1] 0.5

$minGroupMAC_in_BurdenTest
[1] 5

$minInfo
[1] 0

$maxMissing
[1] 0.15

$impute_method
[1] "best_guess"

$LOCO
[1] TRUE

$GMMATmodelFile
[1] "SAIGE_GRMs/Subject_Measurement.WBC..num..1e9_per_L_rare_mac1_PCs1-2.rda"

$varianceRatioFile
[1] "SAIGE_GRMs/Subject_Measurement.WBC..num..1e9_per_L_rare_mac1_PCs1-2.varianceRatio.txt"

$SAIGEOutputFile
[1] "results_SAIGE_rare/Subject_Measurement.WBC..num..1e9_per_L_chr8_rare_mac1_PCs1-2"

$markers_per_chunk
[1] 10000

$groups_per_chunk
[1] 100

$is_output_moreDetails
[1] FALSE

$is_overwrite_output
[1] TRUE

$maxMAF_in_groupTest
[1] "0.10,0.01,0.001"

$maxMAC_in_groupTest
[1] "0"

$annotation_in_groupTest
[1] "lof,lof:missense"

$groupFile
[1] "SAIGE_plofs_missense.txt"

$sparseGRMFile
[1] "SAIGE_GRMs/sparseGRM_allChr_maf.01_rm3plus_geno.001_500kb-1-.10_relatednessCutoff_0.125_2000_randomMarkersUsed.sparseGRM.mtx"

$sparseGRMSampleIDFile
[1] "SAIGE_GRMs/sparseGRM_allChr_maf.01_rm3plus_geno.001_500kb-1-.10_relatednessCutoff_0.125_2000_randomMarkersUsed.sparseGRM.mtx.sampleIDs.txt"

$relatednessCutoff
[1] 0

$MACCutoff_to_CollapseUltraRare
[1] 10

$cateVarRatioMinMACVecExclude
[1] "10,20.5"

$cateVarRatioMaxMACVecInclude
[1] "20.5"

$weights.beta
[1] "1,25"

$r.corr
[1] 0

$markers_per_chunk_in_groupTest
[1] 100

$condition
[1] ""

$SPAcutoff
[1] 2

$dosage_zerod_cutoff
[1] 0.2

$dosage_zerod_MAC_cutoff
[1] 10

$is_single_in_groupTest
[1] FALSE

$is_no_weight_in_groupTest
[1] FALSE

$is_output_markerList_in_groupTest
[1] TRUE

$is_Firth_beta
[1] FALSE

$pCutoffforFirth
[1] 0.01

$is_fastTest
[1] FALSE

$max_MAC_for_ER
[1] 4

$subSampleFile
[1] ""

$help
[1] FALSE

[1] "opt$r.corr"
[1] 0
dosage_zerod_cutoff  0.2
Any dosages <=  0.2  for genetic variants with MAC <=  10  are set to be 0 in group tests
group-based test will be performed
Ultra rare variants with MAC <=  10  will be collpased for set-based tests in the 'absence or presence' way.
Leave chromosome  8  out will be applied
chromosome  1  model results are removed to save memory
chromosome  2  model results are removed to save memory
chromosome  3  model results are removed to save memory
chromosome  4  model results are removed to save memory
chromosome  5  model results are removed to save memory
chromosome  6  model results are removed to save memory
chromosome  7  model results are removed to save memory
chromosome  9  model results are removed to save memory
chromosome  10  model results are removed to save memory
chromosome  11  model results are removed to save memory
chromosome  12  model results are removed to save memory
chromosome  13  model results are removed to save memory
chromosome  14  model results are removed to save memory
chromosome  15  model results are removed to save memory
chromosome  16  model results are removed to save memory
chromosome  17  model results are removed to save memory
chromosome  18  model results are removed to save memory
chromosome  19  model results are removed to save memory
chromosome  20  model results are removed to save memory
chromosome  21  model results are removed to save memory
chromosome  22  model results are removed to save memory
length(sparseGRMSampleID$IndexGRM):  6280
nrow(sparseGRMSampleID):  6280
2228  samples have been used to fit the glmm null model
[1] 2228    3
        IID IndexInModel IndexGRM
1 NWD100165            1        4
2 NWD101008            2        6
3 NWD101034            3        7
4 NWD101487            4       13
5 NWD101643            5       14
6 NWD101890            6       15
[1] "Subsetting GRM"
variance Ratio null is  1.136323 1.11265
dosageFile type is  plink
allele order in the plink file is  alt-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 SAIGE_plofs_missense.txt ....
indexChunk is  0
indexChunk  0
nRegions  17222
2235  markers in 'RegionFile' are not in 'GenoFile'.
Read in  100  region(s) from the group file.
A1BG  is empty.
A1CF  is empty.
A2M  is empty.
A2ML1  is empty.
A2MP1  is empty.
A3GALT2  is empty.
A4GALT  is empty.
A4GNT  is empty.
AAAS  is empty.
AACS  is empty.
AACSP1  is empty.
AADAC  is empty.
AADACL2  is empty.
AADACL3  is empty.
AADACL4  is empty.
AADAT  is empty.
AAGAB  is empty.
AAK1  is empty.
AANAT  is empty.
AAR2  is empty.
[1] "Analyzing Region AARD (21/17222)."
AARS1  is empty.
AARS2  is empty.
AARSD1  is empty.
AASDH  is empty.
AASDHPPT  is empty.
AASS  is empty.
AATF  is empty.
AATK  is empty.
ABAT  is empty.
ABCA1  is empty.
ABCA10  is empty.
ABCA12  is empty.
ABCA13  is empty.
ABCA17P  is empty.
ABCA2  is empty.
ABCA3  is empty.
ABCA4  is empty.
ABCA5  is empty.
ABCA6  is empty.
ABCA7  is empty.
ABCA8  is empty.
ABCA9  is empty.
ABCB1  is empty.
ABCB10  is empty.
ABCB11  is empty.
ABCB4  is empty.
ABCB5  is empty.
ABCB6  is empty.
ABCB8  is empty.
ABCB9  is empty.
ABCC1  is empty.
ABCC10  is empty.
ABCC11  is empty.
ABCC12  is empty.
ABCC13  is empty.
ABCC2  is empty.
ABCC3  is empty.
ABCC4  is empty.
ABCC5  is empty.
ABCC6  is empty.
ABCC6P1  is empty.
ABCC8  is empty.
ABCC9  is empty.
ABCD1P2  is empty.
ABCD1P4  is empty.
ABCD2  is empty.
ABCD3  is empty.
ABCD4  is empty.
ABCE1  is empty.
ABCF1  is empty.
ABCF2  is empty.
ABCF3  is empty.
ABCG1  is empty.
ABCG2  is empty.
ABCG4  is empty.
ABCG5  is empty.
ABCG8  is empty.
ABHD1  is empty.
ABHD10  is empty.
ABHD11  is empty.
ABHD12  is empty.
ABHD12B  is empty.
ABHD14A  is empty.
ABHD14B  is empty.
ABHD15  is empty.
ABHD16A  is empty.
ABHD16B  is empty.
ABHD18  is empty.
ABHD2  is empty.
ABHD3  is empty.
ABHD4  is empty.
ABHD5  is empty.
ABHD6  is empty.
ABHD8  is empty.
ABI1  is empty.
ABI2  is empty.
ABI3  is empty.
ABI3BP  is empty.
ABITRAM  is empty.
Error in paste("This is a", AnalysisType, "level analysis.") :
  object 'AnalysisType' not found
Calls: SPAGMMATtest -> SAIGE.Region -> paste
Execution halted
daniel-hui commented 1 year ago

Still having issues with this. I tried removed the gene it seems to be failing on (e.g., ABITRAM in this example) and only keeping the gene that seems to be working (e.g., AARD) but it still gives the same error. Other users are also having this issue (https://github.com/saigegit/SAIGE/issues/56).

daniel-hui commented 1 year ago

If it's any help...

I made the changes

message2 = "message2"
message3 = "message3"
message4 = "message4"

in lines 814-816 of SAIGE_SPATest_Region.R, it runs successfully but the results files are empty. Also, the gene that it crashes on always seems to be the 200th gene. Giving up for now.