Skip to content

Commit

Permalink
Reformat code blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Aug 13, 2015
1 parent 5c9fa2a commit 0ba1c28
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 66 deletions.
4 changes: 2 additions & 2 deletions docs/Apollo2Build.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ There won't be any difference in the workflow either way that you choose to get

We can now perform a quick-start of the application in "development mode" with this command:

```
```
./apollo run-local
```

Expand All @@ -45,7 +45,7 @@ Also note: if there are any errors at this step, check the setup.log file for er

After we have a server setup, we will want to add a new organism to the panel. If you are a new user, you will want to setup this data with the jbrowse pre-processing scripts. You can see the [data loading guide](Data_loading.md) for more details, but essentially, you will want to load a reference genome and an annotations file at a minimum:

```
```
bin/prepare-refseqs.pl --fasta yourgenome.fasta --out /some/directory
bin/flatfile-to-json.pl --gff yourannotations.gff --type mRNA --trackLabel AnnotationsGff --out /some/directory
```
Expand Down
6 changes: 3 additions & 3 deletions docs/Command_line.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The command line tools are located in docs/web_services/examples, and they are m

Example:

```
```
get_gff3.groovy -organism Amel_4.5 -username [email protected] -password admin_password -url http://localhost:8080/apollo > my output.gff3
```

Expand All @@ -27,7 +27,7 @@ The -username and -password refer to the admin user, and they can also be specif

Example:

```
```
add_users.groovy -username [email protected] -password admin_password -newuser [email protected] -newpassword newuserpass -destinationurl http://localhost:8080/apollo
```

Expand All @@ -40,7 +40,7 @@ A list of users specified in a csv file can also be used as input.

Example:

```
```
add_organism.groovy -name yeast -url http://localhost:8080/apollo/ -directory /opt/apollo/yeast -username [email protected] -password admin_password
```

Expand Down
20 changes: 10 additions & 10 deletions docs/Configure.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The main configuration settings for Apollo are stored in `grails-app/conf/Config
`apollo-config.groovy` file (i.e. the same file that contains your database parameters). Here are the defaults that are
defined in the Config.groovy file:

```
```
// default apollo settings
apollo {
default_minimum_intron_size = 1
Expand Down Expand Up @@ -66,7 +66,7 @@ These settings are essentially the same familiar parameters from a config.xml fi
The defaults are generally sufficient, but as noted above, you can override any particular parameter in your
apollo-config.groovy file, e.g. you can add override configuration any given parameter as follows:

```
```
grails {
apollo.get_translation_code = 1
apollo {
Expand All @@ -88,7 +88,7 @@ Canned comments are configured via the admin panel on the web interface.
Web Apollo can be configured to work with sequence search tools. The tool UCSC BLAT is
commonly used and can be easily configured via the config file, with the general parameters given as follows:

```
```
sequence_search_tools = [
blat_nuc: [
search_exe: "/usr/local/bin/blat",
Expand Down Expand Up @@ -119,7 +119,7 @@ installation binaries reside elsewhere, edit the search_exe location to point to

Data adapters are currently configured as follows

```
```
data_adapters = [[
permission: 1,
key: "GFF3",
Expand Down Expand Up @@ -196,17 +196,17 @@ One thing to consider with this proxy setup is the websocket calls. We use the S

The most simple setup on apache is a reverse proxy. Note that a reverse proxy _does not_ use `ProxyRequests On` (i.e. if you want you can set `ProxyRequests Off`, it is not relevant to reverse proxies). Here is the most basic configuration:

```
```
ProxyPass /apollo http://localhost:8080/apollo
ProxyPassReverse /apollo http://localhost:8080/apollo
ProxyPassReverseCookiePath / http://localhost:8080/apollo
```
```

This setup will use AJAX long-polling unless websockets are also configured to be proxied. To setup the proxy for websockets, you can use mod_proxy_wstunnel (available for httpd 2.4): http://httpd.apache.org/docs/2.4/mod/mod_proxy_wstunnel.html

First load the module or use a2enmod enable it (on ubuntu / debian):

```
```
LoadModule proxy_wstunnel_module libexec/apache2/mod_proxy_wstunnel.so
```

Expand All @@ -221,7 +221,7 @@ Then in your server config, i.e. httpd.conf, add extra ProxyPass calls for the w
Note: you can also proxy all apps on your tomcat server to a subdirectory like this, but the important part of this configuration is that ProxyPassReverseCookiePath is configured so that sessions are set up properly (otherwise it will look like the app is loaded, but you will not be able to login)


```
```
ProxyPass /testing http://localhost:8080
ProxyPassReverse /testing http://localhost:8080
ProxyPassReverseCookiePath / /testing
Expand All @@ -235,7 +235,7 @@ With this configuration, an app that was originally at http://localhost:8080/apo

Your setup may vary, but setting the upgrade headers can be used for the websocket configuration http://nginx.org/en/docs/http/websocket.html

```
```
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
Expand Down Expand Up @@ -275,7 +275,7 @@ There are a variety of different ways to include new CSS into the browser, but t

Add the following statement to your trackList.json:

```
```
"css" : "data/yourfile.css"
```

Expand Down
33 changes: 17 additions & 16 deletions docs/Data_loading.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ guide](Troubleshooting.md).
The first step to setup the genome browser is to load the reference genome data. We'll use the `prepare-refseqs.pl`
script to output to the data directory that we will point to later in the organism tab.

```
```
bin/prepare-refseqs.pl --fasta pyu_data/scf1117875582023.fa --out /opt/apollo/data
````
```


### flatfile-to-json.pl

The flatfile-to-json.pl script can be used to setup a GFF3 tracks with flexible feature types. Here, we'll start off by loading data from the MAKER generated GFF for the Pythium ultimum data. The simplest loading command specifies a --trackLabel, the --type of feature to load, the --gff file and the --out directory.

```
```
bin/flatfile-to-json.pl --gff pyu_data/scf1117875582023.gff --type mRNA --trackLabel MAKER --out /opt/apollo/data
````
```

Note: you can also use simple scripts like bin/maker2jbrowse to expedite loading of MAKER data.
Note: you can also use simple scripts like `bin/maker2jbrowse` to expedite loading of MAKER data.

Also see the section [Customizing features](Data_loading.md#customizing-features) section for more information on customizing the CSS styles of the Web Apollo 2.0 features.

Expand All @@ -34,7 +34,7 @@ Also see the section [Customizing features](Data_loading.md#customizing-features

Once data tracks have been created, you can generate a searchable index of names using the generate-names.pl script:

```
```
bin/generate-names.pl --verbose --out /opt/apollo/data
```

Expand All @@ -47,17 +47,18 @@ option to disable the completion on certain tracks.

WebApollo natively supports BAM files and the file can be read (in chunks) directly from the server with no preprocessing.

To add a BAM track, copy the BAM+BAI files to your data directory, and then use the add-bam-track.pl to add the file to the tracklist.
To add a BAM track, copy the .bam and .bam.bai files to your data directory, and then use the add-bam-track.pl to add the file to the tracklist.

```
```
mkdir /opt/apollo/data/bam
cp pyu_data/simulated-sorted.bam* /opt/apollo/data/bam
cp pyu_data/simulated-sorted.bam /opt/apollo/data/bam
cp pyu_data/simulated-sorted.bam.bai /opt/apollo/data/bam
bin/add-bam-track.pl --bam_url bam/simulated-sorted.bam \
   --label simulated_bam --key "simulated BAM" -i /opt/apollo/data/trackList.json
```


Note: the `bam_url` parameter is a URL that is relative to the data directory. It is not a filepath!
Note: the `bam_url` parameter is a URL that is relative to the data directory. It is not a filepath! Also, the .bai will automatically be located if it is simply the .bam with .bai appended to it.

### add-bw-track.pl

Expand All @@ -66,7 +67,7 @@ WebApollo also has native support for BigWig files (.bw), so no extra processing
To use this, copy the BigWig data into the jbrowse data directory and then use the add-bw-track.pl to add the file to
the tracklist.

```
```
mkdir /opt/apollo/data/bigwig
cp pyu_data/*.bw /opt/apollo/data/bigwig
bin/add-bw-track.pl --bw_url bigwig/simulated-sorted.coverage.bw \
Expand All @@ -81,7 +82,7 @@ To change how the different annotation types look in the "User-created annotatio
annotation type to the appropriate CSS class. This data resides in `client/apollo/json/annot.json`, which is a file containing WebApollo tracks that is loaded by default. You'll need to modify the JSON entry whose label is `Annotations`. Of particular interest is
the `alternateClasses` element. Let's look at that default element:

```
```
"alternateClasses": {
"pseudogene" : {
"className" : "light-purple-80pct",
Expand Down Expand Up @@ -145,7 +146,7 @@ It is relatively easy to add other stylesheets that have custom style classes th
`flatfile-to-json.pl`. For example, you can create `/opt/apollo/data/custom_track_styles.css` which contains two new
styles:

```
```
.gold-90pct,
.plus-gold-90pct,
.minus-gold-90pct {
Expand Down Expand Up @@ -179,7 +180,7 @@ adding this to the trackList.json

Then you may use these new styles using --subfeatureClasses, which uses the specified CSS classes for your features in the genome browser, for example:

```
```
bin/flatfile-to-json.pl --gff MyFile.gff --type mRNA --trackLabel MyTrack
--subfeatureClasses '{"CDS":"gold-90pct", "UTR": "dimgold-60pct"}'
```
Expand All @@ -191,7 +192,7 @@ Then you may use these new styles using --subfeatureClasses, which uses the spec
You can use the `tools/data/add_transcripts_from_gff3_to_annotations.pl` script to bulk load GFF3 files with transcripts
to the user annotation track. Let's say we want to load our `maker.gff` transcripts.

```
```
tools/data/add_transcripts_from_gff3_to_annotations.pl \
-U localhost:8080/WebApollo -u web_apollo_admin -p web_apollo_admin \
-i scf1117875582023.gff -type mRNA
Expand All @@ -204,7 +205,7 @@ You can still use this script even if the GFF3 file that you are loading does no
Let's say we want to load `match` and `match_part` features as transcripts and exons respectively. We'll use the
`blastn.gff` file as an example.

```
```
tools/data/add_transcripts_from_gff3_to_annotations.pl \
-U localhost:8080/WebApollo -u web_apollo_admin -p web_apollo_admin \
-i cf1117875582023gff -t match -e match_part
Expand Down
41 changes: 27 additions & 14 deletions docs/Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,33 @@ In all cases you will need to follow the [guide for setting up your 2.0 instance

## Migration from Evaluation to Production:

If you are running your evaluation/development version using ```./apollo run-local```
If you are running your evaluation/development version using `./apollo run-local`
when you setup your production instance, any prior annotations will use a separate database.

If you are using the same production instance you can use scripts to [delete all annotations and preferences](../scripts/delete_all_features.sh)
or [just the annotations](../scripts/delete_only_features.sh).
If you are using the same production instance you can use scripts to delete all annotations and preferences:

```
scripts/delete_all_features.sh
```

or just the annotations:

```
scripts/delete_only_features.sh
```

If you want to start from scratch (including reloading organisms and users), you can just drop the database (when the server is not running)
and the proper tables will be recreated on startup.

## Migration from 1.0 to 2.0:

In each case you will need to use [Apollo 2 web services](web_services_link.png). We provide examples in the form of [migration scripts](web_services/examples).
We provide examples in the form of [migration scripts](web_services/examples) in the docs/web_services/examples directory. These tools are also described in the [command line tools section](Command_line.md). In each case these scripts will the use Apollo 2 web services API, which you can find out more about via the user interface:

![](web_services_link.png)

To use the newer examples written in ```groovy```, you'll need to install it in a similar manner as you did grails: ```gvm install groovy```. If you have not installed [gvm](http://gvmtool.net/) (or grails) you should be able to run '''curl -s get.gvmtool.net | bash
'''.
If you are upgrading to a new version of grails or groovy, you'll need to install it in a similar manner as you did grails, e.g. `gvm install groovy`. If you have not installed [gvm](http://gvmtool.net/) (or grails) you should be able to download it easily following their instructions.

We have written new examples using the groovy language, but mostly any language will work (Perl, shell/curl, Python, etc.).
We have written many of the [command line tools](Command_line.md) examples using the groovy language, but mostly any language will work (Perl, shell/curl, Python, etc.).


### Migrate Annotations
Expand All @@ -32,26 +42,29 @@ We provide a [migration script](web_services/examples/groovy/migrate_annotations
connects to a single Web Apollo 1 instance and populates the annotations for an organism for a set of sequences / (confusingly called tracks as well). It would be best to develop your script on a development instance of Apollo2 for restricted sequences.

To get the scripts working properly, you'll need to provide the list of sequences (or tracks) to migrate for each organism.
You can get the list of tracks by either using the database (```select * from tracks ;```) or looking
in the Web Apollo annotations directory (e.g., ```/opt/apollo/annotations/ | grep Annotations | grep -v history | paste -s -d"," - ```). The latter will only yield tracks that have annotations.
You can get the list of tracks by either using the database (`select * from tracks ;`) or looking
in the Web Apollo annotations directory

```
/opt/apollo/annotations/ | grep Annotations | grep -v history | paste -s -d"," -
```



### Migrate Users

You have to add users de novo using something like the [add_users script](web_services/examples/groovy/add_users.groovy).
You have to add users de novo using something like the [add_users.groovy script](web_services/examples/groovy/add_users.groovy).
In this case you create a csv file (you can start in Excel) with the email, name, password, and role ('user' or 'admin').
This is passed into the add_users.groovy script and users are added.

From Web Apollo 1, you should be able to pull user names out of the database ```select * from users ;```, but there is not much overlap between users in Web Apollo 1 and Apollo2.
From Web Apollo 1, you should be able to pull user names out of the database `select * from users ;`, but there is not much overlap between users in Web Apollo 1 and Apollo2.

If you have only a few users, however, just adding them manually on the users will likely be easier.

### Add Organisms

If possible adding organisms on the organisms tab is the easiest option if you only have a handful of organisms.

However, we provide a mechanism via the [add_organism.groovy script](web_services/examples/groovy/add_organism.groovy).
In this case organisms are added individually as organisms are on separate tomcat instances.

The [add_organism.groovy script](web_services/examples/groovy/add_organism.groovy) can help automate this process if you have a large number of migrations to handle.


11 changes: 6 additions & 5 deletions docs/Permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
Can only view things related to that organism.

* **read**: view / search only, no annotation
```

```
Annotations: lock detail / coding
RefSeq: hide export
Organism: hide
Expand All @@ -22,20 +23,20 @@ Can only view things related to that organism.
```
* **export**: same as read, but can use the export screen

```
```
RefSeq: show export
```

* **write**: same as above, but can add / edit annotations

```
```
Annotations: allow editing
JBrowse: enable UcA track
```

* **admin**: access to everything for that organism

```
```
Organism: show
User: show
Group: show
Expand All @@ -45,7 +46,7 @@ Can only view things related to that organism.

Table of permissions:

```
```
Permission | Annotator | Tracks | Ref Seq | Organism | Users/groups |
------------- | --------------- | ------- | -------- | -------- | ------- |
READ | Vis / locked | None | no export| hide | hide |
Expand Down
Loading

0 comments on commit 0ba1c28

Please sign in to comment.