Skip to content

File not going into system #104

@nohelix

Description

@nohelix

Issue

Can't determine threshold causes failure to load file.

Note

For these new edge files, they have a special 30 trial initial block so he only had 2 points from which to get a threshold and it appears to have failed. Thus this rat effectively had 1 trial I guess (see #47). Interestingly, if there is < 30 trials, the system can handle it.

Solution

Need to add a 'fail safe' in the TH code that if a TH can't be calculated due to few trials, then report TH as NA.

Details/Needed to repeate

Rat: Teal11
Weight: 462
Comments: didn't want to run trials: Breaks with no jams 15-25, 27-31, 31-41 and stopped early
Scientist: Noelle (data) + Anand

File:
Teal11_edge_4.5-12kHz_20-80dB_2000ms_12s_BG_PKN_0dB_20250318-122301_BOX#001.mat.zip

Log form R:

Loading file... C:\Users\Noelle\AppData\Local\Temp\RtmpgJ4hy8/87a2d9ad8bd827ef37eb011b/0.mat
Stim file: edge_4.5-12kHz_20-80dB_2000ms_12s_BG_PKN_0dB
Trials: 31 Hit%: 100 FA%: 26.7
Warning: Returning more (or less) than 1 row per summarise() group was deprecated in dplyr 1.1.0.
ℹ Please use reframe() instead.
ℹ When switching from summarise() to reframe(), remember that reframe() always returns an ungrouped
data frame and adjust accordingly.
Call lifecycle::last_lifecycle_warnings() to see where this warning was generated.
Analysis type: BBN (Standard)
Warning: Error in mutate: ℹ In argument: TH = map_dbl(data, Calculate_TH).
ℹ In group 1: Freq = 0, Dur = 2000.
Caused by error in map_dbl():
ℹ In index: 1.
Caused by error in approx():
! need at least two non-NA values to interpolate
127:
126: signalCondition
125: signal_abort
124: abort
123:
122: signalCondition
121: signal_abort
120: rlang::abort
119: cli::cli_abort
118: h
117: .handleSimpleError
116: stop
115: approx
114: .f [Z:/Behavior-autoanalysis/main.R#1399]
110: map_
109: map_dbl
108: eval
107: mask$eval_all_mutate
106: mutate_col
104: mutate_cols
103: mutate.data.frame
102: mutate
101: %>%
100: Calculate_Threshold [Z:/Behavior-autoanalysis/main.R#1469]
99: Calculate_Summary_Statistics [Z:/Behavior-autoanalysis/main.R#1579]
98: Process_File [Z:/Behavior-autoanalysis/main.R#1921]
97: renderText [Z:\Behavior-autoanalysis/app.R#357]
96: func
83: renderFunc
82: output$requirements
1: runApp
Input to asJSON(keep_vec_names=TRUE) is a named vector. In a future version of jsonlite, this option will not be supported, and named vectors will be translated into arrays instead of objects. If you want JSON object output, please use a named list instead. See ?toJSON.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions