diff --git a/README.md b/README.md
index 9f458b1..e85b13a 100644
--- a/README.md
+++ b/README.md
@@ -1,177 +1,5 @@
[![Build Status](https://travis-ci.org/agduncan94/icgc-viewer.svg?branch=develop)](https://travis-ci.org/agduncan94/icgc-viewer)
# ICGC JBrowse Plugin
-A plugin for [JBrowse](https://jbrowse.org/) for viewing [ICGC](https://icgc.org/) data. For any bugs, issues, or feature recommendations please create an issue through GitHub.
+A plugin for [JBrowse](https://jbrowse.org/) for viewing [ICGC](https://icgc.org/) data. For any bugs, issues, or feature recommendations please create an issue or PR through GitHub.
-# Installation and Setup
-## 1. Install JBrowse
-Quick setup of JBrowse - https://github.com/GMOD/jbrowse/#install-jbrowse-from-github-for-developers
-
-## 2. Install Plugin
-See [JBrowse - Installing Plugins](https://jbrowse.org/docs/plugins.html) for a general approach to installing plugins.
-
-For installing icgc-viewer plugin:
-1) Copy the icgc-viewer folder into the JBrowse `plugins` directory.
-2) Add 'icgc-viewer' to the array of plugins in the `jbrowse_conf.json`.
-
-## 3. Install Reference Sequence Data
-Now setup the reference sequence used. ICGC requires the GRCh37 Human reference files.
-
-Download the GRCh37 `.fa` and `.fa.fai` files online (ex. http://bioinfo.hpc.cam.ac.uk/downloads/datasets/fasta/grch37/). Then put the following in `./data/tracks.conf` (note files may be named something else).
-
-```
-refSeqs=GRCh37.genome.fa.fai
-
-[tracks.refseqs]
-urlTemplate=GRCh37.genome.fa
-```
-
-## 4. Adding new tracks
-We have some basic example tracks in `data/tracks.conf`. You can also add new tracks by using the ICGC Dialog accessible within JBrowse. These are present in the menu under `ICGC`. See [Dynamic Track Generation](#dynamic-track-generation) for more details.
-
-## 5. Run JBrowse
-You'll have to run the following commands:
-
-```
-./setup.sh
-utils/jb_run.js -p 3000
-```
-
-JBrowse should now be running with the ICGC Plugin working!
-
-# JBrowse configuration
-## Faceted Track Selector
-Add the following to your jbrowse.conf to use the faceted track selector.
-```
-[trackSelector]
-type = Faceted
-displayColumns =
- + label
- + key
- + datatype
- + donor
- + project
-```
-
-# Available Store SeqFeature
-## A note on filters
-All SeqFeatures support filters as they are used in the ICGC API Documentation.
-
-You can view/edit the filters associated with a track by clicking the down arrow for the track menu and selecting `View Applied Filters`. Be careful, there are currently no checks to see if the filters are valid before applying them.
-
-## Genes
-A simple view of all genes returned by the ICGC portal for a given range of the chromosome you are looking at.
-
-If you specify a donor ID (donor field) in the track config file, only genes related to that donor will appear.
-```
-donor: DO229446
-```
-
-You can also use the filters field to pass filters to be applied to the track. The expected input is a filter object like the following:
-
-```
-{
- "gene" : {
- "type": {
- "is": [
- "protein_coding"
- ]
- }
- }
-}
-```
-
-To put it in the track config file you may want to minimize it as such:
-```
-filters={"gene":{"type":{"is":["protein_coding"]}}}
-```
-
-Example Track:
-```
-[tracks.ICGC_Genes_protein-coding]
-storeClass=icgc-viewer/Store/SeqFeature/Genes
-type=icgc-viewer/View/Track/GeneTrack
-key=ICGC_Genes_protein-coding
-unsafePopup=true
-filters={"gene":{"type":{"is":["protein_coding"]}}}
-```
-
-![ICGC Genes](images/ICGC-Genes-protein-coding.png)
-
-### Extra notes
-You can also set the `size` attribute (defaults to 1000). This is the theoretical maximum number of genes displayed at a time in JBrowse (per panel). The smaller the value, the faster JBrowse will be.
-
-## SimpleSomaticMutations
-A simple view of all the simple somatic mutations across all donors in the ICGC portal.
-
-If you specify a donor ID (donor field) in the track config file, only mutations related to the given donor will be shown (if the donor exists).
-```
-donor: DO229446
-```
-
-You can also use the filters field to pass filters to be applied to the track. The expected input is a filter object like the following:
-
-```
-{
- "mutation" : {
- "functionalImpact": {
- "is": [
- "High"
- ]
- }
- }
-}
-```
-
-To put it in the track config file you may want to minimize it as such:
-```
-filters={"mutation":{"functionalImpact":{"is":["High"]}}}
-```
-
-Example Track:
-```
-[tracks.ICGC_Mutations_high-impact]
-storeClass=icgc-viewer/Store/SeqFeature/SimpleSomaticMutations
-type=icgc-viewer/View/Track/SSMTrack
-key=ICGC_Mutations_high-impact
-unsafePopup=true
-filters={"mutation":{"functionalImpact":{"is":["High"]}}}
-```
-
-![ICGC SSMs](images/ICGC-SSM-high-impact.png)
-
-### Extra notes
-You can also set the `size` attribute (defaults to 500). This is the theoretical maximum number of mutations displayed at a time in JBrowse(per panel). The smaller the value, the faster JBrowse will be.
-
-# Dynamic track generation
-## Explore donors, genes and mutations
-In the menubar there is an ICGC button with an option to `Explore donors, genes and mutations`. This will bring up a dialog similar to the [advanced search page](https://dcc.icgc.org/search) on the ICGC portal. Here you can apply facets related to donor, gene and mutation. You can then create tracks based on the chosen facets.
-
-![ICGC Explore](images/ICGC-Explore-Dialog.png)
-
-## Explore projects
-There is also an options to search ICGC by projects. This allows you to see all of the associated SSMs and Genes per project in one track. If you want to apply additional facets to a project, you'll need to use the `Explore donors, genes and mutations` dialog.
-![ICGC Projects](images/ICGC-Projects-Dialog.png)
-
-# Export Types
-The following export types are supported by both Genes and SSMs. To export, select `Save track data` in the track dropdown. Note that not all track information is carried over to the exported file.
-* BED
-* GFF3
-* Sequin Table
-* CSV
-* Track Config
-
-# Miscellaneous
-## Advanced Usage of Tracks
-You do not need to add tracks directly from the ICGC Dialog. You can also define them in the `tracks.conf` file.
-
-See `data/advanced-tracks.conf` for some more complex usages, including filters.
-
-# Automated testing
-Cypress.io is used for testing this plugin. The following steps show how to run the tests locally.
-1. Install JBrowse and but don't install chromosome files.
-2. Download Chr 1 fasta from `http://ftp.ensembl.org/pub/release-75/fasta/homo_sapiens/dna/Homo_sapiens.GRCh37.75.dna.chromosome.1.fa.gz`. There should be the fasta index file in `cypress/data/Homo_sapiens.GRCh37.75.dna.chromosome.1.fa.fai`. Put these files into `jbrowse/data/`.
-3. Install Cypress.io with `npm install`.
-4. Place `cypress/data/tracks.conf` into your `jbrowse/data/` directory. Make sure no other tracks are present.
-5. Run `npx cypress open` or `npx cypress run` or `npm run e2e`
-
-**Note** while some tests have mocked endpoints, not all endpoints are mocked. This could lead to breakage of tests in the future.
\ No newline at end of file
+Check out [our documentation](https://agduncan94.github.io/icgc-viewer/) for information on installation, available features, and more.
\ No newline at end of file
diff --git a/cypress/fixtures/gene/track-conf-export.conf b/cypress/fixtures/gene/track-conf-export.conf
index 65e5b48..e84e813 100644
--- a/cypress/fixtures/gene/track-conf-export.conf
+++ b/cypress/fixtures/gene/track-conf-export.conf
@@ -5,4 +5,4 @@ key=ICGC_Genes
metadata.datatype=Genes
unsafePopup=true
size=1000
-filters={"gene":{"location":{"is":["1:0-249012431"]}}}
\ No newline at end of file
+filters={}
\ No newline at end of file
diff --git a/cypress/fixtures/ssm/track-conf-export.conf b/cypress/fixtures/ssm/track-conf-export.conf
index 1f488ff..c7072a3 100644
--- a/cypress/fixtures/ssm/track-conf-export.conf
+++ b/cypress/fixtures/ssm/track-conf-export.conf
@@ -5,4 +5,4 @@ key=ICGC_Mutations
metadata.datatype=SimpleSomaticMutations
unsafePopup=true
size=500
-filters={"mutation":{"location":{"is":["1:0-249012431"]}}}
\ No newline at end of file
+filters={}
\ No newline at end of file
diff --git a/cypress/integration/ExploreICGC.js b/cypress/integration/ExploreICGC.js
index 8881c18..6d2ebfd 100644
--- a/cypress/integration/ExploreICGC.js
+++ b/cypress/integration/ExploreICGC.js
@@ -145,8 +145,8 @@ describe('Explore ICGC', function() {
// Add tracks and check that they were added
cy.get('.dijitTabContainer').eq(1).within(() => {
- cy.contains('All Genes for Donor').eq(0).click()
- cy.contains('All SSMs for Donor').eq(0).click()
+ cy.contains('All Genes').eq(0).click()
+ cy.contains('All Mutations').eq(0).click()
})
closePopup()
@@ -178,7 +178,7 @@ describe('Explore ICGC', function() {
// Apply gene filter - type rRNA
selectResultsTab(0)
cy.get('.dijitDialog').within(() => {
- selectFacetTab(1, 1, 24)
+ selectFacetTab(1, 1, 9)
})
checkAllResultsTab(
@@ -190,7 +190,7 @@ describe('Explore ICGC', function() {
// Apply mutation filter - consequence type exon variant
selectResultsTab(0)
cy.get('.dijitDialog').within(() => {
- selectFacetTab(2, 5, 1)
+ selectFacetTab(2, 5, 2)
})
checkAllResultsTab(
diff --git a/cypress/integration/GeneExport.js b/cypress/integration/GeneExport.js
index 484c910..95c6fd5 100644
--- a/cypress/integration/GeneExport.js
+++ b/cypress/integration/GeneExport.js
@@ -73,7 +73,7 @@ describe('Gene track', function() {
it('Should be able to export genes in various export formats', function() {
testExport(2, 'GFF3', ['##gff-version 3', '##sequence-region', 'protein_coding'])
testExport(3, 'BED', ['track name="ICGC_Genes" useScore=0', '1 237205504 237997287 ENSG00000198626 +'])
- testExport(4, 'CSV', ['type,start,end,strand,id,gene name,biotype,symbol,type', 'protein_coding,237205504,237997287,1,,ryanodine receptor 2 (cardiac),,RYR2,protein_coding'])
+ testExport(4, 'CSV', ['id,type,chromosome,start,end,strand,gene name,symbol', 'ENSG00000198626,protein_coding,1,237205504,237997287,1,+,ryanodine receptor 2 (cardiac),RYR2'])
testExport(5, 'Sequin Table', ['>Feature 1', '237205505 237997287 protein_coding'])
cy.fixture('gene/track-conf-export.conf').then((json) => {
testExport(6, 'Track Config', [json])
@@ -90,7 +90,7 @@ describe('Gene track', function() {
\t},
\t"unsafePopup": true,
\t"size": 1000,
-\t"filters": "{\\"gene\\":{\\"location\\":{\\"is\\":[\\"1:0-249012431\\"]}}}"
+\t"filters": "{}"
}`
])
})
diff --git a/cypress/integration/ProjectDialog.js b/cypress/integration/ProjectDialog.js
index 3b2eeda..8ddd582 100644
--- a/cypress/integration/ProjectDialog.js
+++ b/cypress/integration/ProjectDialog.js
@@ -41,7 +41,7 @@ describe('Project dialog', function() {
it('Should be able to view projects', function() {
// Open track menu
cy.get('#dropdownbutton_icgc').type('{enter}')
- cy.contains('Explore Projects').click()
+ cy.contains('Explore projects').click()
// Check that projects viewer is opened and has expected content
cy.contains('View projects available on the ICGC Data Portal')
@@ -50,10 +50,10 @@ describe('Project dialog', function() {
// Add SSM and Gene track for project BRCA-US (assume first in list)
cy.get('#dijit_form_ComboButton_0_arrow').should('be.visible').type('{enter}')
- cy.contains('SSMs for Project').click()
+ cy.contains('All Mutations').click()
cy.get('#dijit_form_ComboButton_0_arrow').should('be.visible').type('{enter}')
- cy.contains('Genes for Project').click()
+ cy.contains('All Genes').click()
// Go to next page and ensure pagination works (assume PRAD-CA on second page)
cy.contains('Next').click()
diff --git a/cypress/integration/SSMExport.js b/cypress/integration/SSMExport.js
index 40ef2f0..6a5ebbd 100644
--- a/cypress/integration/SSMExport.js
+++ b/cypress/integration/SSMExport.js
@@ -78,7 +78,7 @@ describe('SSM track', function() {
it('Should be able to export SSMs in various export formats', function() {
testExport(2, 'GFF3', ['##gff-version 3', '##sequence-region', 'single base substitution'])
testExport(3, 'BED', ['track name="ICGC_Mutations" useScore=0', '1 115256528 115256528 MU68272'])
- testExport(4, 'CSV', ['type,start,end,strand,id,allele in the reference assembly,mutation,reference genome assembly', 'single base substitution,115256528,115256528,,,T,T>C,GRCh37'])
+ testExport(4, 'CSV', ['id,type,chromosome,start,end,allele in the reference assembly,mutation,reference genome assembly', 'MU68272,single base substitution,1,115256528,115256528,T,T>C,GRCh37'])
testExport(5, 'Sequin Table', ['>Feature 1', '115256529 115256528 single base substitution'])
cy.fixture('ssm/track-conf-export.conf').then((json) => {
@@ -96,7 +96,7 @@ describe('SSM track', function() {
\t},
\t"unsafePopup": true,
\t"size": 500,
-\t"filters": "{\\"mutation\\":{\\"location\\":{\\"is\\":[\\"1:0-249012431\\"]}}}"
+\t"filters": "{}"
}`
])
})
diff --git a/docs/.gitignore b/docs/.gitignore
new file mode 100644
index 0000000..45c1505
--- /dev/null
+++ b/docs/.gitignore
@@ -0,0 +1,3 @@
+_site
+.sass-cache
+.jekyll-metadata
diff --git a/docs/404.html b/docs/404.html
new file mode 100644
index 0000000..c472b4e
--- /dev/null
+++ b/docs/404.html
@@ -0,0 +1,24 @@
+---
+layout: default
+---
+
+
+
+
+
404
+
+
Page not found :(
+
The requested page could not be found.
+
diff --git a/docs/Gemfile b/docs/Gemfile
new file mode 100644
index 0000000..8ac6dfb
--- /dev/null
+++ b/docs/Gemfile
@@ -0,0 +1,31 @@
+source "https://rubygems.org"
+
+# Hello! This is where you manage which Jekyll version is used to run.
+# When you want to use a different version, change it below, save the
+# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
+#
+# bundle exec jekyll serve
+#
+# This will help ensure the proper Jekyll version is running.
+# Happy Jekylling!
+gem "jekyll", "~> 3.7.4"
+
+# This is the default theme for new Jekyll sites. You may change this to anything you like.
+gem "minima", "~> 2.0"
+
+# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
+# uncomment the line below. To upgrade, run `bundle update github-pages`.
+# gem "github-pages", group: :jekyll_plugins
+
+# If you have any plugins, put them here!
+group :jekyll_plugins do
+ gem "jekyll-feed", "~> 0.6"
+end
+
+# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
+gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
+
+# Performance-booster for watching directories on Windows
+gem "wdm", "~> 0.1.0" if Gem.win_platform?
+
+gem "just-the-docs"
diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock
new file mode 100644
index 0000000..616604f
--- /dev/null
+++ b/docs/Gemfile.lock
@@ -0,0 +1,77 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ addressable (2.7.0)
+ public_suffix (>= 2.0.2, < 5.0)
+ colorator (1.1.0)
+ concurrent-ruby (1.1.6)
+ em-websocket (0.5.1)
+ eventmachine (>= 0.12.9)
+ http_parser.rb (~> 0.6.0)
+ eventmachine (1.2.7)
+ ffi (1.12.2)
+ forwardable-extended (2.6.0)
+ http_parser.rb (0.6.0)
+ i18n (0.9.5)
+ concurrent-ruby (~> 1.0)
+ jekyll (3.7.4)
+ addressable (~> 2.4)
+ colorator (~> 1.0)
+ em-websocket (~> 0.5)
+ i18n (~> 0.7)
+ jekyll-sass-converter (~> 1.0)
+ jekyll-watch (~> 2.0)
+ kramdown (~> 1.14)
+ liquid (~> 4.0)
+ mercenary (~> 0.3.3)
+ pathutil (~> 0.9)
+ rouge (>= 1.7, < 4)
+ safe_yaml (~> 1.0)
+ jekyll-feed (0.13.0)
+ jekyll (>= 3.7, < 5.0)
+ jekyll-sass-converter (1.5.2)
+ sass (~> 3.4)
+ jekyll-seo-tag (2.6.1)
+ jekyll (>= 3.3, < 5.0)
+ jekyll-watch (2.2.1)
+ listen (~> 3.0)
+ just-the-docs (0.1.6)
+ jekyll (~> 3.3)
+ rake (~> 10.0)
+ kramdown (1.17.0)
+ liquid (4.0.3)
+ listen (3.2.1)
+ rb-fsevent (~> 0.10, >= 0.10.3)
+ rb-inotify (~> 0.9, >= 0.9.10)
+ mercenary (0.3.6)
+ minima (2.5.1)
+ jekyll (>= 3.5, < 5.0)
+ jekyll-feed (~> 0.9)
+ jekyll-seo-tag (~> 2.1)
+ pathutil (0.16.2)
+ forwardable-extended (~> 2.6)
+ public_suffix (4.0.3)
+ rake (10.5.0)
+ rb-fsevent (0.10.3)
+ rb-inotify (0.10.1)
+ ffi (~> 1.0)
+ rouge (3.17.0)
+ safe_yaml (1.0.5)
+ sass (3.7.4)
+ sass-listen (~> 4.0.0)
+ sass-listen (4.0.0)
+ rb-fsevent (~> 0.9, >= 0.9.4)
+ rb-inotify (~> 0.9, >= 0.9.7)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ jekyll (~> 3.7.4)
+ jekyll-feed (~> 0.6)
+ just-the-docs
+ minima (~> 2.0)
+ tzinfo-data
+
+BUNDLED WITH
+ 2.1.4
diff --git a/docs/_config.yml b/docs/_config.yml
new file mode 100644
index 0000000..51e3f35
--- /dev/null
+++ b/docs/_config.yml
@@ -0,0 +1,43 @@
+# Welcome to Jekyll!
+#
+# This config file is meant for settings that affect your whole blog, values
+# which you are expected to set up once and rarely edit after that. If you find
+# yourself editing this file very often, consider using Jekyll's data files
+# feature for the data you need to update frequently.
+#
+# For technical reasons, this file is *NOT* reloaded automatically when you use
+# 'bundle exec jekyll serve'. If you change this file, please restart the server process.
+
+# Site settings
+# These are used to personalize your new site. If you look in the HTML files,
+# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on.
+# You can create any custom variable you would like, and they will be accessible
+# in the templates via {{ site.myvariable }}.
+title: ICGC Viewer
+description: >- # this means to ignore newlines until "baseurl:"
+ A JBrowse plugin for interacting with the ICGC portal
+baseurl: "" # the subpath of your site, e.g. /blog
+url: "https://agduncan94.github.io/icgc-viewer" # the base hostname & protocol for your site, e.g. http://example.com
+
+# Build settings
+markdown: kramdown
+theme: just-the-docs
+remote_theme: pmarsceill/just-the-docs
+plugins:
+ - jekyll-feed
+
+aux_links:
+ "ICGC Viewer on GitHub":
+ - "//github.com/agduncan94/icgc-viewer"
+
+# Exclude from processing.
+# The following items will not be processed, by default. Create a custom list
+# to override the default setting.
+# exclude:
+# - Gemfile
+# - Gemfile.lock
+# - node_modules
+# - vendor/bundle/
+# - vendor/cache/
+# - vendor/gems/
+# - vendor/ruby/
diff --git a/images/ICGC-Explore-Dialog.png b/docs/assets/images/ICGC-Explore-Dialog.png
similarity index 100%
rename from images/ICGC-Explore-Dialog.png
rename to docs/assets/images/ICGC-Explore-Dialog.png
diff --git a/images/ICGC-Genes-protein-coding.png b/docs/assets/images/ICGC-Genes-protein-coding.png
similarity index 100%
rename from images/ICGC-Genes-protein-coding.png
rename to docs/assets/images/ICGC-Genes-protein-coding.png
diff --git a/images/ICGC-Projects-Dialog.png b/docs/assets/images/ICGC-Projects-Dialog.png
similarity index 100%
rename from images/ICGC-Projects-Dialog.png
rename to docs/assets/images/ICGC-Projects-Dialog.png
diff --git a/images/ICGC-SSM-high-impact.png b/docs/assets/images/ICGC-SSM-high-impact.png
similarity index 100%
rename from images/ICGC-SSM-high-impact.png
rename to docs/assets/images/ICGC-SSM-high-impact.png
diff --git a/docs/developer.md b/docs/developer.md
new file mode 100644
index 0000000..3bbbb2d
--- /dev/null
+++ b/docs/developer.md
@@ -0,0 +1,22 @@
+---
+layout: default
+title: Developers
+nav_order: 4
+---
+# Extra Notes for Developers
+This section just goes over some areas of the code to help new developers navigate.
+
+## js/Model
+These files override the function for printing to the feature dialog. It overrides the get function to display content that requires extra API calls (on top of the call to grab the whole track). For example, this is used to generate the projects table shown on mutation feature dialogs.
+
+## js/Store/SeqFeature
+These files connect the ICGC API to JBrowse by creating a set of features based on an API call.
+
+## js/View
+The top level contains files that create the various dialog boxes that appear in the menu bar. These allow for the dynamic generation of tracks.
+
+### Export
+These files define export types for mutation and gene tracks.
+
+### Track
+These files extend the track dropdown options to include things like shareable links and view filters. This is also where overrides for the format of the feature dialogs are.
\ No newline at end of file
diff --git a/docs/index.md b/docs/index.md
new file mode 100644
index 0000000..6ce8dbf
--- /dev/null
+++ b/docs/index.md
@@ -0,0 +1,27 @@
+---
+layout: default
+title: Home
+nav_order: 1
+description: "ICGC Viewer is a JBrowse plugin for creating tracks using data from the ICGC portal."
+permalink: /
+---
+
+# ICGC JBrowse Plugin
+{: .fs-9 }
+A plugin for [JBrowse](https://jbrowse.org/) for viewing [ICGC](https://icgc.org/) data.
+{: .fs-6 .fw-300 }
+---
+
+# Overview
+This plugin provides the ability to create mutation and gene tracks on JBrowse based on complex query filters. These filters are the same as those used in the ICGC API.
+
+[See the tracks page]({{ site.baseurl }}{% link tracks.md %}) for some examples of what this plugin is capable of.
+
+# Features
+* Create Mutation and Gene tracks with rich metadata
+* Used faceted search similar to that found on the ICGC Portal to create complex filters
+* Share your tracks with others
+* Export your tracks to common formats like BED, GFF3 and CSV
+
+# Contributing
+For any bugs, issues, or feature recommendations please create an issue or PR through GitHub.
\ No newline at end of file
diff --git a/docs/install.md b/docs/install.md
new file mode 100644
index 0000000..7b4241b
--- /dev/null
+++ b/docs/install.md
@@ -0,0 +1,55 @@
+---
+layout: default
+title: Installation
+nav_order: 2
+---
+
+# Installation and Setup
+## 1. Install JBrowse
+Follow JBrowse readme for [quick setup.](https://github.com/GMOD/jbrowse/#install-jbrowse-from-github-for-developers)
+
+## 2. Install Plugin
+See [JBrowse - Installing Plugins](https://jbrowse.org/docs/plugins.html) for a general approach to installing plugins.
+
+For installing icgc-viewer plugin:
+1. Copy the icgc-viewer folder into the JBrowse `plugins` directory.
+2. Add 'icgc-viewer' to the array of plugins in the `jbrowse_conf.json`.
+
+## 3. Install Reference Sequence Data
+Now setup the reference sequence used. ICGC requires the GRCh37 Human reference files.
+
+Download the GRCh37 `.fa` and `.fa.fai` files online (ex. http://bioinfo.hpc.cam.ac.uk/downloads/datasets/fasta/grch37/). Then put the following in `./data/tracks.conf` (note files may be named something else).
+
+```
+refSeqs=GRCh37.genome.fa.fai
+
+[tracks.refseqs]
+urlTemplate=GRCh37.genome.fa
+```
+
+## 4. Adding new tracks
+We have some basic example tracks in `data/tracks.conf`. You can also add new tracks by using the ICGC Dialog accessible within JBrowse. These are present in the menu under `ICGC`. See [Dynamic Track Generation](#dynamic-track-generation) for more details.
+
+## 5. Run JBrowse
+You'll have to run the following commands:
+
+```
+./setup.sh
+utils/jb_run.js -p 3000
+```
+
+JBrowse should now be running with the ICGC Plugin working!
+
+# JBrowse configuration
+## Faceted Track Selector
+Add the following to your jbrowse.conf to use the faceted track selector.
+```
+[trackSelector]
+type = Faceted
+displayColumns =
+ + label
+ + key
+ + datatype
+ + donor
+ + project
+```
\ No newline at end of file
diff --git a/docs/testing.md b/docs/testing.md
new file mode 100644
index 0000000..776bbb9
--- /dev/null
+++ b/docs/testing.md
@@ -0,0 +1,15 @@
+---
+layout: default
+title: Testing
+nav_order: 5
+---
+
+# Automated testing
+Cypress.io is used for testing this plugin. The following steps show how to run the tests locally.
+1. Install JBrowse and but don't install chromosome files.
+2. Download Chr 1 fasta from `http://ftp.ensembl.org/pub/release-75/fasta/homo_sapiens/dna/Homo_sapiens.GRCh37.75.dna.chromosome.1.fa.gz`. There should be the fasta index file in `cypress/data/Homo_sapiens.GRCh37.75.dna.chromosome.1.fa.fai`. Put these files into `jbrowse/data/`.
+3. Install Cypress.io with `npm install`.
+4. Place `cypress/data/tracks.conf` into your `jbrowse/data/` directory. Make sure no other tracks are present.
+5. Run `npx cypress open` or `npx cypress run` or `npm run e2e`
+
+**Note** while some tests have mocked endpoints, not all endpoints are mocked. This could lead to breakage of tests in the future.
\ No newline at end of file
diff --git a/docs/tracks.md b/docs/tracks.md
new file mode 100644
index 0000000..00f2a41
--- /dev/null
+++ b/docs/tracks.md
@@ -0,0 +1,136 @@
+---
+layout: default
+title: Tracks
+nav_order: 3
+---
+
+# Tracks
+{: .no_toc }
+
+Create Mutation (SSM) and Gene tracks using a dynamic track generator
+{: .fs-6 .fw-300 }
+
+## Table of contents
+{: .no_toc .text-delta }
+
+1. TOC
+{:toc}
+
+# Filters
+All of these tracks support filters as they are used in the ICGC API Documentation.
+
+You can view/edit the filters associated with a track by clicking the down arrow for the track menu and selecting `View Applied Filters`. Be careful, there are currently no checks to see if the filters are valid before applying them.
+
+# Available Track Types
+
+## Genes
+A simple view of all genes returned by the ICGC portal for a given range of the chromosome you are looking at.
+
+If you specify a donor ID (donor field) in the track config file, only genes related to that donor will appear. This field supports multiple IDs at a time using by using commas.
+```
+donor: DO229446
+```
+
+You can also use the filters field to pass filters to be applied to the track. The expected input is a filter object like the following:
+
+```
+{
+ "gene" : {
+ "type": {
+ "is": [
+ "protein_coding"
+ ]
+ }
+ }
+}
+```
+
+To put it in the track config file you may want to minimize it as such:
+```
+filters={"gene":{"type":{"is":["protein_coding"]}}}
+```
+
+Example Track:
+```
+[tracks.ICGC_Genes_protein-coding]
+storeClass=icgc-viewer/Store/SeqFeature/Genes
+type=icgc-viewer/View/Track/GeneTrack
+key=ICGC_Genes_protein-coding
+unsafePopup=true
+filters={"gene":{"type":{"is":["protein_coding"]}}}
+```
+
+![ICGC Genes]({{ site.url }}/assets/images/ICGC-Genes-protein-coding.png)
+
+### Extra notes
+{: .no_toc }
+You can also set the `size` attribute (defaults to 1000). This is the theoretical maximum number of genes displayed at a time in JBrowse (per panel). The smaller the value, the faster JBrowse will be.
+
+## SimpleSomaticMutations
+A simple view of all the simple somatic mutations across all donors in the ICGC portal.
+
+If you specify a donor ID (donor field) in the track config file, only mutations related to the given donor will be shown (if the donor exists).
+```
+donor: DO229446
+```
+
+You can also use the filters field to pass filters to be applied to the track. The expected input is a filter object like the following:
+
+```
+{
+ "mutation" : {
+ "functionalImpact": {
+ "is": [
+ "High"
+ ]
+ }
+ }
+}
+```
+
+To put it in the track config file you may want to minimize it as such:
+```
+filters={"mutation":{"functionalImpact":{"is":["High"]}}}
+```
+
+Example Track:
+```
+[tracks.ICGC_Mutations_high-impact]
+storeClass=icgc-viewer/Store/SeqFeature/SimpleSomaticMutations
+type=icgc-viewer/View/Track/SSMTrack
+key=ICGC_Mutations_high-impact
+unsafePopup=true
+filters={"mutation":{"functionalImpact":{"is":["High"]}}}
+```
+
+![ICGC SSMs]({{ site.url }}/assets/images/ICGC-SSM-high-impact.png)
+
+### Extra notes
+{: .no_toc }
+You can also set the `size` attribute (defaults to 500). This is the theoretical maximum number of mutations displayed at a time in JBrowse(per panel). The smaller the value, the faster JBrowse will be.
+
+# Dynamic track generation
+## Explore donors, genes and mutations
+In the menubar there is an ICGC button with an option to `Explore donors, genes and mutations`. This will bring up a dialog similar to the [advanced search page](https://dcc.icgc.org/search) on the ICGC portal. Here you can apply facets related to donor, gene and mutation. You can then create tracks based on the chosen facets.
+
+![ICGC Explore]({{ site.url }}/assets/images/ICGC-Explore-Dialog.png)
+
+
+## Explore projects
+There is also an options to search ICGC by projects. This allows you to see all of the associated Mutations and Genes per project in one track. If you want to apply additional facets to a project, you'll need to use the `Explore donors, genes and mutations` dialog.
+
+![ICGC Projects]({{ site.url }}/assets/images/ICGC-Projects-Dialog.png)
+
+# Export Types
+The following export types are supported by both Genes and Mutations. To export, select `Save track data` in the track dropdown. Note that not all track information is carried over to the exported file.
+* BED
+* GFF3
+* Sequin Table
+* CSV
+* Track Config
+
+# Miscellaneous
+## Advanced Usage of Tracks
+You do not need to add tracks directly from the ICGC Dialog. You can also define them in the `tracks.conf` file.
+
+See `data/advanced-tracks.conf` for some more complex usages, including filters.
\ No newline at end of file
diff --git a/icgc-viewer/js/Model/GeneFeature.js b/icgc-viewer/js/Model/GeneFeature.js
index f1fb1f4..791865d 100644
--- a/icgc-viewer/js/Model/GeneFeature.js
+++ b/icgc-viewer/js/Model/GeneFeature.js
@@ -2,44 +2,13 @@
* Simple implementation of an Gene feature object.
*/
define([
- 'JBrowse/Util',
+ 'JBrowse/Model/SimpleFeature',
+ 'dojo/_base/declare',
'dojo/request'
],
- function( Util, request ) {
+ function( SimpleFeature, declare, request ) {
-var counter = 0;
-
-var GeneFeature = Util.fastDeclare({
-
-/**
- * @param args.data {Object} key-value data, must include 'start' and 'end'
- * @param args.parent {Feature} optional parent feature
- * @param args.id {String} optional unique identifier. can also be in data.uniqueID.
- *
- * Note: args.data.subfeatures can be an array of these same args,
- * which will be inflated to more instances of this class.
- */
-constructor: function( args ) {
- args = args || {};
- this.data = args.data || {};
- this._parent = args.parent;
- this._uniqueID = args.id || this.data.uniqueID || (
- this._parent ? this._parent.id()+'_'+(counter++) : 'GeneFeature_'+(counter++)
- );
-
- // inflate any subfeatures that are not already feature objects
- var subfeatures;
- if(( subfeatures = this.data.subfeatures )) {
- for( var i = 0; i < subfeatures.length; i++ ) {
- if( typeof subfeatures[i].get != 'function' ) {
- subfeatures[i] = new GeneFeature(
- { data: subfeatures[i],
- parent: this
- });
- }
- }
- }
-},
+return declare(SimpleFeature, {
/**
* Get a piece of data about the feature. All features must have
@@ -129,59 +98,8 @@ createProjectIncidenceTable: function(sets) {
*/
createLinkWithIdAndName: function(link, id, name) {
return id !== null ? "" + name + "" : "n/a";
-},
-
-
-/**
- * Set an item of data.
- */
-set: function( name, val ) {
- this.data[ name ] = val;
-},
-
-/**
- * Get an array listing which data keys are present in this feature.
- */
-tags: function() {
- var t = [];
- var d = this.data;
- for( var k in d ) {
- if( d.hasOwnProperty( k ) )
- t.push( k );
- }
- return t;
-},
-
-/**
- * Get the unique ID of this feature.
- */
-id: function( newid ) {
- if( newid )
- this._uniqueID = newid;
- return this._uniqueID;
-},
-
-/**
- * Get this feature's parent feature, or undefined if none.
- */
-parent: function() {
- return this._parent;
-},
-
-/**
- * Get an array of child features, or undefined if none.
- */
-children: function() {
- return this.get('subfeatures');
-},
-
-toJSON: function() {
- const d = Object.assign({},this)
- delete d._parent
- return d
}
});
-return GeneFeature;
});
\ No newline at end of file
diff --git a/icgc-viewer/js/Model/SSMFeature.js b/icgc-viewer/js/Model/SSMFeature.js
index 816493b..7356407 100644
--- a/icgc-viewer/js/Model/SSMFeature.js
+++ b/icgc-viewer/js/Model/SSMFeature.js
@@ -2,44 +2,13 @@
* Simple implementation of an SSM feature object.
*/
define([
- 'JBrowse/Util',
+ 'JBrowse/Model/SimpleFeature',
+ 'dojo/_base/declare',
'dojo/request'
],
- function( Util, request ) {
+ function( SimpleFeature, declare, request ) {
-var counter = 0;
-
-var SSMFeature = Util.fastDeclare({
-
-/**
- * @param args.data {Object} key-value data, must include 'start' and 'end'
- * @param args.parent {Feature} optional parent feature
- * @param args.id {String} optional unique identifier. can also be in data.uniqueID.
- *
- * Note: args.data.subfeatures can be an array of these same args,
- * which will be inflated to more instances of this class.
- */
-constructor: function( args ) {
- args = args || {};
- this.data = args.data || {};
- this._parent = args.parent;
- this._uniqueID = args.id || this.data.uniqueID || (
- this._parent ? this._parent.id()+'_'+(counter++) : 'SSMFeature_'+(counter++)
- );
-
- // inflate any subfeatures that are not already feature objects
- var subfeatures;
- if(( subfeatures = this.data.subfeatures )) {
- for( var i = 0; i < subfeatures.length; i++ ) {
- if( typeof subfeatures[i].get != 'function' ) {
- subfeatures[i] = new SSMFeature(
- { data: subfeatures[i],
- parent: this
- });
- }
- }
- }
-},
+return declare(SimpleFeature, {
projects: undefined,
@@ -147,56 +116,5 @@ createLinkWithId: function(link, id) {
return id ? "" + id + "" : "n/a";
},
-/**
- * Set an item of data.
- */
-set: function( name, val ) {
- this.data[ name ] = val;
-},
-
-/**
- * Get an array listing which data keys are present in this feature.
- */
-tags: function() {
- var t = [];
- var d = this.data;
- for( var k in d ) {
- if( d.hasOwnProperty( k ) )
- t.push( k );
- }
- return t;
-},
-
-/**
- * Get the unique ID of this feature.
- */
-id: function( newid ) {
- if( newid )
- this._uniqueID = newid;
- return this._uniqueID;
-},
-
-/**
- * Get this feature's parent feature, or undefined if none.
- */
-parent: function() {
- return this._parent;
-},
-
-/**
- * Get an array of child features, or undefined if none.
- */
-children: function() {
- return this.get('subfeatures');
-},
-
-toJSON: function() {
- const d = Object.assign({},this)
- delete d._parent
- return d
-}
-
});
-
-return SSMFeature;
});
\ No newline at end of file
diff --git a/icgc-viewer/js/Store/SeqFeature/Genes.js b/icgc-viewer/js/Store/SeqFeature/Genes.js
index bbdb635..80dcb15 100644
--- a/icgc-viewer/js/Store/SeqFeature/Genes.js
+++ b/icgc-viewer/js/Store/SeqFeature/Genes.js
@@ -28,6 +28,20 @@ function(
this.size = args.size !== undefined ? parseInt(args.size) : 1000;
},
+ /**
+ * Converts an int to strand 1 -> +, -1 -> -
+ * @param {number} strand
+ */
+ convertIntToStrand: function(strand) {
+ if (strand == 1) {
+ return '+'
+ } else if (strand == -1) {
+ return '-'
+ } else {
+ return 'n/a'
+ }
+ },
+
/**
* Given an array of IDs and a link, creates a comma-separated list of links to the ids
* @param {string} link Base URL for link
@@ -53,14 +67,15 @@ function(
*/
getFilterQuery: function(ref, start, end) {
var thisB = this;
+ let filtersCopy = JSON.parse(JSON.stringify(thisB.filters))
// If empty need to create skeleton
- if (Object.keys(thisB.filters).length === 0 || thisB.filters.gene == undefined) {
- thisB.filters.gene = {};
+ if (Object.keys(filtersCopy).length === 0 || filtersCopy.gene == undefined) {
+ filtersCopy.gene = {};
}
- thisB.filters.gene.location = { "is": [ ref + ':' + start + '-' + end ]};
- return JSON.stringify(thisB.filters);
+ filtersCopy.gene.location = { "is": [ ref + ':' + start + '-' + end ]};
+ return JSON.stringify(filtersCopy);
},
/**
@@ -117,11 +132,13 @@ function(
'annotations': gene.id,
'gene description': thisB.prettyValue(gene.description),
'entity_name': gene.id,
+ 'chromosome': gene.chromosome,
'about': {
'gene name': thisB.prettyValue(gene.name),
'symbol': thisB.prettyValue(gene.symbol),
'type': thisB.prettyValue(gene.type),
- 'id': thisB.prettyValue(gene.id)
+ 'id': thisB.prettyValue(gene.id),
+ 'strand': thisB.convertIntToStrand(gene.strand)
},
'references': {
'icgc': thisB.createLinkWithId(ICGC_LINK, gene.id),
diff --git a/icgc-viewer/js/Store/SeqFeature/SimpleSomaticMutations.js b/icgc-viewer/js/Store/SeqFeature/SimpleSomaticMutations.js
index 22ed931..a606350 100644
--- a/icgc-viewer/js/Store/SeqFeature/SimpleSomaticMutations.js
+++ b/icgc-viewer/js/Store/SeqFeature/SimpleSomaticMutations.js
@@ -76,8 +76,18 @@ function(
return list && list.length > 0 ? list : 'n/a';
},
+ /**
+ * Converts an int to strand 1 -> +, -1 -> -
+ * @param {number} strand
+ */
convertIntToStrand: function(strand) {
- return strand == 1 ? '+' : '-'
+ if (strand == 1) {
+ return '+'
+ } else if (strand == -1) {
+ return '-'
+ } else {
+ return 'n/a'
+ }
},
/**
@@ -134,14 +144,15 @@ function(
*/
getFilterQuery: function(ref, start, end) {
var thisB = this;
+ let filtersCopy = JSON.parse(JSON.stringify(thisB.filters))
// If empty need to create skeleton
- if (Object.keys(thisB.filters).length === 0 || thisB.filters.mutation == undefined) {
- thisB.filters.mutation = {};
+ if (Object.keys(filtersCopy).length === 0 || filtersCopy.mutation == undefined) {
+ filtersCopy.mutation = {};
}
- thisB.filters.mutation.location = { "is": [ ref + ':' + start + '-' + end ]};
- return JSON.stringify(thisB.filters);
+ filtersCopy.mutation.location = { "is": [ ref + ':' + start + '-' + end ]};
+ return JSON.stringify(filtersCopy);
},
/**
@@ -191,6 +202,7 @@ function(
'end': variant.end - 1,
'type': thisB.prettyValue(variant.type),
'entity_name': variant.id,
+ 'chromosome': variant.chromosome,
'about': {
'mutation': thisB.prettyValue(variant.mutation),
'allele in the reference assembly': thisB.prettyValue(variant.referenceGenomeAllele),
diff --git a/icgc-viewer/js/View/Export/CSV.js b/icgc-viewer/js/View/Export/CSV.js
index 44687d8..c1cb018 100644
--- a/icgc-viewer/js/View/Export/CSV.js
+++ b/icgc-viewer/js/View/Export/CSV.js
@@ -17,17 +17,15 @@ return declare( ExportBase,
defaultHeader: [
'type',
+ 'chromosome',
'start',
- 'end',
- 'strand',
- 'id'
+ 'end'
],
geneHeader: [
+ 'strand',
'gene name',
- 'biotype',
- 'symbol',
- 'type'
+ 'symbol'
],
ssmHeader: [
@@ -39,20 +37,27 @@ return declare( ExportBase,
fullHeader: [],
_printHeader: function() {
- if (this.store.config.storeClass === 'icgc-viewer/Store/SeqFeature/Genes') {
- this.fullHeader = this.geneHeader
- } else if (this.store.config.storeClass === 'icgc-viewer/Store/SeqFeature/SimpleSomaticMutations') {
- this.fullHeader = this.ssmHeader
+ this.fullHeader = []
+ if (this.store.config.type === 'icgc-viewer/Store/SeqFeature/Genes' || this.store.config.storeClass === 'icgc-viewer/Store/SeqFeature/Genes') {
+ this.fullHeader = [...this.geneHeader];
+ } else if (this.store.config.type === 'icgc-viewer/Store/SeqFeature/SimpleSomaticMutations' || this.store.config.storeClass === 'icgc-viewer/Store/SeqFeature/SimpleSomaticMutations') {
+ this.fullHeader = [...this.ssmHeader];
}
- var headerString = (this.defaultHeader.concat(this.fullHeader)).join(',') + '\n'
- this.print(headerString)
+ var headerString = (this.defaultHeader.concat(this.fullHeader)).join(',')
+ this.print('id,')
+ this.print(headerString + '\n')
},
formatFeature: function( feature ) {
var featureArray = []
- this.defaultHeader.forEach(field => featureArray.push(feature.get(field)))
var about = feature.get('about')
+
+ featureArray.push(about['id'])
+ this.defaultHeader.forEach(field => featureArray.push(feature.get(field)))
+ if (this.store.config.type === 'icgc-viewer/Store/SeqFeature/Genes' || this.store.config.storeClass === 'icgc-viewer/Store/SeqFeature/Genes') {
+ featureArray.push(feature.get('strand'))
+ }
this.fullHeader.forEach(field => featureArray.push(about[field]))
return featureArray.join(",") + "\n"
}
diff --git a/icgc-viewer/js/View/ICGCDialog.js b/icgc-viewer/js/View/ICGCDialog.js
index 8c57ab6..8009c31 100644
--- a/icgc-viewer/js/View/ICGCDialog.js
+++ b/icgc-viewer/js/View/ICGCDialog.js
@@ -181,14 +181,14 @@ function (
/**
* Compare function used for sorting facets
- * @param {*} a Object with a string field called 'term'
- * @param {*} b Object with a string field called 'term'
+ * @param {*} a Object with a number field called 'count'
+ * @param {*} b Object with a number field called 'count'
*/
compareTermElements: function(a, b) {
- if (a.term < b.term) {
- return -1;
- } else if (a.term > b.term) {
+ if (a.count < b.count) {
return 1;
+ } else if (a.count > b.count) {
+ return -1;
} else {
return 0;
}
@@ -231,7 +231,7 @@ function (
}
// If facet has at least one term
if (facetsJsonResponse.facets[facet].terms) {
- // Sort in ascending alphabetical order
+ // Sort in descending order of counts
facetsJsonResponse.facets[facet].terms.sort(thisB.compareTermElements);
// Create a checkbox for each term
@@ -265,10 +265,7 @@ function (
}
// Update with newly applied filter
- for (var type of thisB.types) {
- thisB.updateAccordion(type);
- thisB.updateSearchResults(type);
- }
+ thisB.updateAccordionAndResults();
}
}, 'checkbox').placeAt(facetCheckbox);
@@ -334,6 +331,7 @@ function (
if (!facetsJsonResponse.code) {
if (facetsJsonResponse.pagination.from && facetsJsonResponse.pagination.count && facetsJsonResponse.pagination.total) {
var endResult = facetsJsonResponse.pagination.from + facetsJsonResponse.pagination.count - 1;
+ var donorsExplanation = dom.create('div', { innerHTML: "Add mutation and gene tracks for a given donor. Optionally apply the selected filters when adding tracks.", style: "font-size: 14px; margin-bottom: 5px; padding: 5px;" }, thisB.donorResultsTab.containerNode);
var resultsInfo = dom.create('div', { innerHTML: "Showing " + (facetsJsonResponse.pagination.from).toLocaleString() + " to " + endResult.toLocaleString() + " of " + (facetsJsonResponse.pagination.total).toLocaleString() }, thisB.donorResultsTab.containerNode);
thisB.createDonorsTable(facetsJsonResponse.hits, thisB.donorResultsTab.containerNode, combinedFacetObject);
thisB.createPaginationButtons(thisB.donorResultsTab.containerNode, facetsJsonResponse.pagination, type, thisB.donorPage);
@@ -360,31 +358,33 @@ function (
facetsResponse.json().then(function (facetsJsonResponse) {
if (!facetsJsonResponse.code) {
if (facetsJsonResponse.pagination.from && facetsJsonResponse.pagination.count && facetsJsonResponse.pagination.total) {
+ var mutationExplanation = dom.create('div', { innerHTML: "Add mutation tracks for all mutations available on the ICGC portal. Optionally apply the selected filters when adding tracks.", style: "font-size: 14px; margin-bottom: 5px; padding: 5px;" }, thisB.mutationResultsTab.containerNode);
+
var ssmMenu = new Menu({ style: "display: none;"});
var menuItemSSMFiltered = new MenuItem({
- label: "Filtered SSMs form ICGC",
+ label: "Filtered Mutations",
iconClass: "dijitIconNewTask",
onClick: function() {
thisB.addTrack('SimpleSomaticMutations', undefined, combinedFacetObject, 'icgc-viewer/View/Track/SSMTrack');
- alert("Adding track with all SSMs from the ICGC, with current filters applied");
+ alert("Adding track with all mutations from the ICGC, with current filters applied");
}
});
ssmMenu.addChild(menuItemSSMFiltered);
ssmMenu.startup();
var buttonAllSSMs = new ComboButton({
- label: "All SSMs from ICGC",
+ label: "All Mutations",
iconClass: "dijitIconNewTask",
dropDown: ssmMenu,
onClick: function() {
thisB.addTrack('SimpleSomaticMutations', undefined, undefined, 'icgc-viewer/View/Track/SSMTrack');
- alert("Add track with all SSMs from the ICGC");
+ alert("Add track with all mutations from the ICGC");
}
});
buttonAllSSMs.placeAt(thisB.mutationResultsTab.containerNode);
buttonAllSSMs.startup();
- thisB.addTooltipToButton(menuItemSSMFiltered, "Add track with all SSMs from the ICGC, with current filters applied");
- thisB.addTooltipToButton(buttonAllSSMs, "Add track with all SSMs from the ICGC");
+ thisB.addTooltipToButton(menuItemSSMFiltered, "Add track with all mutations from the ICGC, with current filters applied");
+ thisB.addTooltipToButton(buttonAllSSMs, "Add track with all mutations from the ICGC");
var endResult = facetsJsonResponse.pagination.from + facetsJsonResponse.pagination.count - 1;
var resultsInfo = dom.create('div', { innerHTML: "Showing " + (facetsJsonResponse.pagination.from).toLocaleString() + " to " + endResult.toLocaleString() + " of " + (facetsJsonResponse.pagination.total).toLocaleString() }, thisB.mutationResultsTab.containerNode);
@@ -414,9 +414,11 @@ function (
facetsResponse.json().then(function (facetsJsonResponse) {
if (!facetsJsonResponse.code) {
if (facetsJsonResponse.pagination.from && facetsJsonResponse.pagination.count && facetsJsonResponse.pagination.total) {
+ var geneExplanation = dom.create('div', { innerHTML: "Add gene tracks for all genes available on the ICGC portal. Optionally apply the selected filters when adding tracks.", style: "font-size: 14px; margin-bottom: 5px; padding: 5px;" }, thisB.geneResultsTab.containerNode);
+
var geneMenu = new Menu({ style: "display: none;"});
var menuItemGeneFiltered = new MenuItem({
- label: "Filtered Genes from ICGC",
+ label: "Filtered Genes",
iconClass: "dijitIconNewTask",
onClick: function() {
thisB.addTrack('Genes', undefined, combinedFacetObject, 'icgc-viewer/View/Track/GeneTrack');
@@ -427,7 +429,7 @@ function (
geneMenu.startup();
var buttonAllGenes = new ComboButton({
- label: "All Genes from ICGC",
+ label: "All Genes",
iconClass: "dijitIconNewTask",
dropDown: geneMenu,
style: "padding-right: 8px;",
@@ -661,7 +663,7 @@ function (
var geneMenu = new Menu({ style: "display: none;"});
var menuItemGeneFiltered = new MenuItem({
- label: "Filtered Genes for Donor",
+ label: "Filtered Genes",
iconClass: "dijitIconNewTask",
onClick: (function(hit, combinedFacetObject) {
return function() {
@@ -674,7 +676,7 @@ function (
geneMenu.startup();
var buttonAllGenes = new ComboButton({
- label: "All Genes for Donor",
+ label: "All Genes",
iconClass: "dijitIconNewTask",
dropDown: geneMenu,
onClick: (function(hit) {
@@ -697,7 +699,7 @@ function (
var ssmMenu = new Menu({ style: "display: none;"});
var menuItemSsmFiltered = new MenuItem({
- label: "Filtered SSMs for Donor",
+ label: "Filtered Mutations",
iconClass: "dijitIconNewTask",
onClick: (function(hit, combinedFacetObject) {
return function() {
@@ -710,7 +712,7 @@ function (
ssmMenu.startup();
var buttonAllSsms = new ComboButton({
- label: "All SSMs for Donor",
+ label: "All Mutations",
iconClass: "dijitIconNewTask",
dropDown: ssmMenu,
onClick: (function(hit) {
@@ -722,7 +724,7 @@ function (
});
buttonAllSsms.placeAt(ssmButtonNode);
buttonAllSsms.startup();
- thisB.addTooltipToButton(menuItemSsmFiltered, "Add track with all SSMs for the given donor, with current filters applied");
+ thisB.addTooltipToButton(menuItemSsmFiltered, "Add track with all mutations for the given donor, with current filters applied");
thisB.addTooltipToButton(buttonAllSsms, "Add track with all SSMS for the given donor");
// Place buttons in table
@@ -993,7 +995,7 @@ function (
label : "Highlight this Simple Somatic Mutation",
},
{
- label : "View SSM on ICGC",
+ label : "View Mutation on ICGC",
iconClass : "dijitIconSearch",
action: "newWindow",
url : function(track, feature) { return "https://dcc.icgc.org/mutations/" + feature.get('about')['id'] }
@@ -1064,6 +1066,14 @@ function (
thisB.donorFilters = {};
thisB.mutationFilters = {};
thisB.geneFilters = {};
+ thisB.updateAccordionAndResults();
+ },
+
+ /**
+ * For all types, will update the accordion and search results
+ */
+ updateAccordionAndResults: function() {
+ var thisB = this;
for (var type of thisB.types) {
thisB.updateAccordion(type);
thisB.updateSearchResults(type);
diff --git a/icgc-viewer/js/View/ICGCProjectDialog.js b/icgc-viewer/js/View/ICGCProjectDialog.js
index 77bc1a4..907ae9c 100644
--- a/icgc-viewer/js/View/ICGCProjectDialog.js
+++ b/icgc-viewer/js/View/ICGCProjectDialog.js
@@ -145,19 +145,19 @@ function (
var geneMenu = new Menu({ style: "display: none;"});
var menuItemSSM = new MenuItem({
- label: "SSMs for Project",
+ label: "All Mutations",
iconClass: "dijitIconNewTask",
onClick: (function(hit) {
return function() {
thisB.addTrack('SimpleSomaticMutations', hit.id, 'icgc-viewer/View/Track/SSMTrack');
- alert("Adding SSM track for project " + hit.id);
+ alert("Adding Mutation track for project " + hit.id);
}
})(hit)
});
geneMenu.addChild(menuItemSSM);
var menuItemGene = new MenuItem({
- label: "Genes for Project",
+ label: "All Genes",
iconClass: "dijitIconNewTask",
onClick: (function(hit) {
return function() {
@@ -179,7 +179,7 @@ function (
// Add tooltips
thisB.addTooltipToButton(menuItemGene, "Add track with all genes for the given project");
- thisB.addTooltipToButton(menuItemSSM, "Add track with all SSMs for the given project");
+ thisB.addTooltipToButton(menuItemSSM, "Add track with all mutations for the given project");
// Place buttons in table
dom.place(projectButtonNode, projectRowContentNode);
@@ -255,7 +255,7 @@ function (
label : "Highlight this Simple Somatic Mutation",
},
{
- label : "View SSM on ICGC",
+ label : "View Mutations on ICGC",
iconClass : "dijitIconSearch",
action: "newWindow",
url : function(track, feature) { return "https://dcc.icgc.org/mutations/" + feature.get('about')['id'] }
diff --git a/icgc-viewer/js/View/Track/BaseTrack.js b/icgc-viewer/js/View/Track/BaseTrack.js
index 18da78b..4881909 100644
--- a/icgc-viewer/js/View/Track/BaseTrack.js
+++ b/icgc-viewer/js/View/Track/BaseTrack.js
@@ -62,11 +62,11 @@ define(
domConstruct.place(headerElement, details);
// Create help text
- var helpString = 'The following filters have been applied to the track. You can update the filters here, though no validation is done on the input.';
+ var helpString = 'The following filters have been applied to the track. You can update the filters here, though no validation is done on the input.';
var helpElement = domConstruct.toDom(helpString);
domConstruct.place(helpElement, details);
- var filterString = 'Filters
';
+ var filterString = 'Filters
Filters narrow down the features displayed on the track. We use the same format as the ICGC API.';
var filterElement = domConstruct.toDom(filterString);
domConstruct.place(filterElement, details);
@@ -91,7 +91,7 @@ define(
}
}).placeAt(details);
- var donorString = 'Donor UUID
';
+ var donorString = 'Donor UUID
UUID for a donor in the form of DOxxxx. Multiple UUIDs supported using commas.';
var donorElement = domConstruct.toDom(donorString);
domConstruct.place(donorElement, details);
@@ -99,12 +99,12 @@ define(
value: track.store.config.donor,
style: "width: 80%",
id: "donorTextBox",
- regExp: "^DO[0-9]+$",
+ regExp: "^DO[0-9]+(,DO[0-9]+)*$",
invalidMessage: "Invalid Donor ID - Must be of the form DOxxxx, where xxxx is some number greater than 0.",
trim: true
}).placeAt(details);
- var sizeHeader = 'Size
';
+ var sizeHeader = 'Size
This is the maximum number of results to return per panel.';
var sizeElement = domConstruct.toDom(sizeHeader);
domConstruct.place(sizeElement, details);
@@ -188,7 +188,7 @@ define(
// Create text area with shareable link
var textArea = domConstruct.create(
'textarea',{
- rows: 10,
+ rows: 1,
value: shareableLink,
style: "width: 80%",
readOnly: true
diff --git a/icgc-viewer/js/main.js b/icgc-viewer/js/main.js
index b54b05f..7970287 100644
--- a/icgc-viewer/js/main.js
+++ b/icgc-viewer/js/main.js
@@ -25,7 +25,7 @@ return declare(JBrowsePlugin, {
}));
this.browser.addGlobalMenuItem('icgc', new MenuItem(
{
- label: 'Explore Projects',
+ label: 'Explore projects',
iconClass: "dijitIconSearch",
onClick: lang.hitch(this, 'createICGCProjectTrack')
}));