Skip to content

Commit

Permalink
Code cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
antonioaltamura committed Jul 23, 2021
2 parents 87d9855 + 8d1d294 commit 5e82d5d
Show file tree
Hide file tree
Showing 12 changed files with 87 additions and 208 deletions.
56 changes: 0 additions & 56 deletions Gruntfile.js

This file was deleted.

134 changes: 60 additions & 74 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,79 +1,67 @@
# README
<img src="src/img/iva_logo.png" alt="Logo"/>

## Overview
# Overview

IVA is a generic Interactive Variant Analysis browser that can be used for the visualization of biological information from various data sources. IVA uses data from [OpenCGA](https://github.com/opencb/opencga) which is an OpenCB project.
The Interactive Variant Analyser (IVA) is the web user interface for OpenCGA that provides unprecedented features for real-time interaction with genomic data. It is suitable for any scale; from the detailed interpretation of a single genomic test through to assessing the genetic diversity of hundreds of thousands of aggregated genomes. It is not just for bioinformaticians; it provides simple and convenient access for biomedical researchers and clinical scientists as well.

### Documentation

You can find IVA documentation and tutorials at: [https://github.com/opencb/iva/wiki](https://github.com/opencb/iva/wiki).
You can find IVA documentation and tutorials at: https://github.com/opencb/iva/wiki.

### Issues Tracking

You can report bugs or request new features at [GitHub issue tracking](https://github.com/opencb/iva/issues).

### Release Notes and Roadmap

Releases notes are available at [GitHub releases](https://github.com/opencb/iva/releases).

Roadmap is available at [GitHub milestones](https://github.com/opencb/iva/milestones). You can report bugs or request new features at [GitHub issue tracking](https://github.com/opencb/iva/issues).

### Versioning

IVA is versioned following the rules from [Semantic versioning](http://semver.org/).

### Maintainers

We recommend to contact IVA developers by writing to OpenCB mailing list [email protected]. The main developers and maintainers are:
* Ignacio Medina ([email protected]) (_Founder and Project Leader_)
* Antonio Altamura ([email protected])
* Javier Perez Florido ([email protected])
* Alexis Martínez ([email protected])

* Ignacio Medina \([email protected]\) \(_Founder and Project Leader_\)
* Javier Perez Florido \([email protected]\)
* Alexis Martínez \([email protected]\)

#### Former Contributors

* Swaathi Kandasaamy \([email protected]\)
* Asuncion Gallego \([email protected]\)

#### Contributing
##### Former Contributors
* Swaathi Kandasaamy ([email protected])
* Asuncion Gallego ([email protected])

##### Contributing
IVA is an open-source and collaborative project, currently developement is mainly carried out by Stefan Gräf and Ignacio Medina teams from the University of Cambridge and Joaquin Dopazo team from CIBERER. We appreciate any help and feedback from users, you can contribute in many different ways such as simple bug reporting and feature request. Dependending on your skills you are more than welcome to develop client tools, new features or even fixing bugs.

## How to build
# How to build
IVA is mainly developed in JavaScript. It requires of OpenCB JSorolla project to be built, this is a JavaScript library developed for several OpenCB web-based projects, it can be found as Git submodule in IVA.

IVA is developed in HTML5, therefore it is mainly developed in JavaScript and makes a heavy usage of HTML and CSS. It uses Grunt as building tool. IVA also requires of OpenCB JSorolla project to be built, this is a JavaScript library developed for several OpenCB web-based projects, this can be found as Git submodule in IVA.

Stable releases are merged and tagged at _master_ branch, you are encourage to use latest stable release for production. Current active development is carried out at _develop_ branch, only building is guaranteed and bugs are expected, use this branch for development or for testing new functionalities. The only dependency of IVA from OpenCB is JSorolla.
Stable releases are merged and tagged at _master_ branch, you are encourage to use latest stable release for production. Current active development is carried out at _develop_ branch, only building is guaranteed and bugs are expected, use this branch for development or for testing new functionalities.

### Prerequisites
To run and build IVA you need: [Node.js](https://nodejs.org/en/) and [npm](https://www.npmjs.com/).

The following technologies are needed to build IVA: [Node.js](https://nodejs.org/en/), [npm](https://www.npmjs.com/) and [Grunt](http://gruntjs.com/getting-started).

#### Installing Node.js and npm

##### Installing Node.js and npm
To install [Node.js](https://nodejs.org/en/) you can visit [this link](http://blog.teamtreehouse.com/install-node-js-npm-linux).

[npm](https://www.npmjs.com/) stands for _node packaged modules_ and it is the dependency manager of [Node.js](https://nodejs.org/en/).

### Cloning
IVA is an open-source project and can be downloaded either as package(tar.gz) from GitHub releases or source code by cloning the repository.

IVA is an open-source project and can be downloaded either as package\(tar.gz\) from GitHub releases or source code by cloning the repository.

Default _**develop**_ branch can be downloaded by executing:
Default ***develop*** branch can be downloaded by executing:

```text
```
$ git clone https://github.com/opencb/iva.git
Cloning into 'iva'...
remote: Counting objects: 624, done.
remote: Total 624 (delta 0), reused 0 (delta 0), pack-reused 624
Receiving objects: 100% (624/624), 139.37 KiB | 0 bytes/s, done.
Resolving deltas: 100% (356/356), done.
Checking connectivity... done.
remote: Enumerating objects: 126, done.
remote: Counting objects: 100% (126/126), done.
remote: Compressing objects: 100% (72/72), done.
remote: Total 10370 (delta 70), reused 85 (delta 38), pack-reused 10244
Receiving objects: 100% (10370/10370), 4.70 MiB | 61.00 KiB/s, done.
Resolving deltas: 100% (6064/6064), done.
```

Latest stable release at _**master**_ branch can be downloaded by executing:
Latest stable release at ***master*** branch can be downloaded by executing:

```text
```
$ git clone -b master https://github.com/opencb/iva.git
Cloning into 'iva'...
remote: Counting objects: 624, done.
Expand All @@ -83,56 +71,54 @@ Resolving deltas: 100% (356/356), done.
Checking connectivity... done.
```

After this, in both cases, you **must** execute the following command to fetch the JSorolla submodule \(only the first time\):
After this, in both cases, you **must** execute the following command to fetch the JSorolla submodule (only the first time):

```text
```
git submodule update --init
```

Go to lib/jsorolla and checkout to _**develop**_ branch of Jsorolla by
Go to `./lib/jsorolla` and checkout to ***develop*** branch of Jsorolla by

```text
```
cd lib/jsorolla
git checkout develop
npm run install
```

### Build
### Run
To run IVA in dev mode (hot reload for CSS files and hot restart (aka live reloading) for JS scripts), run

First, you must update JSorolla dependencies, from the root folder execute:
`
npm run serve
`.

```text
cd lib/jsorolla
npm install
```
### Build
To buil IVA, just run

Finally, to build IVA execute:
`
npm run build
`.

We have to install npm packages for IVA, from the the root folder execute:
### Test
We use [Cypress.io](https://www.cypress.io/) as testing framework.

```text
npm install
Having the project running through the command `npm run serve`, you can run the interactive E2E test suite by running the command
```

And now execute:

```text
npm run build
npm run e2e
```

when completed, all compiled files will be located under the _build_ folder.

### Testing

You can copy build content to a web server such as Apache HTTP Server and open your favourite internet browser to open IVA.

### Execute Tests in development with nightwatch\([http://nightwatchjs.org/](http://nightwatchjs.org/)\)

Prerequisite: make sure you have JDK installed, with at least version 8. If you don't have it, you can grab it from [http://www.oracle.com/technetwork/java/javase/downloads/index.html](http://www.oracle.com/technetwork/java/javase/downloads/index.html).
#### Run tests and generate a report
To run test in headless version (no browser) and generate a report, run
```
npm run e2e-report
```
for more help, try ```npm run e2e-report -h```.

1. npm install --dev
2. Selenium server. Download the latest release .jar from [http://selenium-release.storage.googleapis.com/index.html](http://selenium-release.storage.googleapis.com/index.html). i.e. selenium-server-standalone-3.7.0.jar
3. Chromedriver. Download from [https://sites.google.com/a/chromium.org/chromedriver/downloads](https://sites.google.com/a/chromium.org/chromedriver/downloads) that version which supports your chrome versión. You can review what version fits your browser here [https://chromedriver.storage.googleapis.com/2.33/notes.txt](https://chromedriver.storage.googleapis.com/2.33/notes.txt).
4. Create a bin folder inside your test folder in root path
5. Move selenium bin and chrome bin inside that bin folder.
6. npm run test-e2e \( or ./node\_modules/.bin/nightwatch test/e2e/clinical-prioritization.js if you want execute just one\)
For Windows environment, just add the suffix `-win`
```
npm run e2e-win
npm run e2e-report-win
```
for more help, try ```npm run e2e-report-win -h```.

The HTML report will be generated in `./report`. The filename will have the structure `<OPENCGA_STUDY_FQN>__<TIME>_<DATE>.html`
23 changes: 0 additions & 23 deletions credentials.js

This file was deleted.

File renamed without changes.
5 changes: 5 additions & 0 deletions credentials.sh → cypress/credentials.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,10 @@ echo -en "\nEnter the FQN of the Study you want to test (leave empty for default
read study

# echo $study > CYPRESS_study
#"re-opencgahadoop@100k_genomes_grch37_germline:RD37"
#"re-opencgahadoop@100k_genomes_grch38_germline:RD38"
#"re-opencgahadoop@100k_genomes_grch38_germline:CG38"
#"re-opencgahadoop@100k_genomes_grch38_somatic:CS38"
#study=re-opencgahadoop@100k_genomes_grch38_somatic:CS38

CYPRESS_username=$username CYPRESS_password=$password CYPRESS_study=$study "$@"
7 changes: 6 additions & 1 deletion e2e-runner.bat → cypress/e2e-runner.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
setlocal EnableExtensions EnableDelayedExpansion

rem This script launches IVA e2e tests over one or more Opencga studies in Windows env
rem Params:
rem -u Opencga username.
rem -s Comma-separated list of studies. Please wrap the list in quotes in case of more that one study
rem -h Prints command description
rem
rem If -u (username) and -s (studies) params are not provided, it prompts for Opencga username, password, and a comma-separated list of studies


Expand Down Expand Up @@ -49,7 +54,7 @@ set study=!tmp::=!
echo STUDY: %%~a DIR: !study!
rem mkdir !study! && dir !study!
(if exist mochawesome-report rmdir /S/Q mochawesome-report)^
&& call npx cypress run --env username=%opencgaUser%,password=%opencgaPassword%,study=%%~a --config videosFolder="cypress/videos/!study!",screenshotsFolder="cypress/screenshots/!study!" --headless --spec "cypress/integration/001-header-bar-pre-login.spec.js"^
&& call npx cypress run --env username=%opencgaUser%,password=%opencgaPassword%,study=%%~a --config videosFolder="cypress/videos/!study!",screenshotsFolder="cypress/screenshots/!study!" --headless --spec "cypress/integration/*.js"^
& call npx mochawesome-merge mochawesome-report/*.json -o mochawesome-report/cypress-combined-report.json^
&& call npx marge --reportFilename !study!.html --charts --timestamp _HH-MM_dd-mm-yyyy --reportPageTitle IVA_%%~a --reportTitle IVA__%%~a --reportDir report mochawesome-report/cypress-combined-report.json^
&& (if exist mochawesome-report rmdir /S/Q mochawesome-report)
Expand Down
9 changes: 8 additions & 1 deletion e2e-runner.sh → cypress/e2e-runner.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
#!/bin/bash
# @file test_runner.sh
# @brief This script launches IVA e2e tests over one or more Opencga studies
# @description It takes Opencga username, password, and a comma-separated list of studies (params or prompt)
# @description
#
# Options:
# -u Opencga username.
# -s Comma-separated list of studies.
# -h Prints command description
#
# It takes Opencga username, password, and a comma-separated list of studies (either via params or prompt)

#declare -a studies=(
# "re-opencgahadoop@100k_genomes_grch37_germline:RD37"
Expand Down
12 changes: 0 additions & 12 deletions generate-report.sh

This file was deleted.

6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 5 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,10 @@
"package": "mv build iva-$npm_package_version && tar zcvf iva-$npm_package_version.tar.gz iva-$npm_package_version && mv iva-$npm_package_version build",
"deploy": "npx webpack && ./docker/docker-build.py push",
"eslint": "eslint -c .eslintrc.json . --ignore-pattern '/web_modules/'",
"e2e": "./credentials.sh npx cypress open",
"e2e-win": "credentials.bat npx cypress open",
"e2e-report-spec": "rm -rf mochawesome-report/ && ./credentials.sh npx cypress run --headless --spec 'cypress/integration/002-login.js'; npm run mocha:report && rm -rf 'mochawesome-report/'",
"e2e-report-win-spec": "(if exist mochawesome-report rmdir /S/Q mochawesome-report)&& credentials.bat npx cypress run --headless --spec \"cypress/integration/login.js\"& npm run mocha:report && (if exist mochawesome-report rmdir /S/Q mochawesome-report)",
"e2e-report": "rm -rf mochawesome-report/ && ./credentials.sh npx cypress run --headless --spec 'cypress/integration/*.js'; npm run mocha:report && rm -rf 'mochawesome-report/'",
"e2e-report-win": "(if exist mochawesome-report rmdir /S/Q mochawesome-report)&& credentials.bat npx cypress run --headless --spec \"cypress/integration/*.js\"& npm run mocha:report && (if exist mochawesome-report rmdir /S/Q mochawesome-report)",
"mocha:merge-reports": "mochawesome-merge mochawesome-report/*.json -o mochawesome-report/cypress-combined-report.json",
"mocha:report": "npm run mocha:merge-reports && marge --reportFilename report.html --charts --timestamp _HH-MM_dd-mm-yyyy --reportPageTitle IVA --reportTitle IVA --reportDir ./report mochawesome-report/cypress-combined-report.json; spd-say 'end to end test completed'"
"e2e": "./cypress/credentials.sh npx cypress open",
"e2e-win": "crypress/credentials.bat npx cypress open",
"e2e-report": "./cypress/e2e-runner.sh",
"e2e-report-win": "cypress/e2e-runner.bat"
},
"dependencies": {
"@fortawesome/fontawesome-free": "^5.11.2",
Expand Down Expand Up @@ -80,7 +76,7 @@
"copy-webpack-plugin": "^5.1.1",
"crisper": "~2.1.1",
"css-loader": "^3.4.2",
"cypress": "^7.7.0",
"cypress": "^8.0.0",
"cypress-wait-until": "^1.7.1",
"esinstall": "^1.0.2",
"eslint": "^7.29.0",
Expand Down
Loading

0 comments on commit 5e82d5d

Please sign in to comment.