gladkia / igvR

An R Bioconductor package providing interactive connections to igv.js (the Integrative Genomics Viewer) in a web browser
MIT License
42 stars 4 forks source link

Error in .QuantitativeTrack() #5

Closed janstrauss1 closed 5 years ago

janstrauss1 commented 5 years ago

Dear @paul-shannon,

I am learning to use igvR using the vignette at https://bioconductor.org/packages/release/bioc/vignettes/igvR/inst/doc/igvR.html.

Everything runs smoothly (see attached screenshot) apart from adding the quantitative track "IGAP.gwas.scored" using

track.gwas.numeric <- DataFrameQuantitativeTrack("IGAP.gwas.scored", tbl.mef2cGWAS.variants.bedGraph)

which throws the following error:

Error in .QuantitativeTrack(Track(trackType = "quantitative", sourceType = "file",  : 
argument "autoscale" is missing, with no default

Could you help please?

Many thanks in advance, Jan

Screenshot_2019-05-09 MEF2C My R sessionInfo()

R version 3.6.0 (2019-04-26)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.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_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
 [1] AnnotationHub_2.16.0        BiocFileCache_1.8.0         dbplyr_1.4.0                igvR_1.4.0                 
 [5] GenomicAlignments_1.20.0    BrowserViz_2.6.0            httpuv_1.5.1                jsonlite_1.6               
 [9] rtracklayer_1.44.0          VariantAnnotation_1.30.0    Rsamtools_2.0.0             Biostrings_2.52.0          
[13] XVector_0.24.0              SummarizedExperiment_1.14.0 Biobase_2.44.0              DelayedArray_0.10.0        
[17] BiocParallel_1.18.0         matrixStats_0.54.0          GenomicRanges_1.36.0        GenomeInfoDb_1.20.0        
[21] IRanges_2.18.0              S4Vectors_0.22.0            BiocGenerics_0.30.0        

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.1                    lattice_0.20-38               prettyunits_1.0.2            
 [4] assertthat_0.2.1              digest_0.6.18                 mime_0.6                     
 [7] R6_2.4.0                      RSQLite_2.1.1                 httr_1.4.0                   
[10] pillar_1.3.1                  zlibbioc_1.30.0               rlang_0.3.4                  
[13] GenomicFeatures_1.36.0        progress_1.2.0                curl_3.3                     
[16] blob_1.1.1                    Matrix_1.2-17                 stringr_1.4.0                
[19] RCurl_1.95-4.12               bit_1.1-14                    biomaRt_2.40.0               
[22] shiny_1.3.2                   compiler_3.6.0                pkgconfig_2.0.2              
[25] htmltools_0.3.6               tidyselect_0.2.5              tibble_2.1.1                 
[28] GenomeInfoDbData_1.2.1        interactiveDisplayBase_1.22.0 XML_3.98-1.19                
[31] crayon_1.3.4                  dplyr_0.8.0.1                 later_0.8.0                  
[34] bitops_1.0-6                  rappdirs_0.3.1                grid_3.6.0                   
[37] xtable_1.8-4                  DBI_1.0.0                     magrittr_1.5                 
[40] stringi_1.4.3                 promises_1.0.1                tools_3.6.0                  
[43] bit64_0.9-7                   BSgenome_1.52.0               glue_1.3.1                   
[46] purrr_0.3.2                   hms_0.4.2                     yaml_2.2.0                   
[49] AnnotationDbi_1.46.0          BiocManager_1.30.4            memoise_1.1.0                
paul-shannon commented 5 years ago

Thanks for the bug report. I need to update the vignette. The man page is up to date, however:

?DataFrameQuantitativeTrack
DataFrameQuantitativeTrack-class     package:igvR      R Documentation

Constructor for DataFrameQuantitativeTrack

Description:

     ‘DataFrameQuantitativeTrack’ creates and ‘IGV’ track for bed
     objects imported using ‘rtracklayer’

Usage:

     DataFrameQuantitativeTrack(trackName, quantitativeData, color = "blue",
       trackHeight = 50, autoscale, min = NA_real_, max = NA_real_,
       visibilityWindow = 1e+05)

Arguments:

trackName: A character string, used as track label by igv, we recommend
          unique names per track.

quantitativeData: A base R ‘data.frame’

   color: A CSS color name (e.g., "red" or "#FF0000")

trackHeight: track height, typically in range 20 (for annotations) and
          up to 1000 (for large sample vcf files)

autoscale: Autoscale track to maximum value in view

     min: Sets the minimum value for the data (y-axis) scale. Usually
          zero.

     max: Sets the maximum value for the data (y-axis) scale. This
          value is ignored if autoscale is TRUE
visibilityWindow: Maximum window size in base pairs for which indexed
          annotations or variants are displayed. Defaults: 1 MB for
          variants, whole chromosome for other track types.

Value:

     A DataFrameQuantitativeTrack object

Examples:

     base.loc <- 88883100
     tbl <- data.frame(chrom=rep("chr5", 3),
                       start=c(base.loc, base.loc+100, base.loc + 250),
                       end=c(base.loc + 50, base.loc+120, base.loc+290),
                       score=runif(3),
                       stringsAsFactors=FALSE)

     track <- DataFrameQuantitativeTrack("dataframeTest", tbl, autoscale=TRUE)