jefferis / gphys Goto Github PK
View Code? Open in Web Editor NEWR package to analyse electrophysiology data acquired by Neuromatic / Igor Pro
Home Page: https://jefferis.github.io/gphys
R package to analyse electrophysiology data acquired by Neuromatic / Igor Pro
Home Page: https://jefferis.github.io/gphys
Currently if you specify an odour subset that includes a duplicate odour (e.g. the blank) it errors out suggesting you might like to subset by channel numbers. But there is a special case when CO2 is being delivered and the same channel number is associated with another odour. For this case it is better just to subset by odour name, but remove any duplicate waves for odours that we have requested.
Line 211 in 884da72
Unfortunately the start of the pulse is only recorded in the pxp file that determines the TTL pulse.
If the same numbered channel is used with two different labels in an ODD config, merge.spiketimes
will try to merge all data from that numbered channel but then confuses the channel labels.
Note that 2. could break some cells somewhere unless we only use label when number alone is insufficient to identify. We might recognise this e.g. by checking that every row of data has the same number of stimulations.
This will make it easier to attach other information such as the analogue voltage traces later on. The place to do this is in CollectSpikesFromSweeps
but we will need to make sure that this propagates through e.g. merge
and divide.spiketimes
.
The main motivation for this is to deal with Shahar's data collection with shuffled odour presentations. At the moment this works for spikes (see #13) but not for the average voltage traces which are therefore averages of the wrong sweeps. Previously we have been using Igor to generate those average waves. Now we will need to do it in R.
(see also #3)
This one is not so obvious to me:
split:
function(x, f, drop, ...)
split.spiketimes:
function(st, blocksize)
maybe I need to change the function name
This will be essential to prepare for an eventual CRAN release.
This one is easy in principle (with some change of interface).
scale:
function(x, center, scale)
scale.ts:
function(waves, yrange)
> as.repeatedTrain(Spikes2[[200]],xlim-c(0,3000))
$OilBl
Error in plot.window(...) : need finite 'xlim' values
In addition: Warning messages:
1: In FUN(X[[4L]], ...) : no non-missing arguments to max; returning -Inf
2: In FUN(X[[4L]], ...) : no non-missing arguments to max; returning -Inf
3: In FUN(X[[4L]], ...) : no non-missing arguments to max; returning -Inf
4: In FUN(X[[4L]], ...) : no non-missing arguments to max; returning -Inf
Fundamentally, this may involve some changes to the STAR package to incorporate a notion of the time window over which spikes were mesasured (even if there were no spikes).
i.e. they should not be counted for the purpose of N in the calculation of S
... because sometimes we want to plot a spike response without subtracting a baseline count
was not treating values <=1 as fractions
@sfrechter came across this recently for e.g. file 4 of this cell /Volumes/JData5/JPeople/Shahar/Data/151231/nm20151231c0
when he was trying out odour shuffling.
The docs for divide say the following:
FIXME Teach this to cope with repeat blocks with different odours in different order
to match OdourResponseFromSpikes
rather than a PlotFrequency
arg
lifetime_sparseness
function (x, minodours = 0.75)
{
if (is.data.frame(x))
x = as.matrix(x)
if (!is.matrix(x)) {
if (is.vector(x))
x <- matrix(x, nrow = 1)
else stop("Unknown data format. I like matrices, dataframes and vectors.")
}
if (any(x < 0, na.rm = T)) {
nxlt0 = sum(x < 0, na.rm = T)
x[x < 0] = 0
warning("Zeroing ", nxlt0, " responses < 0")
}
N <- ncol(x)
S = 1/(1 - 1/N) * (1 - (rowSums(x/N, na.rm = T)^2)/(rowSums(x^2/N,
na.rm = T)))
nodours_percell = rowSums(is.finite(x))
badcell = nodours_percell < minodours
if (any(badcell)) {
warning("Returning NA for ", sum(badcell, na.rm = T),
" cells that have too few odours")
S[badcell] = NA
}
S
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.