Giter Site home page Giter Site logo

nilanjanchatterjee / parturition Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 3.0 18 MB

Understand parturition locations from animal movement data

R 96.59% Dockerfile 2.71% Shell 0.70%
behavioral-patterns clustering movement-ecology segmentation telemetry-data

parturition's Introduction

  • ๐Ÿ‘‹ Hi, Iโ€™m @nilanjanchatterjee, a Postdoctoral Fellow at Senckenberg Biodiversity and Climate research center (https://www.senckenberg.de/en/institutes/sbik-f/).
  • ๐Ÿ‘€ Iโ€™m interested in modelling ecological data using different statstical tools.
  • ๐ŸŒฑ Iโ€™m currently working in Modelling ungulate movements in Steppe Ecosystems and also develop/maintain apps at Moveapps (https://www.moveapps.org/), a no-code platform for analysis of animal tracking data.
  • ๐Ÿ’ž๏ธ Iโ€™m looking to collaborate on methodological development of ecological data analysis. I have used motion-triggered remote camera data in my PhD to estimate population density of different species and currently using animal tracking data to learn more about different behavioural states.
  • ๐Ÿ“ซ Want to learn more about my work and want to collaborate, drop me an email at [email protected]

parturition's People

Contributors

andreakoelzsch avatar annescharf avatar nilanjanchatterjee avatar sarahcd avatar smthfrmn avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

parturition's Issues

Output not matching that of previous app

This probably relates to the switch to move2. It looks like the animal IDs and taxa are not being passed onto the next app.

In the app just before the Parturitions app, the cargo agent shows there are 10 animals, 3961 positions, taxa Cervus elaphus:

image image image

After the Parturitions app runs, the cargo agent shows 1 animal, 3937 positions, and no animal attributes, animal names, or taxa names available:

image image image

In the output RDS, there is individual.name.deployment.id and trackID but no individual.local.identifier or animal.id.

Might relate to issue 19?

trackId stored as animal ID in artifacts

Both Parturition_vel and Parturition_output show the trackId but not the animal IDs (i.e., individual_local_identifier). Both are stored correctly in the .rds output. Suggestions:

  • Parturition_output.csv: rename Individual_id to trackId and add column individual_local_identifier or animal_id (@andreakoelzsch what is preferred?)
  • Parturition_vel.pdf: This one is harder. The simplest solution might be to reduce font size and include both at the top of each graph.

The animal ID is critical to linking data back to individual animals and addressing sample sizes and repeated parturition events per individual. The trackId is important to include because it allows the App to report multiple parturition events, depending on how the data are prepared in prior workflow steps. For example, if I use Filter Data by Season, it will provide Parturition with animal IDs as well as trackIds that identify track segments for each animal-year with available data. The trackIds are named by prior apps by appending a sequential number to the animal ID (e.g., three track segments for animal 100 will be named 1001, 1002, 1003). If the animal ID is not also included, this is very tricky to identify and resolve afterward.

Error in if (!is.na(dat_output[j, 4])) {: argument is of length zero

One study is consistently giving an error if the threshold speed is left blank. I shared a workflow.

It is not a problem with the setting in general, because it works with many other studies.

 2024-04-19 14:46:59.089 INFO : app will be started with configuration:
 2024-04-19 14:46:59.090 INFO : {
 2024-04-19 14:46:59.090 INFO :   "threshold": {},
 2024-04-19 14:46:59.091 INFO :   "window": 72
 2024-04-19 14:46:59.091 INFO : }
 2024-04-19 14:47:03.862 ERROR: Error in if (!is.na(dat_output[j, 4])) { : argument is of length zero
 2024-04-19 14:47:03.863 ERROR: Calls: tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
 2024-04-19 14:47:03.864 ERROR: In addition: Warning message:
 2024-04-19 14:47:03.863 INFO : [1] "ERROR:  Error in if (!is.na(dat_output[j, 4])) {: argument is of length zero\n"
 2024-04-19 14:47:03.864 ERROR: There were 2 warnings in `mutate()`.
 2024-04-19 14:47:03.865 ERROR: The first warning was:
 2024-04-19 14:47:03.866 ERROR: โ„น In argument: `rollm = rollapply(...)`.
 2024-04-19 14:47:03.867 ERROR: Caused by warning in `min()`:
 2024-04-19 14:47:03.867 ERROR: ! no non-missing arguments to min; returning Inf
 2024-04-19 14:47:03.867 ERROR: โ„น Run `dplyr::last_dplyr_warnings()` to see the 1 remaining warning.
 2024-04-19 14:47:03.868 ERROR: Execution halted

Record the threshold speed used in Parturition_output.csv

For the threshold speed to detect parturition events, the user can use automatically-calculated mean speeds for each animal/track, or enter a value to use across the dataset. Currently Parturition_output.csv always reports the calculated mean speeds in Threshold_speed(m/h). Instead we could better document the analysis results by reporting the speeds used in the analysis run based on the setting (either calculated mean speeds, or the same entered threshold value, for each).

include all calving times that meet the threshold in CSV

Currently only the longest period meeting the threshold conditions are included in the csv of results, but this is often not the correct or most visually obvious parturition time. All records for periods meeting the conditions are already identified by the analysis results and added to the RDS output. We'll include records for all periods that meet the threshold conditions in the csv results.

option to specify y-axis range for Time vs Distance/dT

User request for Parturition_vel.pdf: provide an optional App setting to manually define the y axis scale of the Time vs Distance/dT graph, to better see the low velocity movements. This could be a specific value, or the option to constrain to x * threshold speed.

identify multiple events meeting threshold conditions

User request: consider the possibility of multiple periods that meet the threshold speed/duration for an individual.
I see two approaches to address this:

  1. Prior Apps divide the data into tracks, and up to 1 parturition can be identified in each. This is already possible, e.g., filtering data by season allows identifying yearly calving events (I added some description in the readme to explain this).

  2. Add an App setting to identify the parturition as either (1) the maximum time interval from the track that satisfies the threshold condition (current method) or (2) all intervals from the track that satisfy the threshold condition. In this case I guess the output might need to be modified to include distinct identifiers for the animal, track, and parturition estimate.

We might want to discuss this more with them to understand the behaviors or conditions that would cause >1 apparent parturition per year, and make sure the solution/s would work for these cases.

calving event not detected

In our first attempts we got quite good results across a lot of animals. We did notice one case where a calving event is obvious from viewing the Parturition_vel graphs but is not detected:
image

See emails for details to replicate.

show all calving times that meet the threshold on PDF

Currently only the longest period meeting the threshold conditions are displayed on the PDF plot, but this is often not the correct or most visually obvious parturition time. All records for periods meeting the conditions are already identified by the analysis results and added to the RDS output. We'll add display of all thresholds that meet the conditions to the PDF plots.

Questions:
How to allow users to compare which points on the map correspond with which dates?
How to display the parturition time? There is not enough room to list more than a few on the lefthand plot. It might help to truncate the display to just the date (remove time). Or could list them outside the plots.

missing ids and blank rows in parturition_output.csv

We noticed three different types of missing information in the output table. I'll put an example of all of them here in case the causes are related:

  1. Some parturition events are missing an Individual_id. It looks like for each Track_id, the corresponding Individual_id is present only for the first detected event:
image
  1. In other cases, the Individual_id is present but the corresponding Track_id is missing:
image
  1. And in other cases, the entire row is empty:
image

display estimated parturition date

User request for Parturition_vel.pdf: For each parturition estimate, add a label somewhere on the graphs with the estimate calving date.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.