Using `catchSalmon()` to import Salmon counts quantified using a decoy-aware transcriptome index
0
1
Entering edit mode
@konstantinosbogias-21699
Last seen 4.6 years ago
Australia, Adelaide, University of Adel…

Hi,

I encountered an issue when using the catchSalmon() function from edgeR to import pseudo-alignment counts from the Salmon package. The counts were quantified using recent methods implemented in Salmon that allows the use of a decoy-aware transcriptome index. I currently have the latest versions of edgeR (3.26.7) and Salmon (0.14.1) installed.

The command I ran was:

salmon_counts <- catchSalmon(paths = dirs, verbose = TRUE)

For reference, the dirs object is a character vector of my Salmon quantification directories. However, it returned this error message:

Error in matrix(0, NTx, NSamples) : non-numeric matrix extent

I decided to first take a look and see where the error may have occurred in the source code. After calling body(catchSalmon) I found, to the best of my understanding, that catchSalmon() stores the meta_info.json file from the Salmon output directory into an object called Meta. It then records the number of transcripts using these commands which were implemented in a for loop (note: I only took the relevant lines of code for simplicity):

MetaFile <- file.path(paths[j], "aux_info", "meta_info.json")

Meta <- jsonlite::fromJSON(MetaFile)
NTx <- Meta$num_targets

But the meta_info.json file made by Salmon when using a decoy-aware index in the pseudo-alignment is slightly different. The previous term num_targets had been renamed to num_valid_targets (as there was a new term added in called num_decoy_targets as well).

I found that changing the line of code from catchSalmon():

NTx <- Meta$num_targets

to

NTx <- Meta$num_valid_targets

allowed the function to run without any issues.

I was hoping that this issue could possibly be addressed in a future update for edgeR, and so decided to make a post regarding it. I apologize in advance that this isn't exactly a proper question.

Thanks

R session info:

> sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.6

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8

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

other attached packages:
 [1] edgeR_3.26.7              swfdr_1.10.0              gridExtra_2.3             ggvis_0.4.4              
 [5] ggdendro_0.1-20           pheatmap_1.0.12           sva_3.32.1                BiocParallel_1.18.1      
 [9] genefilter_1.66.0         mgcv_1.8-28               nlme_3.1-141              DESeq_1.36.0             
[13] lattice_0.20-38           locfit_1.5-9.1            GSEABase_1.46.0           graph_1.62.0             
[17] annotate_1.62.0           XML_3.98-1.20             EnsDb.Hsapiens.v86_2.99.0 ensembldb_2.8.0          
[21] AnnotationFilter_1.8.0    GenomicFeatures_1.36.4    AnnotationDbi_1.46.0      Biobase_2.44.0           
[25] GenomicRanges_1.36.0      GenomeInfoDb_1.20.0       IRanges_2.18.1            S4Vectors_0.22.0         
[29] here_0.1                  ggrepel_0.8.1             ggthemes_4.2.0            plotly_4.9.0             
[33] ggplot2_3.2.1             splitstackshape_1.4.8     RColorBrewer_1.1-2        biomaRt_2.40.3           
[37] tibble_2.1.3              readr_1.3.1               dplyr_0.8.3               magrittr_1.5             
[41] limma_3.40.6              AnnotationHub_2.16.0      BiocFileCache_1.8.0       dbplyr_1.4.2             
[45] BiocGenerics_0.30.0      

loaded via a namespace (and not attached):
 [1] colorspace_1.4-1              rprojroot_1.3-2               XVector_0.24.0                rstudioapi_0.10              
 [5] bit64_0.9-7                   interactiveDisplayBase_1.22.0 fansi_0.4.0                   geneplotter_1.62.0           
 [9] knitr_1.24                    zeallot_0.1.0                 jsonlite_1.6                  Rsamtools_2.0.0              
[13] shiny_1.3.2                   BiocManager_1.30.4            compiler_3.6.1                httr_1.4.1                   
[17] backports_1.1.4               assertthat_0.2.1              Matrix_1.2-17                 lazyeval_0.2.2               
[21] cli_1.1.0                     later_0.8.0                   htmltools_0.3.6               prettyunits_1.0.2            
[25] tools_3.6.1                   gtable_0.3.0                  glue_1.3.1                    GenomeInfoDbData_1.2.1       
[29] reshape2_1.4.3                rappdirs_0.3.1                Rcpp_1.0.2                    vctrs_0.2.0                  
[33] Biostrings_2.52.0             rtracklayer_1.44.2            xfun_0.8                      stringr_1.4.0                
[37] mime_0.7                      zlibbioc_1.30.0               MASS_7.3-51.4                 scales_1.0.0                 
[41] hms_0.5.0                     promises_1.0.1                ProtGenerics_1.16.0           SummarizedExperiment_1.14.1  
[45] yaml_2.2.0                    curl_4.0                      memoise_1.1.0                 stringi_1.4.3                
[49] RSQLite_2.1.2                 rlang_0.4.0                   pkgconfig_2.0.2               matrixStats_0.54.0           
[53] bitops_1.0-6                  purrr_0.3.2                   labeling_0.3                  GenomicAlignments_1.20.1     
[57] htmlwidgets_1.3               bit_1.1-14                    tidyselect_0.2.5              plyr_1.8.4                   
[61] R6_2.4.0                      DelayedArray_0.10.0           DBI_1.0.0                     pillar_1.4.2                 
[65] withr_2.1.2                   survival_2.44-1.1             RCurl_1.95-4.12               crayon_1.3.4                 
[69] utf8_1.1.4                    progress_1.2.2                grid_3.6.1                    data.table_1.12.2            
[73] blob_1.2.0                    digest_0.6.20                 xtable_1.8-4                  tidyr_0.8.3                  
[77] httpuv_1.5.1                  munsell_0.5.0                 viridisLite_0.3.0            
edgeR Salmon • 955 views
ADD COMMENT
0
Entering edit mode

I apologize in advance that this isn't exactly a proper question.

It is more usual to send bug reports or code suggestions directly to the authors by email, and we encourage that route (see Section 1.3 in the User's Guide).

Nevertheless we're still grateful to get the suggestion as a post here, as we don't have experience with decoy-aware indices.

ADD REPLY

Login before adding your answer.

Traffic: 824 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6