Skip to content

emkayoh/Dark

Repository files navigation

Dark

Version 0.9.9

To Do

Test scripts

Use R6 to incorporate present analysis methods

Status

Project Status: Active – The project has reached a stable, usable state and is being actively developed.

License

License

Introduction

This package was initially developed at the University of Manchester and has since been the basis for developing new functions at Mumac Ltd to analyse data collected in dark adaptation measurements and experiments.

Data are collected using custom-built laboratory devices, computer-controlled CRT units and lately, the Rapida™ Mk 1. The results are usually stored as text, CSV files or an SQLite database. The first part of the workflow is to create a script that retrieves the data and presents it within R in a format that is usable to the other functions.

The suite of scripts uses a list referred to as a dark object; an initial workthrough of the data input is shown below. A first GetData... script is shown in GetData.R. This script can be used as a template to create a script specific to your work.

Acknowledgement

This work presents independent research funded by the National Institute for Health Research Invention for Innovation (NIHR i4i) Programme (ref: II-LB-0712-20001). The views expressed are those of the author(s) and not necessarily those of the NHS, the NIHR or the Department of Health. Later work was funded by Mumac Ltd, a spin-out company from The University of Manchester.

Contact

The package's author can be contacted through jeremiah.kelly at mumacltd.com or emkayoh at mac.com.

Getting started

The scripts rely on generating a dark object, obj. This list has at least two elements; obj$time and obj$thrs.

Here is a way to do that: copy and paste from a spreadsheet.

Select the time data, then in R type;

obj<-NULL

obj$time<- scan()

Then paste and press return.

obj<- NULL
obj$time<- scan()
1: 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
22: 
Read 21 items

Repeat for the thresholds

obj$thrs<- scan()
1: 0.1453469 -0.6968675 -1.0072369 -1.0166411 -0.6266554 -0.9923025 -1.1308808 -1.3437734 -1.5006185 -1.5132403 -1.9454982 -2.1601161 -2.3190977 -2.9759416 -2.6118030 -2.6488100 -2.4796138 -3.0221779 -2.8277825 -2.9462043 -3.1657820
22: 
Read 21 items

Finally, set the class to dark

class(obj)='dark'

The output should resemble this:

> obj
$thrs
 [1]  0.1453469 -0.6968675 -1.0072369 -1.0166411 -0.6266554 -0.9923025 -1.1308808
 [8] -1.3437734 -1.5006185 -1.5132403 -1.9454982 -2.1601161 -2.3190977 -2.9759416
[15] -2.6118030 -2.6488100 -2.4796138 -3.0221779 -2.8277825 -2.9462043 -3.1657820

$time
 [1]  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20

attr(,"class")
[1] "dark"

Email or raise an issue for further help.

About

Scripts to analyse dark adaptation data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published