PageRenderTime 43ms CodeModel.GetById 12ms RepoModel.GetById 1ms app.codeStats 0ms

/docs/Configure.md

https://gitlab.com/nathandunn/Apollo
Markdown | 511 lines | 374 code | 137 blank | 0 comment | 0 complexity | e2768cbdd51fdac68832b92815691a86 MD5 | raw file
  1. ## Apollo Configuration
  2. Apollo includes some basic configuration parameters that are specified in configuration files. The most important
  3. parameters are the database parameters in order to get Apollo up and running. Other options besides the database
  4. parameters can be configured via the config files, but note that many parameters can also be configured via the web
  5. interface.
  6. Note: Configuration options may change over time, as more configuration items are integrated into the web interface.
  7. ### Main configuration
  8. The main configuration settings for Apollo are stored in `grails-app/conf/Config.groovy`, but you can override settings
  9. in your `apollo-config.groovy` file (i.e. the same file that contains your database parameters). Here are the defaults
  10. that are defined in the Config.groovy file:
  11. ```
  12. // default apollo settings
  13. apollo {
  14. default_minimum_intron_size = 1
  15. history_size = 0
  16. overlapper_class = "org.bbop.apollo.sequence.OrfOverlapper"
  17. track_name_comparator = "/config/track_name_comparator.js"
  18. use_cds_for_new_transcripts = true
  19. user_pure_memory_store = true
  20. translation_table = "/config/translation_tables/ncbi_1_translation_table.txt"
  21. is_partial_translation_allowed = false // unused so far
  22. get_translation_code = 1
  23. sequence_search_tools = [
  24. blat_nuc: [
  25. search_exe: "/usr/local/bin/blat",
  26. search_class: "org.bbop.apollo.sequence.search.blat.BlatCommandLineNucleotideToNucleotide",
  27. name: "Blat nucleotide",
  28. params: ""
  29. ],
  30. blat_prot: [
  31. search_exe: "/usr/local/bin/blat",
  32. search_class: "org.bbop.apollo.sequence.search.blat.BlatCommandLineProteinToNucleotide",
  33. name: "Blat protein",
  34. params: ""
  35. tmp_dir: "/opt/apollo/tmp" //optional param, uses system tmp dir by default
  36. ]
  37. ]
  38. splice_donor_sites = [ "GT" ]
  39. splice_acceptor_sites = [ "AG"]
  40. gff3.source= "." bootstrap = false
  41. info_editor = {
  42. feature_types = "default"
  43. attributes = true
  44. dbxrefs = true
  45. pubmed_ids = true
  46. go_ids = true
  47. comments = true
  48. }
  49. }
  50. ```
  51. These settings are essentially the same familiar parameters from a config.xml file from previous Apollo versions. The
  52. defaults are generally sufficient, but as noted above, you can override any particular parameter in your
  53. `apollo-config.groovy` file, e.g. you can add override configuration any given parameter as follows:
  54. ```
  55. grails {
  56. apollo.get_translation_code = 1
  57. apollo {
  58. use_cds_for_new_transcripts = true
  59. default_minimum_intron_size = 1
  60. get_translation_code = 1 // identical to the dot notation
  61. }
  62. }
  63. ```
  64. ### JBrowse Plugins
  65. You can add / remove jbrowse plugins by copying a jbrowse section into your ```apollo-config.groovy```.
  66. There are two sections, ```plugins``` and ```main```, which specifies the jbrowse version.
  67. The main section can either contain a ```git``` block or a ```url``` block, both of which require ```url```.
  68. If a git block a ```tag``` or ```branch``` can be specified.
  69. In the ```plugins``` section, options are ```included``` (part of the JBrowse release), ```url``` (requiring a url parameter),
  70. or ```git```, which can include a ```tag``` or ```branch``` as above.
  71. Options for ```alwaysRecheck``` and ```alwaysRepull``` always check the branch and tag and always pull respectiviely.
  72. ```
  73. jbrowse {
  74. git {
  75. url= "https://github.com/GMOD/jbrowse"
  76. // tag = "1.12.1-release"
  77. branch = "master"
  78. alwaysPull = true
  79. alwaysRecheck = true
  80. }
  81. // url {
  82. // // always use dev for apollo
  83. // url = "http://jbrowse.org/wordpress/wp-content/plugins/download-monitor/download.php?id=102"
  84. // type ="zip"
  85. // fileName = "JBrowse-1.12.0-dev"
  86. // }
  87. plugins {
  88. WebApollo{
  89. included = true
  90. }
  91. NeatHTMLFeatures{
  92. included = true
  93. }
  94. NeatCanvasFeatures{
  95. included = true
  96. }
  97. RegexSequenceSearch{
  98. included = true
  99. }
  100. HideTrackLabels{
  101. included = true
  102. }
  103. // MyVariantInfo {
  104. // git = 'https://github.com/GMOD/myvariantviewer'
  105. // branch = 'master'
  106. // alwaysRecheck = "true"
  107. // alwaysPull = "true"
  108. // }
  109. // SashimiPlot {
  110. // git = 'https://github.com/cmdcolin/sashimiplot'
  111. // branch = 'master'
  112. // alwaysPull = "true"
  113. // }
  114. }
  115. }
  116. ```
  117. ### Translation tables
  118. The default translation table is [1](http://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi#SG1)
  119. To use [one of the others](http://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi) set the number in the ```apollo-config.groovy``` file as:
  120. ```
  121. apollo {
  122. ...
  123. get_translation_code = "11"
  124. }
  125. ```
  126. These correspond to the NCBI translation tables.
  127. To add a custom translation table, you can add it to to the ```web-app/translation_tables``` directory as:
  128. ```
  129. web-app/translation_tables/ncbi_customname_translation_table.txt
  130. ```
  131. and specify the ```customname``` as:
  132. In apollo-config.groovy:
  133. ```
  134. apollo {
  135. ...
  136. get_translation_code = "customname"
  137. }
  138. ```
  139. ### Logging configuration
  140. To over-ride the default logging, you can look at the logging configurations from
  141. [Config.groovy](https://github.com/GMOD/Apollo/blob/master/grails-app/conf/Config.groovy) and override or modify them in
  142. `apollo-config.groovy`.
  143. ```
  144. log4j.main = {
  145. error 'org.codehaus.groovy.grails.web.servlet', // controllers
  146. 'org.codehaus.groovy.grails.web.pages', // GSP
  147. 'org.codehaus.groovy.grails.web.sitemesh', // layouts
  148. ...
  149. warn 'grails.app'
  150. }
  151. ```
  152. Additional links for log4j:
  153. - Advanced log4j configuration:
  154. http://blog.andresteingress.com/2012/03/22/grails-adding-more-than-one-log4j-configurations/
  155. - Grails log4j guide: http://grails.github.io/grails-doc/2.4.x/guide/single.html#logging
  156. ### Canned comments
  157. Canned comments are configured via the admin panel on the web interface, so they are not currently configured via the
  158. config files.
  159. View your instances page for more details e.g. http://localhost:8080/apollo/cannedComment/
  160. ### Search tools
  161. Apollo can be configured to work with various sequence search tools. UCSC's BLAT tool is configured by default and you
  162. can customize it as follows:
  163. ```
  164. sequence_search_tools = [
  165. blat_nuc: [
  166. search_exe: "/usr/local/bin/blat",
  167. search_class: "org.bbop.apollo.sequence.search.blat.BlatCommandLineNucleotideToNucleotide",
  168. name: "Blat nucleotide",
  169. params: ""
  170. ],
  171. blat_prot: [
  172. search_exe: "/usr/local/bin/blat",
  173. search_class: "org.bbop.apollo.sequence.search.blat.BlatCommandLineProteinToNucleotide",
  174. name: "Blat protein",
  175. params: "",
  176. tmp_dir: "/opt/apollo/tmp" //optional, uses system tmp dir by default
  177. ]
  178. your_custom_search_tool: [
  179. search_exe: "/usr/local/customtool",
  180. search_class: "org.your.custom.Class",
  181. name: "Custom search"
  182. ]
  183. ]
  184. ```
  185. When you setup your organism in the web interface, you can then enter the location of the sequence search database for
  186. BLAT.
  187. Note: If the BLAT binaries reside elsewhere on your system, edit the search_exe location in the config to point to your
  188. BLAT executable.
  189. ### Data adapters
  190. Data adapters for Apollo provide the methods for exporting annotation data from the application. By default, GFF3
  191. and FASTA adapters are supplied. They are configured to query your IOService URL e.g.
  192. http://localhost:8080/apollo/IOService with the customizable query
  193. ```
  194. data_adapters = [[
  195. permission: 1,
  196. key: "GFF3",
  197. data_adapters: [[
  198. permission: 1,
  199. key: "Only GFF3",
  200. options: "output=file&format=gzip&type=GFF3&exportGff3Fasta=false"
  201. ],
  202. [
  203. permission: 1,
  204. key: "GFF3 with FASTA",
  205. options: "output=file&format=gzip&type=GFF3&exportGff3Fasta=true"
  206. ]]
  207. ],
  208. [
  209. permission: 1,
  210. key : "FASTA",
  211. data_adapters :[[
  212. permission : 1,
  213. key : "peptide",
  214. options : "output=file&format=gzip&type=FASTA&seqType=peptide"
  215. ],
  216. [
  217. permission : 1,
  218. key : "cDNA",
  219. options : "output=file&format=gzip&type=FASTA&seqType=cdna"
  220. ],
  221. [
  222. permission : 1,
  223. key : "CDS",
  224. options : "output=file&format=gzip&type=FASTA&seqType=cds"
  225. ]]
  226. ]]
  227. ```
  228. #### Default data adapter options
  229. The options available for the data adapters are configured as follows
  230. - type: `GFF3` or `FASTA`
  231. - output: can be `file` or `text`. `file` exports to a file and provides a UUID link for downloads, text just outputs to
  232. stream.
  233. - format: can by `gzip` or `plain`. `gzip` offers gzip compression of the exports, which is the default.
  234. - exportSequence: `true` or `false`, which is used to include FASTA sequence at the bottom of a GFF3 export
  235. ### Supported annotation types
  236. Many configurations will require you to define which annotation types the configuration will apply to. Apollo supports
  237. the following "higher level" types (from the Sequence Ontology):
  238. * sequence:gene
  239. * sequence:pseudogene
  240. * sequence:transcript
  241. * sequence:mRNA
  242. * sequence:tRNA
  243. * sequence:snRNA
  244. * sequence:snoRNA
  245. * sequence:ncRNA
  246. * sequence:rRNA
  247. * sequence:miRNA
  248. * sequence:repeat_region
  249. * sequence:transposable_element
  250. ### Apache / Nginx configuration
  251. Oftentimes, admins will put use Apache or Nginx as a reverse proxy so that the requests to a main server can be
  252. forwarded to the tomcat server. This setup is not necessary, but it is a very standard configuration.
  253. Note that we use the SockJS library, which will downgrade to long-polling if websockets are not available, but since
  254. websockets are preferable, it helps to take some extra steps to ensure that the websocket calls are proxied or forwarded
  255. in some way too.
  256. If you are using tomcat 7, please make sure to use the most recent stable version, which supports web sockets by default. Using older versions (e.g. 7.0.26) websockets may not be included by default and you will need to include an additional .jar file.
  257. #### Apache Proxy
  258. The most simple setup on apache is as follows.. Here is the most basic configuration for a reverse proxy:
  259. ```
  260. ProxyPass /apollo http://localhost:8080/apollo
  261. ProxyPassReverse /apollo http://localhost:8080/apollo
  262. ```
  263. Note: that a reverse proxy _does not_ use `ProxyRequests On` (which turns on forward proxying, which is dangerous)
  264. Also note: This setup will use downgrade to use AJAX long-polling without the websocket proxy being configured.
  265. To setup the proxy for websockets, you can use mod_proxy_wstunnel, first load the module
  266. ```
  267. LoadModule proxy_wstunnel_module libexec/apache2/mod_proxy_wstunnel.so
  268. ```
  269. Then add extra ProxyPass calls for the websocket "endpoint" called `/apollo/stomp`
  270. ```
  271. ProxyPass /apollo/stomp ws://localhost:8080/apollo/stomp
  272. ProxyPassReverse /apollo/stomp ws://localhost:8080/apollo/stomp
  273. ```
  274. ##### Debugging proxy issues
  275. Note: if your webapp is accessible but it doesn't seem like you can login, you may need to customize the
  276. ProxyPassReverseCookiePath
  277. For example, if you proxied to a different path, you might have something like this
  278. ```
  279. ProxyPass /testing http://localhost:8080
  280. ProxyPassReverse /testing http://localhost:8080
  281. ProxyPassReverseCookiePath / /testing
  282. ```
  283. Then your application might be accessible from http://localhost/testing/apollo
  284. #### Nginx Proxy (from version 1.4 on)
  285. Your setup may vary, but setting the upgrade headers can be used for the websocket configuration
  286. http://nginx.org/en/docs/http/websocket.html
  287. ```
  288. map $http_upgrade $connection_upgrade {
  289. default upgrade;
  290. '' close;
  291. }
  292. server {
  293. # Main
  294. listen 80; server_name myserver;
  295. # http://nginx.org/en/docs/http/websocket.html
  296. location /ApolloSever {
  297. proxy_http_version 1.1;
  298. proxy_set_header Upgrade $http_upgrade;
  299. proxy_set_header Connection $connection_upgrade;
  300. proxy_pass http://127.0.0.1:8080;
  301. }
  302. }
  303. ```
  304. ### Upgrading existing instances
  305. There are several scripts for migrating from older instances. See the [migration guide](Migration.md) for details.
  306. Particular notes:
  307. Note: Apollo does not require using the `add-webapollo-plugin.pl` because the plugin is loaded implicitly by
  308. including the client/apollo/json/annot.json file at run time.
  309. #### Upgrading existing JBrowse data stores
  310. It is not necessary to change your existing JBrowse data directories to use Apollo 2.x, you can just point to existing
  311. data directories from your previous instances.
  312. More information about [JBrowse](http://jbrowse.org/) can also be found in their [FAQ](http://gmod.org/wiki/JBrowse_FAQ).
  313. #### Adding custom CSS for track styling for JBrowse
  314. There are a variety of different ways to include new CSS into the browser, but the easiest might be the following
  315. Add the following statement to your trackList.json:
  316. ```
  317. "css" : "data/yourfile.css"
  318. ```
  319. Then just place your CSS file in your organism's data directory.
  320. ##### Adding custom CSS globally for JBrowse
  321. If you want to add CSS that is used globally for JBrowse, you can edit the CSS in the client/apollo/css folder, but
  322. since you need to re-deploy the app every time for updates, it is easier to just edit the data directories for your
  323. organisms (you do not need to re-deploy the app when you are editing organism specific data, since this is outside of
  324. the webapp directory and is not deployed with the WAR file)
  325. #### Adding custom CSS globally for the GWT app
  326. If you want to style the GWT sidebar, generally the bootstrap theme is used but extra CSS is also included from
  327. web-app/annotator/theme.css which overrides the bootstrap theme
  328. #### Adding / using proxies
  329. If you are https, or choose to use separate services rather than the default provided, you can setup a pass-through proxy or modify a particular URL.
  330. This service is only available to logged-in users.
  331. The internal proxy URL is:
  332. ```<apollo url>/proxy/request/<encoded_proxy_url>/```
  333. For example if your URL the URL we want to proxy:
  334. ```http://golr.geneontology.org/solr/select```
  335. encoded:
  336. ```http%3A%2F%2Fgolr.geneontology.org%2Fsolr%2Fselect```
  337. If you user is logged-in and you pass in:
  338. ```http://localhost/apollo/proxy/request/http%3A%2F%2Fgolr.geneontology.org%2Fsolr%2Fselect?testkey=asdf&anotherkey=zxcv```
  339. This will get proxied to:
  340. ```http://golr.geneontology.org/solr/select?testkey=asdf&anotherkey=zxcv```
  341. If you choose to use another proxy service, you can go to the "Proxy" page (as administrator).
  342. Internally used proxies are provided by default.
  343. The order the final URL is chosen in is 'active' and then 'fallbackOrder'.
  344. ### Register admin in configuration
  345. If you want to register your admin user in the configuration, you can add a section to your ```apollo-config.groovy``` like:
  346. apollo{
  347. // other stuff
  348. admin{
  349. username = "super@duperadmin.com"
  350. password = System.getenv("APOLLO_ADMIN_PASSWORD")?:"demo"
  351. firstName = "Super"
  352. lastName = "Admin"
  353. }
  354. }
  355. It should only add the user a single time. User details can be retrieved from passed in text or from the environment depending on user preference.
  356. Admin users will be added on system startup. Duplicate additions will be ignored.
  357. ### Other authentication strategies
  358. By default Apollo uses a username / password to authenticate users. However, additional strategies may be used.
  359. To configure them, add them to the ```apollo-config.groovy``` and set active to true for the ones you want to use to
  360. authenticate.
  361. apollo{
  362. // other stuff
  363. authentications = [
  364. ["name":"Username Password Authenticator",
  365. "className":"usernamePasswordAuthenticatorService",
  366. "active":true,
  367. ]
  368. ,
  369. ["name":"Remote User Authenticator",
  370. "className":"remoteUserAuthenticatorService",
  371. "active":false,
  372. ]
  373. ]
  374. }