Code Monkey home page Code Monkey logo

locusexplorer's Introduction

An interactive graphical illustration of genetic associations and their biological context.

Disclaimer

LocusExplorer should be used for illustrative purposes only. Any results provided by LocusExplorer should be used with caution.

Availability

The source code and installation instructions for LocusExplorer are available at https://github.com/oncogenetics/LocusExplorer.

LocusExplorer is made available under the MIT license.

Required Software

LocusExplorer runs in the R environment but is designed to be an easy to use interface that does not require familiarity with R as a prerequisite. LocusExplorer is platform agnostic and able to run on any operating system for which R is available.

LocusExplorer requires R version 3.2.2 to run and can be downloaded by following the instructions at https://www.r-project.org/. Some required packages are not available for earlier versions of R.

After installation of the R software, R packages used by LocusExplorer must be installed prior to use. This may take a few minutes, but is only required on the first occasion. To install packages, open the R program, copy the following code into the R console and hit Return:

#install CRAN packages, if missing
packages <- c("shiny","dplyr","tidyr","lazyeval","data.table","ggplot2","ggrepel","knitr","markdown","DT","lattice","acepack","cluster","DBI","colourpicker","igraph","visNetwork", "devtools")
if (length(setdiff(packages, rownames(installed.packages()))) > 0) {
  install.packages(setdiff(packages, rownames(installed.packages())), dependencies = TRUE)  
} else { print("All required CRAN packages installed")}

#install Bioconductor packages if missing
source("https://bioconductor.org/biocLite.R")
bioc <- c("ggbio","GenomicRanges","TxDb.Hsapiens.UCSC.hg19.knownGene","org.Hs.eg.db","rtracklayer")
if (length(setdiff(bioc, rownames(installed.packages()))) > 0) {
  biocLite(setdiff(bioc, rownames(installed.packages())))  
} else { print("All required Bioconductor packages installed")}

#install GitHub packages:
devtools::install_github("oncogenetics/oncofunco")
  • In cases when user do not have admin rights, pop up window will prompt to set a personal library location for installation of packages, please click yes.
  • If using R GUI then user might get prompted to choose CRAN mirror to use for package downloads, please choose the city nearer to your location.
  • If prompted to "Update packages all/some/none [a/s/n]", type "n" and hit Return.

Launch LocusExplorer

LocusExplorer runs through a web browser and uses an intuitive interface that does not require high level computational skills to operate.

1. Using runGitHub() within RStudio

Open RStudio (start a new R session) copy the following code into the console and hit Return:

library(shiny)  
runGitHub("LocusExplorer", "oncogenetics", launch.browser = TRUE)

2. Using Download as Zip (Recommended)

Click on Download as ZIP button, this will download the repisotory locally as a zip file LocusExplorer-master.zip. Unzip the folder. Open ui.R file in RStudio (start a new R session) and click on Run App (Please ensure Run External option is selected for full functionality) button at top right corner, or run below code.

library(shiny)  
runApp(launch.browser = TRUE)

Cite LocusExplorer

LocusExplorer: a user-friendly tool for integrated visualisation of genetic association data and biological annotations
Tokhir Dadaev1, Daniel A Leongamornlert1, Edward J Saunders1, Rosalind Eeles1,2 , Zsofia Kote-Jarai1

1Department of Genetics and Epidemiology, The Institute of Cancer Research, London, UK
2Royal Marsden NHS Foundation Trust, London, UK

Bioinformatics first published online November 20, 2015 doi:10.1093/bioinformatics/btv690

Abstract

Summary: In this article we present LocusExplorer, a data visualisation and exploration tool for genetic association data. LocusExplorer is written in R using the Shiny library, providing access to powerful R-based functions through a simple user interface. LocusExplorer allows users to simultaneously display genetic, statistical and biological data for humans in a single image and allows dynamic zooming and customisation of the plot features. Publication quality plots may then be produced in a variety of file formats.
Availability and implementation: LocusExplorer is open source and runs through R and a web browser. It is available at www.oncogenetics.icr.ac.uk/LocusExplorer/ or can be installed locally and the source code accessed from https://github.com/oncogenetics/LocusExplorer.

Publications: LocusExplorer plots

Frequently asked questions

See FAQ.

Contact

Questions, suggestions, and bug reports are welcome and appreciated.

To-do List

https://github.com/oncogenetics/LocusExplorer/issues

Issue Stats Issue Stats

locusexplorer's People

Contributors

d4l997 avatar edsaunders avatar guanguiwensy avatar martimij avatar rachelicr avatar zx8754 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

locusexplorer's Issues

R3.4 Zoom region range with NA?

When playing around with the region that should be displayed, one may receive error messages as:

chr2:172800000-NA
missing value where TRUE/FALSE needed

This should be fixed for better usability.

R3.1 ERROR: Pre-loaded bio packages cannot be unloaded

Potential solution: start new clean R session, or #15, #37, and website version will cover this issue.

When trying the software in RStudio, we initially received the following error after running “runGitHub("LocusExplorer", "oncogenetics")” to start the tool:

Error in unloadNamespace(package) :
namespace ‘AnnotationDbi’ is imported by ‘geneplotter’, ‘VariantAnnotation’, ‘GenomicFeatures’, ‘annotate’, ‘genefilter’, ‘biomaRt’, ‘OrganismDbi’, ‘biovizBase’ so cannot be unloaded Error in library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = lib.loc, :
Package ‘AnnotationDbi’ version 1.31.18 cannot be unloaded

It seems that if the session already imported particular packages, there can be a problem with LocusExplorer because AnnotationDbi cannot be unloaded due to dependencies.
It should be stated explicitly that an empty workspace should be used to start the tool to avoid this, or any other statement to tackle the problem.

Make prostate data optional

App starts without prostate data. When Prostate data is selected, pop up to download prostate data from web.

R2.1 Replicate Figure 1 in manuscript

  1. "supplied BED file": "BED" --> "bedGraph", since the 4th column is numeric. - I think this issue is resolved. #40 ?

Replicate Figure 1 in manuscript

@EdSaunders Below are the points from the reviewer, I suggest we wait until we fix all other issues, then we can re-create the plot for Figure 1, so it will match with the latest version.

2.1 I tried to reproduce Figure 1 using Locus Explorer and noted a few differences. I suggest regenerating the image for Figure 1 using the latest version.

2.2. The LDSmooth curve shapes for rs718961 and rs11649743 are different -- in Figure 1 they have one peak and the pink curve is split at the top, while in Locus Explorer, they have a large peak plus a smaller peak to the right (depending on LD). I tried adjusting LD but none of the values (0, 0.05, 0.10, 0.15, and the default 0.20) seemed to duplicate the shapes in Figure 1.

2.3 I uploaded 3 images generated by LocusLink here: http://imgur.com/a/pgAGg (can be viewed only by those with the link) In the order that they're displayed, they show LD 0.15, 0.10 and 0.05. Compare the pink and olive-green curve shapes with Figure 1 (and the left & right ends of the SNPType and Histone tracks vs. Fig 1).

Example input data: Please download Histone bigWig files

When I use the Example data in Plot Settings, and check all of the tracks, I can see data for all of them except for Histone - instead of data it has the message:

Please download Histone bigWig files!

And I don't see anything about how to incorporate those in the Help tabs.

ERROR: could not find function "windowsFonts"

Hi! I'm on Mac OS X 10.9.5; installed R 3.2.2, Cairo (1.14.2_1) and PostgreSQL (9.4.4) using homebrew; installed the required R packages as described in the "Required Software" section of README.md; and ran 'library(shiny)' and 'runGitHub("LocusExplorer", "oncogenetics")' as described.

Unfortunately when I visit the URL mentioned in the output (http://127.0.0.1:7074/) I get only the text:

ERROR: could not find function "windowsFonts"'

And I see the same error at the end of the output in R.

I'm not very familiar with R so I'm not sure how to proceed debugging this, but please let me know if there are diagnostic commands I could run or if you need more info.

Here is the R session from 'library shiny' onward:

> library(shiny)  
> runGitHub("LocusExplorer", "oncogenetics")
Downloading https://github.com/oncogenetics/LocusExplorer/archive/master.tar.gz

Listening on http://127.0.0.1:7074
data.table 1.9.6  For help type ?data.table or https://github.com/Rdatatable/data.table/wiki
The fastest way to learn (by data.table authors): https://www.datacamp.com/courses/data-analysis-the-data-table-way

Attaching package:dplyrThe following objects are masked frompackage:data.table:

    between, last

The following objects are masked frompackage:stats:

    filter, lag

The following objects are masked frompackage:base:

    intersect, setdiff, setequal, union


Attaching package:DTThe following objects are masked frompackage:shiny:

    dataTableOutput, renderDataTable

Loading required package: BiocGenerics
Loading required package: parallel

Attaching package:BiocGenericsThe following objects are masked frompackage:parallel:

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked frompackage:dplyr:

    combine, intersect, setdiff, union

The following object is masked frompackage:stats:

    xtabs

The following objects are masked frompackage:base:

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, as.vector, cbind, colnames, do.call, duplicated,
    eval, evalq, get, intersect, is.unsorted, lapply, mapply, match,
    mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank, rbind,
    rep.int, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unlist, unsplit

Creating a generic function forncharfrom packagebasein packageS4VectorsNeed specific help about ggbio? try mailing 
 the maintainer or visit http://tengfei.github.com/ggbio/

Attaching package:ggbioThe following objects are masked frompackage:ggplot2:

    geom_bar, geom_rect, geom_segment, ggsave, stat_bin, stat_identity,
    xlim

Loading required package: S4Vectors
Loading required package: stats4

Attaching package:S4VectorsThe following object is masked frompackage:dplyr:

    rename

Loading required package: IRanges

Attaching package:IRangesThe following object is masked frompackage:tidyr:

    expand

The following objects are masked frompackage:dplyr:

    collapse, desc, slice

The following object is masked frompackage:data.table:

    shift

Loading required package: GenomeInfoDb
Loading required package: GenomicFeatures
Loading required package: AnnotationDbi
Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.


Attaching package:AnnotationDbiThe following object is masked frompackage:dplyr:

    select

Loading required package: DBI

Error in eval(expr, envir, enclos) : 
  could not find function "windowsFonts"
Error in eval(expr, envir, enclos) : 
  could not find function "windowsFonts"

R3.3 ERROR

Duplicate of #11

When i click on plotSettings directly after loading the app, I receive the following message: Error in nrow(plotDatGeneticMap()) :
error in evaluating the argument 'x' in selecting a method for function 'nrow': Error in nrow(plotDatGeneticMap()) :
incorrect length (0), expecting: 1309

Error in nrow(plotDatLD()) :
error in evaluating the argument 'x' in selecting a method for function 'nrow': Error in fix.by(by.y, y) : 'by' must specify a uniquely valid column

Error : Aesthetics must either be ...

Hi

I have been playing around with LocusExplorer on Mac OS X and in general it's working well but I've noticed that when I try to zoom into a smaller region such as chr2:173330000-173360000 in Plot Settings, instead of the manhattan plot I get this error:

Error : Aesthetics must either be length one, or the same length as the dataProblems:BP, BP, PLog

That also appears in the console output in R.

BTW I'm not seeing the Recombination track, if it is the only one checked, I see no tracks?

Thanks,
Angie

R3.2 ERROR filename encoding - Source vs source - typo.

With a clean session, I receive the following error: Note: the specification for S3 class “AsIs” in package ‘jsonlite’ seems equivalent to one from package ‘BiocGenerics’: not turning on duplicate class definitions for this class.
Warning in file(filename, "r", encoding = encoding) :cannot open file 'source/UDF.R': No such file or directory Error in file(filename, "r", encoding = encoding) : cannot open the connection

After downloading the zip file, I figured out why the error occurs: The “source” directory had a upper-case “S” and was therefore not recognized. After changing the directory to “source”, I got the LocusExplorer to work. This should also be fixed.

R3.5 “Please download Histone bigWig files” message reword.

Not very user-friendly message because the user may not know where to download the file from, where to put it, etc. Should be more clear what to do in that case.
Update: I just saw that this message is listed in the FAQs. Maybe edit the error message and say (see FAQs for more details).

Related issue #39

Add a Snapshot tab

To compare plots for the same region from different datasets.
Once the plot if finalised, press snapshot, jpeg will be saved in temp folder, which then displayed in Snapshot tab.

Overlapping SNP names

Possible solution, needs testing.

http://stackoverflow.com/a/17332558/680068
https://cran.r-project.org/web/packages/FField/FField.pdf

p1 <- (ggplot(mtcars, aes(x = wt, y = mpg, label = rownames(mtcars))) + 
         geom_point() + geom_text() + ggtitle("Before"))
x.fact <- 100/max(mtcars$wt)
y.fact <- 100/max(mtcars$mpg)
coords <- FFieldPtRep(coords = cbind(mtcars$wt * x.fact, 
                                     mtcars$mpg * y.fact), rep.fact = 40)
x.t <- coords$x/x.fact
y.t <- coords$y/y.fact
p2 <- (ggplot(mtcars, aes(x = wt, y = mpg, label = rownames(mtcars))) + 
         geom_point() + geom_text(x = x.t, y = y.t) 
       #+ 
        # geom_segment(data = mtcars, xend = x.t, yend = y.t) + ggtitle("After")
       )
grid.arrange(p1, p2)

http://stackoverflow.com/questions/21004491/avoiding-overlapping-of-labels-with-direct-labels-and-ggplot2
http://directlabels.r-forge.r-project.org/

Multiple region as one upload

Similar to prostate data, when multiple regions uploaded as one file, drop down menu to display multiple regions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.