knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

Index

  1. Preparing your data
    1. Structuring the study area
    2. Creating a distances matrix
  2. explore()
    1. Processes behind explore()
    2. Inspecting the explore() results
  3. migration()
    1. Processes behind migration()
    2. Inspecting the migration() results
    3. One-way efficiency estimations
  4. residency()
    1. Processes behind residency()
    2. Inspecting the residency() results
    3. Multi-way efficiency estimations
  5. Manual mode
  6. Errors and messages

Preparing your data

Actel requires that you organise your input files in a specific fashion. Critically, you should have a file named biometrics.csv, one named spatial.csv, and one named deployments.csv (we will look into the file contents in detail soon). Finally, you also need a detections directory, containing all your detection files in .csv format.

To create a blank workspace ready to be used, run createWorkspace(), and a template will be generated automatically in your a newly created "actel_workspace" directory. If you would like to, you can change the name of the target directory by using the argument dir. Remember to delete the example rows before including your data!

Biometrics file

Your biometrics file should look similar to this:

biometrics <- data.frame(Release.date=c("2018-02-01 10:05:00","2018-02-01 10:10:00","2018-02-01 10:15:00")
    ,Serial.nr=c("12340001","A12-3456-1001","19340301")
    ,Signal=c(1,1001,301)
    ,Length.mm=c(150,160,170)
    ,Weight.g=c(40,60,50)
    ,Group=c("Wild","Hatchery","Wild")
    ,Release.site=c("Site A","Site A","Site B")
    ,...=c("...","...","...")
    )
knitr::kable(biometrics)

Although the column order is not important, it is essential that this table contains two columns:

Release.date : Corresponds to the date and time when the fish was released, and must be typed in yyyy-mm-dd hh:mm:ss format. Note that the timestamps must be in the local time zone of the study area, which you will later supply in the tz argument.

Signal : Corresponds to the code emitted by your tags. If you are unsure as to what signals are, you should ask the tag manufacturer more about the differences between code spaces and signals.

The Group and Release.site columns are also important but, if you only have one group or one release site, actel can generate these columns for you. If this happens, you will receive a message:

M: No Release site has been indicated in the biometrics file. Creating a 'Release.site' column to avoid script failure. Filling with 'unspecified'.
M: No 'Group' column found in the biometrics file. Assigning all fish to group 'All'.

Note: : You can append as many columns as you want to biometrics.csv. Importantly, if the biometrics have columns with keywords such as length, weight or mass, graphics showing the distribution of these parameters per fish group will be drawn for you in the report.

Spatial file

Your spatial file should look similar to this:

  spatial <- data.frame(Station.name=c("River East","River West","Estuary","Site A","Site B")
    ,Latitude=c(8.411,8.521,8.402,8.442,8.442)
    ,Longitude=c(40.411,40.521,40.402,40.442,40.442)
    ,Array=c("River1","River1","River2","River1","River2")
    ,Type=c("Hydrophone","Hydrophone","Hydrophone","Release","Release")
    )
knitr::kable(spatial)

In this file you should include both your station deployment sites and your release sites. It is essential that this table has the following columns:

Station.name : The name of the station will be used to match the receiver deployments.

Array : If you are listing a station: The array to which the station belongs. : If you are listing a release site: The first array that the fish is expected to cross after being released. : Note: - If you are only going to run an explore() analysis, you can name your arrays freely. - If you are going to run migration() or residency(), the names of arrays from a given study section must differ only in number. I.e. arrays must have this format: section#.

Type : The nature of the item you are listing. You must choose between "Hydrophone" or "Release".

Note:

  1. The release sites must have exactly the same names in the biometrics table and in the spatial table. If there is a mismatch, actel will stop so you may correct this.

  2. If the spatial table contains release site information, but the biometrics table does not, release site information will be discarded and the following warning is issued:

W: At least one release site has been indicated in the spatial file, but no release sites were specified in the biometrics file.
   Discarding release site information to avoid script failure. Please doublecheck your data.

Click here to learn more about how to organise your study area in an actel-friendly way.

Deployments file

The deployments file is where you will list the receivers you used in the study. here is an example:

  deployments <- data.frame(Receiver = c(11111, 22222, 33333),
    Station.name = c("River East","River West","Estuary")
    ,Start = c("2018-01-01 11:30:00", "2018-01-01 11:33:00", "2018-01-01 11:34:00")
    ,Stop = c("2018-05-03 09:30:00", "2018-05-04 08:33:00", "2018-05-05 12:00:00")
    )
knitr::kable(deployments)

Short description of the columns:

Receiver : The serial number of the receiver. If a receiver was retrieved and re-deployed, you should add extra rows for each deployment.

Station.name : The name of the station where the receiver was deployed. It must match one of the station names in the spatial file.

Start and Stop : The times when the receiver was deployed and when the receiver was retrieved, respectively. Must be in a yyyy-mm-dd hh:mm:ss format. Note that these timestamps must be in the local time zone of the study area, which you will later supply in the tz argument.

Detections

Including your detections is the easiest part. Copy the .csv files offloaded from your receivers to the detections folder that was created by the createWorkspace() function and actel will know they are to be imported. Right now actel can upload files generated from VEMCO and THELMA manufactured receivers. If you have an receiver from a different manufacturer, or if you are using one of the supported manufacturers and get the warning displayed below, please to contact me so we can solve the issue.

W: File 'filename' does not match to any of the supported hydrophone file formats! If your file corresponds to a hydrophone log and actel did not recognize it, please get in contact through www.github.com/hugomflavio/actel/issues/new

Note: : The detection timestamps must be in UTC. This is the default time zone used by the receivers, so as long as you did not edit the raw files, all should be ready to go.

Optional: Distances matrix

A distances matrix is a table that contains information on the distance (in metres) between every pair of spatial elements in your study area (i.e. your receivers and your release sites). It looks like the table below:

| | St.1| St.2| St.3| St.4| St.5| St.6| Release| |:-------|--------:|--------:|--------:|--------:|----------:|----------:|---------:| |St.1 | 0.000| 1366.153| 3417.379| 6912.118| 8863.6829| 9272.5684| 2229.759| |St.2 | 1366.153| 0.000| 2051.225| 5545.964| 7497.5297| 7906.4151| 3569.994| |St.3 | 3417.379| 2051.225| 0.000| 3528.232| 5479.7976| 5888.6830| 5621.219| |St.4 | 6912.118| 5545.964| 3528.232| 0.000| 1963.4126| 2372.2981| 9115.958| |St.5 | 8863.683| 7497.530| 5479.798| 1963.413| 0.0000| 408.8854| 11067.524| |St.6 | 9272.568| 7906.415| 5888.683| 2372.298| 408.8854| 0.0000| 11476.409| |Release | 2229.759| 3569.994| 5621.219| 9115.958| 11067.5236| 11476.4090| 0.000|

You can learn more about creating distances matrices in this page.

Optional: spatial.txt file

If your study area has multiple branches, then you need to tell actel how your receivers array connect with each other. This file is optional because, if ommitted, actel will assume that your study area is composed by a single branch and that the array order is the one listed in the spatial.csv file.

The spatial.txt file is very simple; all you need to do is connect your arrays with either dashes or arrows (find out the difference below). You can connect your arrays in pairs or make longer strings. To decide whether or not two arrays should be connected, ask yourself the following: "Can fish move from A to B without having to pass through any other array?" If the answer is yes, then the arrays should be connected. Let's have a look at some examples:

One branch study area, fully covering arrays

This is the simplest case, e.g. your fish are migrating through a channel, and your arrays split this channel in sections. Like in the figure below:

drawing

For this specific case you do not need to include a spatial.txt file, as long as you order the arrays in the spatial.csv file. However, if you wanted to include a spatial.txt file, it would look like this:

A -- B -- C -- D -- E

Note that you could also specify only one connection per line. E.g.:

A -- B 
B -- C 
C -- D 
D -- E

One branch study area, partly-covering arrays

This case is similar to above, but some arrays do not cover the totality. For example, they may cover a specific area of a lake (e.g. a spawning ground), Like in the figure below:

drawing

In this case, fish can move from B to D without passing through C. As such, a spatial.txt file is now required, and it would look like this:

A -- B -- D -- E
B -- C
C -- D

Note that now, B, C and D are all directly connected with each other.

Multi branch study areas

In this case, the water channel branches into multiple paths, which may then merge again or not, like in the figure below:

drawing

Things are getting a bit more complex now. To make sure you do not miss any connection, it can be useful to draw in a map the links between the arrays as you write them down, so you can check at the end if everything is done. Below, I have marked in purple the connections between all the arrays:

drawing

And here is the respective spatial.txt:

A -- B 
A -- E
A -- F
B -- E
B -- F
E -- F
B -- C
C -- D
C -- E
E -- D
F -- G

Or, in the shortened version:

A -- B -- C -- D
A -- E -- D
A -- F -- G
B -- E -- F
B -- F
C -- E

If are feeling wary of including multiple links in a single line, you can use the function readDot to read your spatial.txt file before starting the analysis and see if everything checks out. E.g.: readDot(input = "spatial.txt")

Note: : This file can be called either "spatial.dot" or "spatial.txt", and you can create it using a simple text editor such as notepad, kate, VIM, etc.

Array direction

In the migration analysis, array direction is relevant. That means that writing A -- B is not the same as writing B -- A. In the first case, array B comes after array A (i.e. the fish are expected to reach A before reaching B), while in the second case the situation is reversed. This has implications for array efficiency calculations, so be sure to encode your study area carefully.

If you intend to run an explore or residency analysis, array direction is irrelevant.

explore()/residency() vs migration()

An optimal spatial.txt may differ depending on whether you want to run a migration or an explore/residency analysis. This is because actel interprets the spatial.txt file depending on the analysis:

In a explore/residency analyses, A -- B should be read as:

It is possible to move from array A to array B and vice-versa

In a migration analysis, A -- B should be read as:

It is possible to move from array A to array B and vice-versa, AND the fish are expected to pass through array A before reaching array B

Let's have a look at this example.

drawing

In this case, the spatial.txt for a residency analysis would look like this:

A -- B -- C -- G
A -- D -- E -- G
D -- F -- G
D -- B
C -- E
C -- F
E -- F

But a spatial.txt for a migration analysis would look like this:

A -- B -- C -- G
A -- D -- E -- G
D -- F -- G
D -- B -- D
C -- E -- C
C -- F -- C
E -- F -- E

The difference here is that, in the spatial.txt for migration, actel expects arrays to connected in a directional way. That means that connecting D -- B and B -- D does not mean the same thing, and it is important that you explicitly state that the fish are as likely to reach B coming from D as they are to reach D coming from B. In other words, you are saying that neither of the movements would be an explicit backwards movement. This will inform actel that D and B are parallel arrays, and that special rules should apply to them. The same goes for C, E and F.

Barriers

Sometimes it is possible for your fish to go from A to B, but not from B to A. In actel, you can include this information to further refine the analysis. In total, there are three symbols you can use to connect your arrays: --, -> or <-.

If the fish can move from A to B and vice-versa, use A -- B.

If the fish can only move from A to B, use either A -> B or B <- A.

If a fish then actually moves from B to A, actel will try to find an alternative route that the fish could have taken. If there are no alternative routes from B to A, actel will call this situation to your attention.

This has implications for array efficiency calculations, so be sure to encode your study area carefully.

Running the analysis

Now that you have prepared your workspace, it is time to start the analysis. The first thing you need to do is decide which analysis you want to run: explore(), migration() or residency(). Here is some more information on them:

1. explore()

explore() allows you to quickly get a summary of your data. You can use explore() to get a general feel for the study results, and check if the input files are behaving as expected. It is also a good candidate if you just want to validate your detections for later use in other analyses.

Learn more about the explore function.

2. migration()

The migration() analysis runs the same initial checks as explore(), but on top of it, it analyses the fish behaviour. By selecting the arrays that lead to success, you can define whether or not your fish survived the migration. Additional plots help you find out if some fish has been acting odd. Multiple options allow you to tweak the analysis to fit your study perfectly.

Learn more about the migration function.

3. residency()

The residency() analysis runs the same initial checks as explore(), but, similarly to migration, explores particular points of the fish behaviour. If you want to know where your fish were in each day of the study, how many fish were in each section each day, and other residency-focused variables, this is the analysis you are looking for!

Learn more about the residency function.

Back to top.



hugomflavio/actel documentation built on Jan. 11, 2020, 11:36 a.m.