ldg21 / SGSeq

Splice event prediction and quantification from RNA-seq data
5 stars 1 forks source link

Export transcript variants #1

Open kathrinklee opened 5 years ago

kathrinklee commented 5 years ago

Hi, is there a way to export transcript variants to gtf or other related formats? Best & thanks

ldg21 commented 5 years ago

The only export function available at the moment is 'exportFeatures' which writes transcript or splice graph features to BED format. When you use 'unlist' on a variants object, this returns individual features that make up the variants. They can be exported to BED format (though variant information is lost) e.g.

> sgf <- unlist(sgv_pred)
> exportFeatures(sgf, "sgf.bed")
kathrinklee commented 5 years ago

Thanks for your response. I've tried this function, but I'm always receiving the same error:

> txf <- predictTxFeatures(bams, GR)
dux_pos1 complete.
dux_pos2 complete.
dux_neg1 complete.
dux_neg2 complete.
> sgf <- convertToSGFeatures(txf)
> sgf <- annotate(sgf, txf_ucsc)
> sgv <- findSGVariants(sgf)
Find segments...
Find variants...
Warning: 1 events exceed maxnvariant in gene 6
Warning: 1 events exceed maxnvariant in gene 125
Annotate variants...
> sgv_unlist <- unlist(sgv)
> exportFeatures(sgv_unlist, "sgf.bed")
Error in `rownames<-`(`*tmp*`, value = c(NA_character_, NA_character_,  : 
  missing values not allowed in rownames

Any idea what is going wrong here? Best & thanks

> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252    LC_MONETARY=German_Germany.1252 LC_NUMERIC=C                   
[5] LC_TIME=German_Germany.1252    

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

other attached packages:
 [1] TxDb.Mmusculus.UCSC.mm10.ensGene_3.4.0 biomaRt_2.38.0                         lattice_0.20-38                       
 [4] GenomicFeatures_1.34.1                 AnnotationDbi_1.44.0                   rtracklayer_1.42.0                    
 [7] multipanelfigure_2.0.0                 SGSeq_1.16.0                           SummarizedExperiment_1.12.0           
[10] DelayedArray_0.8.0                     BiocParallel_1.16.0                    matrixStats_0.54.0                    
[13] Biobase_2.42.0                         Rsamtools_1.34.0                       Biostrings_2.50.1                     
[16] XVector_0.22.0                         GenomicRanges_1.34.0                   GenomeInfoDb_1.18.0                   
[19] IRanges_2.16.0                         S4Vectors_0.20.1                       BiocGenerics_0.28.0                   

loaded via a namespace (and not attached):
 [1] bitops_1.0-6               bit64_0.9-7                RColorBrewer_1.1-2         progress_1.2.0             httr_1.3.1                
 [6] tools_3.5.1                backports_1.1.2            R6_2.3.0                   rpart_4.1-13               Hmisc_4.1-1               
[11] DBI_1.0.0                  lazyeval_0.2.1             colorspace_1.3-2           nnet_7.3-12                tidyselect_0.2.5          
[16] gridExtra_2.3              prettyunits_1.0.2          bit_1.1-14                 compiler_3.5.1             htmlTable_1.12            
[21] assertive.properties_0.0-4 assertive.files_0.0-2      scales_1.0.0               checkmate_1.8.5            stringr_1.3.1             
[26] digest_0.6.18              foreign_0.8-71             assertive.numbers_0.0-2    base64enc_0.1-3            dichromat_2.0-0           
[31] pkgconfig_2.0.2            htmltools_0.3.6            htmlwidgets_1.3            rlang_0.3.0.1              rstudioapi_0.8            
[36] RSQLite_2.1.1              gridGraphics_0.3-0         bindr_0.1.1                acepack_1.4.1              dplyr_0.7.8               
[41] RCurl_1.95-4.11            magrittr_1.5               GenomeInfoDbData_1.2.0     Formula_1.2-3              Matrix_1.2-15             
[46] Rcpp_1.0.0                 munsell_0.5.0              stringi_1.2.4              assertive.base_0.0-7       zlibbioc_1.28.0           
[51] plyr_1.8.4                 blob_1.1.1                 crayon_1.3.4               splines_3.5.1              hms_0.4.2                 
[56] magick_2.0                 knitr_1.20                 pillar_1.3.0               igraph_1.2.2               RUnit_0.4.32              
[61] codetools_0.2-15           XML_3.98-1.16              glue_1.3.0                 latticeExtra_0.6-28        BiocManager_1.30.4        
[66] data.table_1.11.8          gtable_0.2.0               purrr_0.2.5                assertthat_0.2.0           ggplot2_3.1.0             
[71] assertive.types_0.0-3      AnnotationFilter_1.6.0     survival_2.42-3            tibble_1.4.2               GenomicAlignments_1.18.0  
[76] memoise_1.1.0              bindrcpp_0.2.2             cluster_2.0.7-1           
ldg21 commented 5 years ago

Looks like a bug that went unnoticed until the latest release, now resulting in errors due to changes in dependencies. It should be fixed in release (1.16.2) and development (1.17.2). Thanks for reporting the issue.