kvittingseerup / IsoformSwitchAnalyzeR

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

Error in import R-data #91

Closed m-ajie closed 3 years ago

m-ajie commented 3 years ago

Dear package developer,

Good day. I have been trying to use the importRdata() function and I cannot seem to make it work. I use the Homo_sapiens.GRCh38.100.chr_patch_hapl_scaff.gtf.gz GTF file from Ensembl as the input for the isoformExonAnnoation argument, but it resulted in an error :

"Error in h(simpleError (msg, call))) : error in evaluating the argument 'con' in selecting a method for function 'import': invalid class "GFF2File" object: undefined class for slot resource ("characterORconnection")"

Do you perhaps have a solution for this problem? Apologies in advance for not using the Markdown styling because at the moment I cannot download any file from the server that I use to run the analysis.

kvittingseerup commented 3 years ago

Try updating to IsoformSwitchAnalyzeR 1.13.04 as either github or the Bioconductor devel branch.

Remember to restart R before trying again.

m-ajie commented 3 years ago

I tried your suggestion but it still did not work. The server that I use is not connected to the internet so for R package we usually install them through our local copy of the bioconductor repository (which at this moment is still version 3.12). When I installed your newest version of the package, I only transfered the .zip file of the package alone and not the newest version of the dependencies. I will let you know if I can run the function normally if I use the newest version of the dependencies.

Jamreil87 commented 3 years ago

I am also experiencing an import error with importRdata(), although the error i receive is slightly different

Error in h(simpleError(msg, call)) : error in evaluating the argument 'x' in selecting a method for function 'as.data.frame': error in evaluating the argument 'x' in selecting a method for function 'sort': subscript contains invalid names

Here is import code which precedes error at gtf step. The nt file is the same one used to make kallisto index, but corresponds to the same version of kallisto index and gtf file which are version 97 of ensembl. This code has worked fine beforehand. The above error is on both version 1.13.04 in development branch and release branch version 1.12.

aSwitchList <- importRdata(isoformCountMatrix=isoRepCount, isoformRepExpression = isobundance, designMatrix=designMatrix, isoformExonAnnoation=("/path/to/file/Mus_musculus.GRCm38.97.chr.gtf"), isoformNtFasta = ("/path/to/file/mouseENS.97.fa"), comparisonsToMake = comparisons, addAnnotatedORFs = TRUE, onlyConsiderFullORF = TRUE,

Session info is pasted below R version 4.0.3 (2020-10-10) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Linux Mint 19.3

Matrix products: default BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1 LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

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

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

other attached packages: [1] IsoformSwitchAnalyzeR_1.12.0 ggplot2_3.3.3 DEXSeq_1.36.0 RColorBrewer_1.1-2 AnnotationDbi_1.52.0 DESeq2_1.30.0
[7] BiocParallel_1.24.1 limma_3.46.0 GenomicAlignments_1.26.0 Rsamtools_2.6.0 Biostrings_2.58.0 XVector_0.30.0
[13] SummarizedExperiment_1.20.0 Biobase_2.50.0 MatrixGenerics_1.2.0 matrixStats_0.57.0 GenomicRanges_1.42.0 GenomeInfoDb_1.26.2
[19] IRanges_2.24.1 S4Vectors_0.28.1 BiocGenerics_0.36.0

loaded via a namespace (and not attached): [1] colorspace_2.0-0 hwriter_1.3.2 ellipsis_0.3.1 futile.logger_1.4.3 rstudioapi_0.13
[6] bit64_4.0.5 interactiveDisplayBase_1.28.0 xml2_1.3.2 splines_4.0.3 tximport_1.18.0
[11] geneplotter_1.68.0 jsonlite_1.7.2 annotate_1.68.0 dbplyr_2.0.0 shiny_1.5.0
[16] readr_1.4.0 BiocManager_1.30.10 compiler_4.0.3 httr_1.4.2 assertthat_0.2.1
[21] Matrix_1.3-2 fastmap_1.0.1 lazyeval_0.2.2 later_1.1.0.1 formatR_1.7
[26] htmltools_0.5.1 prettyunits_1.1.1 tools_4.0.3 gtable_0.3.0 glue_1.4.2
[31] GenomeInfoDbData_1.2.4 reshape2_1.4.4 dplyr_1.0.3 rappdirs_0.3.1 Rcpp_1.0.6
[36] DRIMSeq_1.18.0 rhdf5filters_1.2.0 vctrs_0.3.6 rtracklayer_1.50.0 stringr_1.4.0
[41] mime_0.9 lifecycle_0.2.0 ensembldb_2.14.0 statmod_1.4.35 XML_3.99-0.5
[46] edgeR_3.32.1 AnnotationHub_2.22.0 zlibbioc_1.36.0 scales_1.1.1 BSgenome_1.58.0
[51] ProtGenerics_1.22.0 hms_1.0.0 promises_1.1.1 rhdf5_2.34.0 AnnotationFilter_1.14.0
[56] lambda.r_1.2.4 yaml_2.2.1 curl_4.3 memoise_1.1.0 gridExtra_2.3
[61] biomaRt_2.46.0 stringi_1.5.3 RSQLite_2.2.2 BiocVersion_3.12.0 genefilter_1.72.0
[66] GenomicFeatures_1.42.1 rlang_0.4.10 pkgconfig_2.0.3 bitops_1.0-6 lattice_0.20-41
[71] Rhdf5lib_1.12.0 purrr_0.3.4 bit_4.0.4 tidyselect_1.1.0 plyr_1.8.6
[76] magrittr_2.0.1 R6_2.5.0 generics_0.1.0 DelayedArray_0.16.0 DBI_1.1.1
[81] pillar_1.4.7 withr_2.4.0 survival_3.2-7 RCurl_1.98-1.2 tibble_3.0.5
[86] tximeta_1.8.3 crayon_1.3.4 futile.options_1.0.1 BiocFileCache_1.14.0 progress_1.2.2
[91] locfit_1.5-9.4 grid_4.0.3 blob_1.2.1 digest_0.6.27 xtable_1.8-4
[96] VennDiagram_1.6.20 httpuv_1.5.5 openssl_1.4.3 munsell_0.5.0 askpass_1.1 ignoreAfterPeriod = TRUE, showProgress=TRUE)

Any information as to the cause of this error is greatly appreciated

kvittingseerup commented 3 years ago

@Jamreil87 Try updating to IsoformSwitchAnalyzeR 1.13.05 as describe above.

@m-ajie Did it work updating?

Cheers Kristoffer

kvittingseerup commented 3 years ago

I will take the nonresponsivenes as a yes

rauldiul commented 1 year ago

Hey Kristoffer!

I'm also getting the same error when loading some Kallisto files with importRdata as mentioned by @Jamreil87 :

I'm using v2.1.2 (Github installation because I encountered this problem with the Bioc installation: #189)

SwitchList <- importRdata(
  isoformCountMatrix   = kallistoQuant$counts,
  isoformRepExpression = kallistoQuant$abundance,
  designMatrix         = myDesign,
  isoformExonAnnoation = file.path(dir_data,"RNAseq/genomes","Homo_sapiens.GRCh38.100.chr_patch_hapl_scaff.gtf.gz"), # include GTF used
  isoformNtFasta       = file.path(dir_data,"RNAseq/genomes","Homo_sapiens.GRCh38.cdna.all.fa.gz"), # include transcript FASTA used
  showProgress = T,
  comparisonsToMake = myComparison, # The comparisons will be: condition2 /- condition1 (condition1 is used as baseline https://github.com/kvittingseerup/IsoformSwitchAnalyzeR/issues/93)
  removeNonConvensionalChr = T,
  addAnnotatedORFs = T,
  onlyConsiderFullORF = T
)

Step 1 of 10: Checking data...
Step 2 of 10: Obtaining annotation...
    importing GTF (this may take a while)...
Error in h(simpleError(msg, call)) : 
  error in evaluating the argument 'x' in selecting a method for function 'as.data.frame': error in evaluating the argument 'x' in selecting a method for function 'sort': subscript contains invalid names

Curiously, I'm able to bypass the error if I do this:

  1. Import the GTF separately via importGTF
  2. Use fixStringTieAnnotationProblem = F within importRdata. (If not, I get this error: ✖ Columnref_gene_iddoesn't exist.)

So, this code leads to correct loading and preprocessing:

foo <- importGTF(file.path(dir_data,"RNAseq/genomes","Homo_sapiens.GRCh38.100.chr_patch_hapl_scaff.gtf.gz"))

SwitchList <- importRdata(
  isoformCountMatrix   = kallistoQuant$counts,
  isoformRepExpression = kallistoQuant$abundance,
  designMatrix         = myDesign,
  isoformExonAnnoation = foo$exons, # include GTF used
  isoformNtFasta       = file.path(dir_data,"RNAseq/genomes","Homo_sapiens.GRCh38.cdna.all.fa.gz"), # include transcript FASTA used
  showProgress = T,
  comparisonsToMake = myComparison, # The comparisons will be: condition2 /- condition1 (condition1 is used as baseline https://github.com/kvittingseerup/IsoformSwitchAnalyzeR/issues/93)
  removeNonConvensionalChr = T,
  addAnnotatedORFs = T,
  onlyConsiderFullORF = T,
  fixStringTieAnnotationProblem = F
)

My session info:

R version 4.2.2 Patched (2022-11-10 r83330)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 23.04

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.11.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.11.0

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

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

other attached packages:
 [1] IsoformSwitchAnalyzeR_2.1.2 pfamAnalyzeR_0.99.1         magrittr_2.0.3              sva_3.46.0                  genefilter_1.80.3          
 [6] mgcv_1.8-42                 nlme_3.1-162                satuRn_1.7.3                DEXSeq_1.44.0               RColorBrewer_1.1-3         
[11] AnnotationDbi_1.60.2        DESeq2_1.38.3               SummarizedExperiment_1.28.0 MatrixGenerics_1.10.0       matrixStats_1.0.0          
[16] Biobase_2.58.0              BiocParallel_1.32.6         limma_3.54.2                data.table_1.14.8           qs_0.25.5                  
[21] openxlsx_4.2.5.2            ChIPpeakAnno_3.32.0         GenomicRanges_1.50.2        GenomeInfoDb_1.34.9         IRanges_2.32.0             
[26] S4Vectors_0.36.2            BiocGenerics_0.44.0         gridExtra_2.3               lubridate_1.9.2             forcats_1.0.0              
[31] stringr_1.5.0               dplyr_1.1.2                 purrr_1.0.1                 readr_2.1.4                 tidyr_1.3.0                
[36] tibble_3.2.1                ggplot2_3.4.2               tidyverse_2.0.0            

loaded via a namespace (and not attached):
  [1] AnnotationHub_3.6.0           BiocFileCache_2.6.1           plyr_1.8.8                    lazyeval_0.2.2               
  [5] tximeta_1.16.1                splines_4.2.2                 RApiSerialize_0.1.2           digest_0.6.31                
  [9] htmltools_0.5.5               ensembldb_2.22.0              fansi_1.0.4                   memoise_2.0.1                
 [13] BSgenome_1.66.3               tzdb_0.4.0                    InteractionSet_1.26.1         Biostrings_2.66.0            
 [17] annotate_1.76.0               RcppParallel_5.1.7            vroom_1.6.3                   timechange_0.2.0             
 [21] prettyunits_1.1.1             colorspace_2.1-0              blob_1.2.4                    rappdirs_0.3.3               
 [25] jsonlite_1.8.5                crayon_1.5.2                  RCurl_1.98-1.12               tximport_1.26.1              
 [29] graph_1.76.0                  stringfish_0.15.8             survival_3.5-5                glue_1.6.2                   
 [33] gtable_0.3.3                  zlibbioc_1.44.0               XVector_0.38.0                DelayedArray_0.24.0          
 [37] scales_1.2.1                  futile.options_1.0.1          DBI_1.1.3                     edgeR_3.40.2                 
 [41] Rcpp_1.0.10                   xtable_1.8-4                  progress_1.2.2                bit_4.0.5                    
 [45] httr_1.4.6                    ellipsis_0.3.2                pkgconfig_2.0.3               XML_3.99-0.14                
 [49] dbplyr_2.3.2                  locfit_1.5-9.8                utf8_1.2.3                    later_1.3.1                  
 [53] tidyselect_1.2.0              rlang_1.1.1                   reshape2_1.4.4                BiocVersion_3.16.0           
 [57] munsell_0.5.0                 tools_4.2.2                   cachem_1.0.8                  cli_3.6.1                    
 [61] generics_0.1.3                RSQLite_2.3.1                 fastmap_1.1.1                 yaml_2.3.7                   
 [65] bit64_4.0.5                   zip_2.3.0                     KEGGREST_1.38.0               AnnotationFilter_1.22.0      
 [69] pbapply_1.7-0                 RBGL_1.74.0                   mime_0.12                     formatR_1.14                 
 [73] xml2_1.3.4                    biomaRt_2.54.1                compiler_4.2.2                rstudioapi_0.14              
 [77] interactiveDisplayBase_1.36.0 filelock_1.0.2                curl_5.0.1                    png_0.1-8                    
 [81] statmod_1.5.0                 geneplotter_1.76.0            stringi_1.7.12                futile.logger_1.4.3          
 [85] GenomicFeatures_1.50.4        lattice_0.21-8                ProtGenerics_1.30.0           Matrix_1.5-4.1               
 [89] multtest_2.54.0               vctrs_0.6.3                   pillar_1.9.0                  lifecycle_1.0.3              
 [93] BiocManager_1.30.21           bitops_1.0-7                  httpuv_1.6.11                 rtracklayer_1.58.0           
 [97] R6_2.5.1                      BiocIO_1.8.0                  hwriter_1.3.2.1               promises_1.2.0.1             
[101] codetools_0.2-19              lambda.r_1.2.4                boot_1.3-28.1                 MASS_7.3-60                  
[105] rjson_0.2.21                  withr_2.5.0                   regioneR_1.30.0               GenomicAlignments_1.34.1     
[109] Rsamtools_2.14.0              GenomeInfoDbData_1.2.9        locfdr_1.1-8                  parallel_4.2.2               
[113] hms_1.1.3                     VennDiagram_1.7.3             shiny_1.7.4                   restfulr_0.0.15