gosianow/DRIMSeq

dmTest() error in tuQTL analysis

Closed this issue · 1 comments

Hi!

I'm performing a tuQLT analysis following the model in DRIMSeq vignette. I formatted my objects to be in the requirements of packages functions and I selected only the SNPs from chromosome 1 just as an example. I'm getting the following error message when I perform the dmTest function:

library(DRIMSeq)
#> 
#> Attaching package: 'DRIMSeq'
#> The following object is masked from 'package:base':
#> 
#>     proportions

# ann = samples df
# genotypes = genotypes df for chr 1 (only SNPs in biallelic sites)
# g_rng = GRange object for gene coordinates in chr 1
# rng = GRange object for SNPs coordinates
# cts = counts df, in scaledTPM 

# Build dmSQTL object 
w <- 5000
d <- dmSQTLdata(counts = cts, gene_ranges = g_rng,
                genotypes = genotypes, snp_ranges = rng,
                samples = ann, window = w)

# Filter transcritps
# Get the minimal number of samples where genes should be expressed. I'm using 70% of group samples.
min_samples <- floor(length(ann$sample_id) * 0.7)
d <- dmFilter(d, min_samps_gene_expr = min_samples, min_samps_feature_expr = 5,
              minor_allele_freq = 5, min_gene_expr = 10, min_feature_expr = 10)

# get the first 10 genes 
d <- d[1:10,]

# Estimate precision
d <- dmPrecision(d)
#> ! Using a subset of 0.1 genes to estimate common precision !
#> ! Using common_precision = 8.1306 as prec_init !

# Fit model
d <- dmFit(d)

# Test
d <- dmTest(d)
#> Error in rbind(deparse.level, ...): numbers of columns of arguments do not match

Created on 2020-07-14 by the reprex package (v0.3.0)

Session info
devtools::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value                       
#>  version  R version 4.0.0 (2020-04-24)
#>  os       Linux Mint 19               
#>  system   x86_64, linux-gnu           
#>  ui       X11                         
#>  language en                          
#>  collate  pt_BR.UTF-8                 
#>  ctype    pt_BR.UTF-8                 
#>  tz       America/Recife              
#>  date     2020-07-14                  
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package          * version  date       lib source        
#>  assertthat         0.2.1    2019-03-21 [1] CRAN (R 4.0.0)
#>  backports          1.1.8    2020-06-17 [1] CRAN (R 4.0.0)
#>  BiocGenerics       0.34.0   2020-04-27 [1] Bioconductor  
#>  BiocParallel       1.22.0   2020-04-27 [1] Bioconductor  
#>  bitops             1.0-6    2013-08-17 [1] CRAN (R 4.0.0)
#>  callr              3.4.3    2020-03-28 [1] CRAN (R 4.0.0)
#>  cli                2.0.2    2020-02-28 [1] CRAN (R 4.0.0)
#>  colorspace         1.4-1    2019-03-18 [1] CRAN (R 4.0.0)
#>  crayon             1.3.4    2017-09-16 [1] CRAN (R 4.0.0)
#>  desc               1.2.0    2018-05-01 [1] CRAN (R 4.0.0)
#>  devtools           2.3.0    2020-04-10 [1] CRAN (R 4.0.0)
#>  digest             0.6.25   2020-02-23 [1] CRAN (R 4.0.0)
#>  dplyr              1.0.0    2020-05-29 [1] CRAN (R 4.0.0)
#>  DRIMSeq          * 1.16.0   2020-04-27 [1] Bioconductor  
#>  edgeR              3.30.3   2020-06-02 [1] Bioconductor  
#>  ellipsis           0.3.1    2020-05-15 [1] CRAN (R 4.0.0)
#>  evaluate           0.14     2019-05-28 [1] CRAN (R 4.0.0)
#>  fansi              0.4.1    2020-01-08 [1] CRAN (R 4.0.0)
#>  fs                 1.4.2    2020-06-30 [1] CRAN (R 4.0.0)
#>  generics           0.0.2    2018-11-29 [1] CRAN (R 4.0.0)
#>  GenomeInfoDb       1.24.2   2020-06-15 [1] Bioconductor  
#>  GenomeInfoDbData   1.2.3    2020-07-09 [1] Bioconductor  
#>  GenomicRanges      1.40.0   2020-04-27 [1] Bioconductor  
#>  ggplot2            3.3.2    2020-06-19 [1] CRAN (R 4.0.0)
#>  glue               1.4.1    2020-05-13 [1] CRAN (R 4.0.0)
#>  gtable             0.3.0    2019-03-25 [1] CRAN (R 4.0.0)
#>  highr              0.8      2019-03-20 [1] CRAN (R 4.0.0)
#>  htmltools          0.5.0    2020-06-16 [1] CRAN (R 4.0.0)
#>  IRanges            2.22.2   2020-05-21 [1] Bioconductor  
#>  knitr              1.29     2020-06-23 [1] CRAN (R 4.0.0)
#>  lattice            0.20-41  2020-04-02 [1] CRAN (R 4.0.0)
#>  lifecycle          0.2.0    2020-03-06 [1] CRAN (R 4.0.0)
#>  limma              3.44.3   2020-06-12 [1] Bioconductor  
#>  locfit             1.5-9.4  2020-03-25 [1] CRAN (R 4.0.0)
#>  magrittr           1.5      2014-11-22 [1] CRAN (R 4.0.0)
#>  memoise            1.1.0    2017-04-21 [1] CRAN (R 4.0.0)
#>  munsell            0.5.0    2018-06-12 [1] CRAN (R 4.0.0)
#>  pillar             1.4.5    2020-07-09 [1] CRAN (R 4.0.0)
#>  pkgbuild           1.0.8    2020-05-07 [1] CRAN (R 4.0.0)
#>  pkgconfig          2.0.3    2019-09-22 [1] CRAN (R 4.0.0)
#>  pkgload            1.1.0    2020-05-29 [1] CRAN (R 4.0.0)
#>  plyr               1.8.6    2020-03-03 [1] CRAN (R 4.0.0)
#>  prettyunits        1.1.1    2020-01-24 [1] CRAN (R 4.0.0)
#>  processx           3.4.3    2020-07-05 [1] CRAN (R 4.0.0)
#>  ps                 1.3.3    2020-05-08 [1] CRAN (R 4.0.0)
#>  purrr              0.3.4    2020-04-17 [1] CRAN (R 4.0.0)
#>  R6                 2.4.1    2019-11-12 [1] CRAN (R 4.0.0)
#>  Rcpp               1.0.5    2020-07-06 [1] CRAN (R 4.0.0)
#>  RCurl              1.98-1.2 2020-04-18 [1] CRAN (R 4.0.0)
#>  remotes            2.1.1    2020-02-15 [1] CRAN (R 4.0.0)
#>  reshape2           1.4.4    2020-04-09 [1] CRAN (R 4.0.0)
#>  rlang              0.4.7    2020-07-09 [1] CRAN (R 4.0.0)
#>  rmarkdown          2.3      2020-06-18 [1] CRAN (R 4.0.0)
#>  rprojroot          1.3-2    2018-01-03 [1] CRAN (R 4.0.0)
#>  S4Vectors          0.26.1   2020-05-16 [1] Bioconductor  
#>  scales             1.1.1    2020-05-11 [1] CRAN (R 4.0.0)
#>  sessioninfo        1.1.1    2018-11-05 [1] CRAN (R 4.0.0)
#>  stringi            1.4.6    2020-02-17 [1] CRAN (R 4.0.0)
#>  stringr            1.4.0    2019-02-10 [1] CRAN (R 4.0.0)
#>  testthat           2.3.2    2020-03-02 [1] CRAN (R 4.0.0)
#>  tibble             3.0.2    2020-07-07 [1] CRAN (R 4.0.0)
#>  tidyselect         1.1.0    2020-05-11 [1] CRAN (R 4.0.0)
#>  usethis            1.6.1    2020-04-29 [1] CRAN (R 4.0.0)
#>  vctrs              0.3.1    2020-06-05 [1] CRAN (R 4.0.0)
#>  withr              2.2.0    2020-04-20 [1] CRAN (R 4.0.0)
#>  xfun               0.15     2020-06-21 [1] CRAN (R 4.0.0)
#>  XVector            0.28.0   2020-04-27 [1] Bioconductor  
#>  yaml               2.2.1    2020-02-01 [1] CRAN (R 4.0.0)
#>  zlibbioc           1.34.0   2020-04-27 [1] Bioconductor  
#> 
#> [1] /home/iaradsouza/anaconda3/envs/mdd-env/lib/R/library

My guess is that Error in rbind(deparse.level, ...): numbers of columns of arguments do not match error happens when dmTest tries to concatenate results with rbind function (see line 257 of https://github.com/gosianow/DRIMSeq/blob/master/R/class_dmSQTLtest.R), since this is an error threw by rbind function when the columns don't match. However, I don't know why this happens.

I tried to encapsulate a minimum example to demonstrate this error, and if you want to reproduce, my data is deposited here: https://github.com/iaradsouza1/drimseq_test.git

I would appreciate any help in this issue, thanks!

Dear Iara,

thank you very much for reporting this bug and for providing a reproducible example. It was very helpful. The bug should be now fixed in the release version 1.16.1 and in the devel version 1.17.1.

Best wishes.