pachterlab / kma

Keep Me Around: Intron Retention Detection
GNU General Public License v2.0
29 stars 20 forks source link

Another "newIntronRetention" error #26

Closed jfass closed 4 years ago

jfass commented 4 years ago

Everything works up to:

> ir <- newIntronRetention( xprs$tpm, intron_to_trans, xprs$condition, xprs$uniq_counts )
'melting' unique counts
computing denominator
Error in sum(strand) : invalid 'type' (character) of argument

My "intron_to_trans" looks like:

> head( intron_to_trans )
                      intron         target_id               gene
1:  chr7:140534672-140549910 ENST00000288602.6  ENSG00000157764.8
2:  chr7:140534672-140549910 ENST00000469930.1  ENSG00000157764.8
3:  chr7:140534672-140549910 ENST00000497784.1  ENSG00000157764.8
4: chr12:121881596-121881814 ENST00000536437.1 ENSG00000089094.12
5: chr12:121881596-121881814 ENST00000377071.4 ENSG00000089094.12
6: chr12:121881596-121881814 ENST00000377069.4 ENSG00000089094.12
            intron_extension strand
1:  chr7:140534651-140549931      -
2:  chr7:140534651-140549931      -
3:  chr7:140534651-140549931      -
4: chr12:121881575-121881835      -
5: chr12:121881575-121881835      -
6: chr12:121881575-121881835      -

"strand" is "+" or "-" ...

> table( intron_to_trans$strand )

     -      + 
477309 491376 

On a whim I made "strand" a factor with levels c("+","-"), but that failed similarly:

> ir <- newIntronRetention( xprs$tpm, intron_to_trans, xprs$condition, xprs$uniq_counts )
'melting' unique counts
computing denominator
Error in Summary.factor(c(NA_integer_, NA_integer_), na.rm = FALSE) : 
  ‘sum’ not meaningful for factors

Any advice would be appreciated ... Thanks!


> sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.5 LTS

Matrix products: default
BLAS:   /home/ubuntu/KMA/R-3.6.1/lib/libRblas.so
LAPACK: /home/ubuntu/KMA/R-3.6.1/lib/libRlapack.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] kma_0.1.0   dplyr_0.8.3

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.2        crayon_1.3.4      assertthat_0.2.1  R6_2.4.0         
 [5] plyr_1.8.4        magrittr_1.5      pillar_1.4.2      stringi_1.4.3    
 [9] rlang_0.4.0       reshape2_1.4.3    data.table_1.12.4 tools_3.6.1      
[13] stringr_1.4.0     glue_1.3.1        purrr_0.3.2       compiler_3.6.1   
[17] pkgconfig_2.0.3   tidyselect_0.2.5  tibble_2.1.3     
jfass commented 4 years ago

From another thread, looks like https://github.com/adamtongji/kma fixes this ...