kvittingseerup / IsoformSwitchAnalyzeR

An R package to Identify, Annoatate and Visialize Isoform Switches with Functional Consequences (from RNA-seq data)
96 stars 18 forks source link

(simpleError(msg, call)) : in using analyzeSwitchConsequences #229

Closed liscruk closed 4 months ago

liscruk commented 4 months ago

Hi

I have an error when running:


txi = tximport(files, type="salmon", txOut=TRUE, 
               countsFromAbundance="scaledTPM",ignoreTxVersion = FALSE)

d = data.frame(sampleID = colnames(txi$abundance),
                      condition = sampleTable$V4)
d

 sampleID condition
1  sample1   Control
2  sample2   Control
3  sample3   Treated
4  sample4   Treated

### Assembled GTF
data = importRdata(
  isoformCountMatrix   = txi$counts,
  isoformRepExpression = txi$abundance,
  designMatrix  = d,
  isoformExonAnnoation = "trps.gtf",
  isoformNtFasta       = "trps.fa",
  showProgress = TRUE
)

#### Reference GTF
data = preFilter(data,
                 geneExpressionCutoff = 10,
                 isoformExpressionCutoff = 5,
                 dIFcutoff = 0.25
                 )

data = isoformSwitchTestDEXSeq(switchAnalyzeRlist = data,
                               reduceToSwitchingGenes = TRUE,
                               reduceFurtherToGenesWithConsequencePotential = TRUE,
                               onlySigIsoforms = TRUE)

data = addORFfromGTF(data,
                     pathToGTF = "gencode.v42.annotation.gtf")

data = analyzeNovelIsoformORF(data,analysisAllIsoformsWithoutORF = TRUE)
data = analyzeAlternativeSplicing(data,quiet=FALSE)
data = extractSequence(data,removeORFwithStop=FALSE))

extractSwitchSummary(data)
   Comparison nrIsoforms nrSwitches nrGenes
1 Control vs Treated       2157       1392     940

x=c(
  'intron_retention',
  'ORF_seq_similarity',
  'NMD_status',
  'domain_isotype')

data = analyzeSwitchConsequences(
  data,
  consequencesToAnalyze = x, 
  showProgress=TRUE
)

The error message reads:

Step 1 of 4: Extracting genes with isoform switches...
Step 2 of 4: Analyzing 1426 pairwise isoforms comparisons...
  |                                                                                                                                                        |   0%
Error in h(simpleError(msg, call)) : 
  error in evaluating the argument 'x' in selecting a method for function 'split': incorrect number of dimensions
Error: with piece 1: 
  isoformUpregulated isoformDownregulated comparison
1  ENST00000475590.5    ENST00000347869.8          1

I first thought maybe the ID empty. But it is there.

I am unsure what is going wrong since everything prior to analyzeSwitchConsequences runs fine.

Thanks for any advice!


> sessionInfo()
R version 4.3.2 (2023-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.6 LTS

Matrix products: default
BLAS:   /home/vera/eberhamn/lib/R-4.3.2/lib/libRblas.so 
LAPACK: /home/vera/eberhamn/lib/R-4.3.2/lib/libRlapack.so;  LAPACK version 3.11.0

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

time zone: Europe/Berlin
tzcode source: system (glibc)

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

other attached packages:
 [1] BiocManager_1.30.22         tximport_1.28.0             GenomicFeatures_1.52.2      tximeta_1.18.3              IsoformSwitchAnalyzeR_2.0.1
 [6] pfamAnalyzeR_1.0.1          dplyr_1.1.4                 stringr_1.5.1               readr_2.1.5                 ggplot2_3.4.4              
[11] sva_3.48.0                  genefilter_1.82.1           mgcv_1.9-1                  nlme_3.1-164                satuRn_1.8.0               
[16] DEXSeq_1.46.0               RColorBrewer_1.1-3          AnnotationDbi_1.62.2        DESeq2_1.40.2               SummarizedExperiment_1.30.2
[21] GenomicRanges_1.52.1        GenomeInfoDb_1.36.4         IRanges_2.34.1              S4Vectors_0.38.2            MatrixGenerics_1.12.3      
[26] matrixStats_1.2.0           Biobase_2.60.0              BiocGenerics_0.46.0         BiocParallel_1.34.2         limma_3.56.2               

loaded via a namespace (and not attached):
  [1] later_1.3.2                   splines_4.3.2                 BiocIO_1.10.0                 bitops_1.0-7                  ggplotify_0.1.2              
  [6] filelock_1.0.3                tibble_3.2.1                  polyclip_1.10-6               XML_3.99-0.16.1               lifecycle_1.0.4              
 [11] edgeR_3.42.4                  vroom_1.6.5                   ensembldb_2.24.1              lattice_0.22-5                MASS_7.3-60.0.1              
 [16] magrittr_2.0.3                yaml_2.3.8                    httpuv_1.6.14                 cowplot_1.1.3                 pbapply_1.7-2                
 [21] DBI_1.2.2                     abind_1.4-5                   zlibbioc_1.46.0               purrr_1.0.2                   AnnotationFilter_1.24.0      
 [26] ggraph_2.1.0                  RCurl_1.98-1.14               yulab.utils_0.1.4             tweenr_2.0.2                  rappdirs_0.3.3               
 [31] GenomeInfoDbData_1.2.10       enrichplot_1.20.3             ggrepel_0.9.5                 tidytree_0.4.6                annotate_1.78.0              
 [36] codetools_0.2-19              DelayedArray_0.26.7           DOSE_3.26.2                   xml2_1.3.6                    ggforce_0.4.2                
 [41] tidyselect_1.2.0              futile.logger_1.4.3           aplot_0.2.2                   locfdr_1.1-8                  farver_2.1.1                 
 [46] viridis_0.6.5                 BiocFileCache_2.8.0           GenomicAlignments_1.36.0      jsonlite_1.8.8                ellipsis_0.3.2               
 [51] tidygraph_1.3.1               survival_3.5-8                tools_4.3.2                   progress_1.2.3                treeio_1.24.3                
 [56] Rcpp_1.0.12                   glue_1.7.0                    gridExtra_2.3                 qvalue_2.32.0                 withr_3.0.0                  
 [61] formatR_1.14                  fastmap_1.1.1                 boot_1.3-29                   fansi_1.0.6                   digest_0.6.34                
 [66] mime_0.12                     R6_2.5.1                      gridGraphics_0.5-1            colorspace_2.1-0              GO.db_3.17.0                 
 [71] biomaRt_2.56.1                RSQLite_2.3.5                 utf8_1.2.4                    tidyr_1.3.1                   generics_0.1.3               
 [76] data.table_1.15.0             rtracklayer_1.60.1            prettyunits_1.2.0             graphlayouts_1.1.0            httr_1.4.7                   
 [81] S4Arrays_1.0.6                scatterpie_0.2.1              pkgconfig_2.0.3               gtable_0.3.4                  blob_1.2.4                   
 [86] hwriter_1.3.2.1               XVector_0.40.0                htmltools_0.5.7               clusterProfiler_4.8.3         shadowtext_0.1.3             
 [91] fgsea_1.26.0                  geneplotter_1.78.0            ProtGenerics_1.32.0           scales_1.3.0                  png_0.1-8                    
 [96] ggfun_0.1.4                   lambda.r_1.2.4                rstudioapi_0.15.0             tzdb_0.4.0                    reshape2_1.4.4               
[101] rjson_0.2.21                  curl_5.2.0                    cachem_1.0.8                  BiocVersion_3.17.1            parallel_4.3.2               
[106] HDO.db_0.99.1                 restfulr_0.0.15               pillar_1.9.0                  grid_4.3.2                    vctrs_0.6.5                  
[111] promises_1.2.1                dbplyr_2.4.0                  xtable_1.8-4                  VennDiagram_1.7.3             cli_3.6.2                    
[116] locfit_1.5-9.8                compiler_4.3.2                futile.options_1.0.1          Rsamtools_2.16.0              rlang_1.1.3                  
[121] crayon_1.5.2                  labeling_0.4.3                plyr_1.8.9                    fs_1.6.3                      stringi_1.8.3                
[126] viridisLite_0.4.2             munsell_0.5.0                 Biostrings_2.68.1             lazyeval_0.2.2                GOSemSim_2.26.1              
[131] Matrix_1.6-5                  BSgenome_1.68.0               hms_1.1.3                     patchwork_1.2.0               bit64_4.0.5                  
[136] shiny_1.8.0                   KEGGREST_1.40.1               statmod_1.5.0                 interactiveDisplayBase_1.38.0 AnnotationHub_3.8.0          
[141] igraph_2.0.2                  memoise_2.0.1                 ggtree_3.8.2                  fastmatch_1.1-4               bit_4.0.5                    
[146] downloader_0.4                ape_5.7-1
chunxubioinfor commented 4 months ago

Hi, did you import external analysis before implementing analyzeSwitchConsequences()? If not, I think this can explain the error. If you have further questions, maybe you could share the data with me then I can take a look.😊

liscruk commented 4 months ago

Hi, thanks for the quick response. No I did not add external data, I thought I can run it with the subset of features that do not require it. I will try to subet the data so I can provide it to you.

Thanks!

chunxubioinfor commented 4 months ago

Yes, there are some consequences that don't require external analysis, but most of them do need (like domain_isotype you used). You could use ?analyzeSwitchConsequences() to check the consequences as well as corresponding external analysis. So I will just close this issue. If you have other problems, plz feel free to start a new one. 🙌

CCCBBG commented 2 weeks ago

I have the same problem. Have you solved it?