From d5f91ad3b918180d515d277d4046c61ae36ac42c Mon Sep 17 00:00:00 2001 From: Gregory Jefferis Date: Tue, 8 Nov 2016 23:31:54 +0000 Subject: [PATCH] doc fixes --- R/catmaid_connection.R | 4 +-- docs/index.html | 45 +++++++++++------------- docs/reference/catmaid_user_history.html | 2 ++ docs/reference/catmaid_version.html | 4 +-- docs/reference/index.html | 2 +- man/catmaid_version.Rd | 4 +-- 6 files changed, 29 insertions(+), 32 deletions(-) diff --git a/R/catmaid_connection.R b/R/catmaid_connection.R index 5d3a625..3f9356d 100644 --- a/R/catmaid_connection.R +++ b/R/catmaid_connection.R @@ -397,8 +397,8 @@ catmaid_connection_unsetenv<-function(){ #' CATMAID versions are now prduced by \bold{git describe} and look like #' YYYY.MM.DD-XX-gaaaaaaa where aaaaaaa is a short SHA1 hash and XX is an #' integer number of revisions since the last base version. Setting -#' \code{numeric=TRUE} trims of the SHA1 hash leaving a string that can be -#' interpreted as four part version number (see examples). +#' \code{numeric=TRUE} trims off the SHA1 hash leaving a string that can be +#' interpreted as a four part version number (see examples). #' @param conn A \code{catmaid_connection} object. The default value of NULL #' implies that the most recent cached open connection will be used. #' @param cached Whether to use the cached version number for this connection diff --git a/docs/index.html b/docs/index.html index 45c54db..bdfc2d0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -40,7 +40,7 @@

Quick start

-
# install
+
# install
 if (!require("devtools")) install.packages("devtools")
 # nb repo is rcatmaid, but R package name is catmaid
 devtools::install_github("jefferis/rcatmaid")
@@ -63,13 +63,13 @@ 

open3d() # nb this also plots the connectors (i.e. synapses) # red = presynapses, cyan = postsynapses -plot3d(nl, WithConnectors=TRUE)

+plot3d(nl, WithConnectors=TRUE)

Fancier example

This produces a 3D plot of the first and second order olfactory neurons coloured according to the peripheral odorant receptor.

-
# fetch olfactory receptor neurons
+
# fetch olfactory receptor neurons
 orns=read.neurons.catmaid("name:ORN (left|right)", .progress='text')
 # calculate some useful metadata
 orns[,'Or']= factor(sub(" ORN.*", "", orns[,'name']))
@@ -80,13 +80,13 @@ 

# plot, colouring by odorant receptor plot3d(orns, col=Or) # note that we plot somata with a radius of 1500 nm -plot3d(pns, col=Or, soma=1500)

+plot3d(pns, col=Or, soma=1500)

Even fancier example

This follows on from the previous example. It identifies downstream partner neurons of the ORNs and plots them in 3d coloured by their synaptic strength. It then carries out morphological clustering with NBLAST and plots the partner neurons according to those clusters.

-
# find all the ORN downstream partners with at least 2 synapses
+
# find all the ORN downstream partners with at least 2 synapses
 orn_partners=catmaid_query_connected(orns[,'skid'], minimum_synapses = 2)
 # keep the ones not already in our set of PNs
 # there are lots!
@@ -135,7 +135,7 @@ 

plot3d(non_pn_downstream.hc,db=non_pn_downstream, k=2, soma=1000) clear3d() # 4 clusters - note local and projection neurons, gustatory neurons -plot3d(non_pn_downstream.hc,db=non_pn_downstream, k=4, soma=1000)

+plot3d(non_pn_downstream.hc,db=non_pn_downstream, k=4, soma=1000)

@@ -145,9 +145,9 @@

Setting package authentication options in your .Rprofile

It is recommended that you set these details by including code like this in in your .Rprofile file:

-
options(catmaid.server="https://mycatmaidserver.org/catmaidroot",
+
options(catmaid.server="https://mycatmaidserver.org/catmaidroot",
   catmaid.authname="Calvin",catmaid.authpassword="hobbes",
-  catmaid.username="calvin", catmaid.password="hobbesagain")
+ catmaid.username="calvin", catmaid.password="hobbesagain")

In this way authentication will happen transparently as required by all functions that interact with the specified CATMAID server. Note that the CATMAID servers that I am aware of require two layers of password protection, an outer HTTP auth type user/password combination as well as an inner CATMAID-specific password.

@@ -155,48 +155,43 @@

Token based authentication

As of December 2015 CATMAID is moving to token based authentication. For this you will need to get an API token when you are logged into the CATMAID web client in your browser. See http://catmaid.github.io/dev/api.html#api-token for details.

You would then set your .Rprofile like this:

-
options(catmaid.server="https://mycatmaidserver.org/catmaidroot",
+
options(catmaid.server="https://mycatmaidserver.org/catmaidroot",
   catmaid.authname="Calvin",catmaid.authpassword="hobbes",
-  catmaid.token="9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b")
+ catmaid.token="9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b")

Note that you will probably still need to specify you http username/password combination even if you are using an API token to authenticate to the CATMAID server.

Cached authentication

Whether you use options in your .Rprofile as described above or you login explicitly at the start of a session by doing something like:

-
catmaid_login(server="https://mycatmaidserver.org/catmaidroot",
+
catmaid_login(server="https://mycatmaidserver.org/catmaidroot",
               authname="Calvin",authpassword="hobbes",
-              token="9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b")
+ token="9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b")

the access credentials will be cached for the rest of the session. You can still authenticate explicitly to a different CATMAID server (using catmaid_login) if you wish.

Multiple servers

If you need to talk to more than one catmaid server in a single session then you must use catmaid_login to login into each server

-
# log in to default server specified in .Rprofile
+
# log in to default server specified in .Rprofile
 conn1=catmaid_login()
 # log into another server, presumably with different credentials
-conn2=catmaid_login(server='https://my.otherserver.com', ...)
+conn2=catmaid_login(server='https://my.otherserver.com', ...)

and then use the returned connection objects with any calls you make e.g.

-
# fetch neuron from server 1
+
# fetch neuron from server 1
 n1=read.neuron(123, conn=conn1)
 # fetch neuron from server 2
-n2=read.neuron(123, conn=conn2)
+n2=read.neuron(123, conn=conn2)

nb you must use connection objects to talk to both servers because if no connection object is specified, the last connection will be re-used.

Installation

-

Currently there isn’t a released version on CRAN.

-
-

- Bleeding Edge

-

You can use the devtools package to install the development version:

-
if (!require("devtools")) install.packages("devtools")
-devtools::install_github("jefferis/rcatmaid")
-

Note: Windows users need Rtools and devtools to install this way.

-
+

Currently there isn’t a released version on CRAN but can use the devtools package to install the development version:

+
if (!require("devtools")) install.packages("devtools")
+devtools::install_github("jefferis/rcatmaid")
+

Note: Windows users need Rtools and devtools to install this way.

diff --git a/docs/reference/catmaid_user_history.html b/docs/reference/catmaid_user_history.html index aebb606..0ad4cad 100644 --- a/docs/reference/catmaid_user_history.html +++ b/docs/reference/catmaid_user_history.html @@ -121,6 +121,8 @@

Value

Examples

## Not run: ------------------------------------ # catmaid_user_history(from="2016-01-01") +# # last 2 days +# catmaid_user_history(from = Sys.Date()-2) ## ---------------------------------------------