Skip to content

Lab Management

getKnownExperiments

cExperiments = getKnownExperiments()

Returns a cell array of the string values of known experiments.

Returns Type Values
cExperiments cell strings of all known experiment names

Example

Retrieve existing experiments from the Synapse database.

result = syn.getKnownExperiments()
if numel(result) < 1
    error('no experiments found')
end
result = syn.getKnownExperiments()
if len(result) < 1:
    raise Exception('no experiments found')

getKnownSubjects

cSubjects = getKnownSubjects()

Returns a cell array of the string values of known subjects.

Returns Type Values
cSubjects cell strings of all known subject names

Example

Retrieve existing subjects from the Synapse database.

result = syn.getKnownSubjects()
if numel(result) < 1
    error('no subjects found')
end
result = syn.getKnownSubjects()
if len(result) < 1:
    raise Exception('no subjects found')

getKnownUsers

cUsers = getKnownUsers()

Returns a cell array of the string values of known users.

Returns Type Values
cUsers cell strings of all known user names

Example

Retrieve existing users from the Synapse database.

result = syn.getKnownUsers()
if numel(result) < 1
    error('no users found')
end
result = syn.getKnownUsers()
if len(result) < 1:
    raise Exception('no users found')

getKnownTanks

cTanks = getKnownTanks()

Returns a cell array of the string values of known tanks.

Returns Type Values
cTanks cell strings of all known tank names

Example

Retrieve existing tanks from from the Synapse database.

result = syn.getKnownTanks()
if numel(result) < 1
    error('no tanks found')
end
result = syn.getKnownTanks()
if len(result) < 1:
    raise Exception('no tanks found')

getKnownBlocks

cBlocks = getKnownBlocks()

Returns a cell array of the string values of known blocks.

Returns Type Values
cBlocks cell strings of all known block names

Example

Retrieve existing block names from the Synapse database.

result = syn.getKnownBlocks()
if numel(result) < 1
    error('no blocks found')
end
result = syn.getKnownBlocks()
if len(result) < 1:
    raise Exception('no blocks found')

getCurrentExperiment

sExperiment = getCurrentExperiment()

Returns the name of the currently selected experiment.

Returns Type Values
sExperiment string current experiment name

Example

Retrieve the current experiment name.

currExperiment = syn.getCurrentExperiment()
currExperiment = syn.getCurrentExperiment()

getCurrentSubject

sSubject = getCurrentSubject()

Returns the name of the currently selected subject.

Returns Type Values
sSubject string current subject name

Example

Retrieve the current subject name.

currSubject = syn.getCurrentSubject()
currSubject = syn.getCurrentSubject()

getCurrentUser

sUser = getCurrentUser()

Returns the name of the currently selected user.

Returns Type Values
sUser string current user name

Example

Retrieve the current user name.

currUser = syn.getCurrentUser()
currUser = syn.getCurrentUser()

getCurrentTank

sTank = getCurrentTank()

Returns the name of the currently selected tank.

Returns Type Values
sTank string current tank name

Example

Retrieve the current tank name.

currTank = syn.getCurrentTank()
currTank = syn.getCurrentTank()

getCurrentBlock

sBlock = getCurrentBlock()

Returns the name of the currently recording block.

Returns Type Values
sBlock string current block name

Example

Retrieve the current block name.

currBlock = syn.getCurrentBlock()
currBlock = syn.getCurrentBlock()

createSubject

bSuccess = createSubject(sName, sDesc, sIcon)

Creates a subject with the given name, description, and icon.

Inputs Type Values
sName string name of subject
sDesc string description of subject
sIcon string type of icon to represent subject.
Valid icons are: 'mouse', 'rat', 'monkey', 'marmoset', 'human', 'bat', 'owl', 'bird', 'ferret', 'gerbil', 'guinea-pig', 'rabbit', 'pig', 'cat', 'dog', 'fish', 'dolphin', 'snake', 'shark', 'duck', 'cow', 'goat', 'horse'
Returns Values
bSuccess boolean 0 (fail), 1 (success)

Example

Create a new subject, and set it as the current subject before recording.

nextSubj = 'ABC123';

syn.createSubject(nextSub, 'Control', 'mouse')

syn.setCurrentSubject(nextSub)

syn.setMode(3)
nextSub = 'ABC123'

syn.createSubject(nextSub, 'Control', 'mouse')

syn.setCurrentSubject(nextSub)

syn.setMode(3)

createTank

bSuccess = createTank(sTankPath)

Creates a tank at the given path.

Inputs Type Values
sTankPath string path to new tank
Returns
bSuccess boolean 0 (fail), 1 (success)

Example

Create a new tank, set it as the current tank, and start recording.

nextTank = 'C:\TDT\NEXTTANK'

syn.createTank(nextTank)

syn.setCurrentTank(nextTank)

syn.setMode(3)
nextTank = 'C:\\TDT\\NEXTTANK'

syn.createTank(nextTank)

syn.setCurrentTank(nextTank)

syn.setMode(3)

setCurrentExperiment

bSuccess = setCurrentExperiment(sExperiment)

Creates a tank at the given path.

Inputs Type Values
sExperiment string experiment name
Returns
bSuccess boolean 0 (fail), 1 (success)

Example

Find first known experiment and select it.

result = syn.knownExperiments()

syn.setCurrentExperiment(result{1})
result = syn.knownExperiments()

syn.setCurrentExperiment(result[0])

setCurrentSubject

bSuccess = setCurrentSubject(sSubject)

Creates a tank at the given path.

Inputs Type Values
sSubject string subject name
Returns
bSuccess boolean 0 (fail), 1 (success)

Example

Find first known subject and select it.

result = syn.knownSubjects()

syn.setCurrentSubject(result{1})
result = syn.knownSubjects()

syn.setCurrentSubject(result[0])

setCurrentUser

bSuccess = setCurrentUser(sUser, sPassword)

Creates a tank at the given path.

Inputs Type Values
sUser string user name
sPassword string (optional) user password, if set during creation
Returns
bSuccess boolean 0 (fail), 1 (success)

Example

Find first known user and select it.

result = syn.knownUsers()

syn.setCurrentUser(result{1})
result = syn.knownUsers()

syn.setCurrentUser(result[0])

setCurrentTank

bSuccess = setCurrentTank(sTank)

Switches to the specified tank.

Note

The Auto Tank Naming option in the Preferences menu must be disabled for this to succeed.

Inputs Type Values
sTankPath string path to tank
Returns
bSuccess boolean 0 (fail), 1 (success)

Example

Set the tank name before the next recording.

nextTank = 'C:\TDT\SYNTANK';

syn.setMode(0)

syn.setCurrentTank(nextTank)

syn.setMode(3)

disp(syn.getCurrentTank())
nextTank = 'C:\\TDT\\SYNTANK'

syn.setMode(0)

syn.setCurrentTank(nextTank)

syn.setMode(3)

print(syn.getCurrentTank())

setCurrentBlock

bSuccess = setCurrentBlock(sBlock)

Switches to the specified block.

Note

Note that the Block Naming option in the Preferences menu must be set to Prompt for this to succeed.

Inputs Type Values
sBlock string block name
Returns
bSuccess boolean 0 (fail), 1 (success)

Example

Set the block name before the next recording.

nextBlock = 'MyBlockName';

syn.setMode(0)

syn.setCurrentBlock(nextBlock)

syn.setMode(3)

disp(syn.getCurrentBlock())
nextBlock = 'MyBlockName'

syn.setMode(0)

syn.setCurrentBlock(nextBlock)

syn.setMode(3)

print(syn.getCurrentBlock())

getSubjectMemos

cNotes = getSubjectMemos(sSubject)

Retrieves the log entries from the Synapse database for the specified subject. These can optionally be filtered by time using the STARTTIME and STOPTIME parameters which are formatted like %Y%m%d%H%M%S, e.g. May 22, 2020 9:53 am would be 20200522095300.

Inputs (MATLAB) Type Values
sSubject string subject name to search
STARTTIME double (optional) memo timestamp filter
STOPTIME double (optional) memo timestamp filter
Inputs (Python)
sSubject string subject name to search
startTime string (optional) memo timestamp filter
stopTime string (optional) memo timestamp filter
memoNum number (optional) return a single memo (1-based index)
startNum number (optional) memo number filter (nonnegative)
endNum number (optional) memo number filter (nonnegative)
Returns
cNotes cell array of filtered subject notes matching query parameters

Example

Retrieve specific notes from the Synapse database.

currSubject = syn.currentSubject()

allNotes = syn.getSubjectMemos(currSubject)

% get notes from 2019
filteredNotes = syn.getSubjectMemos(currSubject, 'STARTTIME',
    20190101000000, 'ENDTIME', 20191231235959)
currSubject = syn.currentSubject()

allNotes = syn.getSubjectMemos(currSubject)

# get notes from 2019
filteredNotes = syn.getSubjectMemos(currSubject,
    startTime='20190101000000', endTime='20191231235959')

getExperimentMemos

cNotes = getExperimentMemos(sExperiment)

Retrieves the log entries from the Synapse database for the specified experiment. These can optionally be filtered by time using the STARTTIME and STOPTIME parameters which are formatted like %Y%m%d%H%M%S, e.g. May 22, 2020 9:53 am would be 20200522095300.

Inputs (MATLAB) Type Values
sExperiment string experiment name to search
STARTTIME double (optional) memo timestamp filter
STOPTIME double (optional) memo timestamp filter
Inputs (Python)
sExperiment string experiment name to search
startTime string (optional) memo timestamp filter
stopTime string (optional) memo timestamp filter
memoNum number (optional) return a single memo (1-based index)
startNum number (optional) memo number filter (nonnegative)
endNum number (optional) memo number filter (nonnegative)
Returns
cNotes cell array of filtered experiment notes matching query parameters

Example

Retrieve specific notes from the Synapse database.

currExperiment = syn.currentExperiment()

allNotes = syn.getExperimentMemos(currExperiment)

% get notes from 2019
filteredNotes = syn.getExperimentMemos(currExperiment, 'STARTTIME',
    20190101000000, 'ENDTIME', 20191231235959)
currExperiment = syn.currentExperiment()

allNotes = syn.getExperimentMemos(currExperiment)

# get notes from 2019
filteredNotes = syn.getExperimentMemos(currExperiment,
    startTime='20190101000000', endTime='20191231235959')

getUserMemos

cNotes = getUserMemos(sUser)

Retrieves the log entries from the Synapse database for the specified user. These can optionally be filtered by time using the STARTTIME and STOPTIME parameters which are formatted like %Y%m%d%H%M%S, e.g. May 22, 2020 9:53 am would be 20200522095300.

Inputs (MATLAB) Type Values
sUser string user name to search
STARTTIME double (optional) memo timestamp filter
STOPTIME double (optional) memo timestamp filter
Inputs (Python)
sUser string user name to search
startTime string (optional) memo timestamp filter
stopTime string (optional) memo timestamp filter
memoNum number (optional) return a single memo (1-based index)
startNum number (optional) memo number filter (nonnegative)
endNum number (optional) memo number filter (nonnegative)
Returns
cNotes cell array of filtered user notes matching query parameters

Example

Retrieve specific notes from the Synapse database.

currUser = syn.currentUser()

allNotes = syn.getUserMemos(currUser)

% get notes from 2019
filteredNotes = syn.getUserMemos(currUser, 'STARTTIME',
    20190101000000, 'ENDTIME', 20191231235959)
currUser = syn.currentUser()

allNotes = syn.getUserMemos(currUser)

# get notes from 2019
filteredNotes = syn.getUserMemos(currUser,
    startTime='20190101000000', endTime='20191231235959')

appendSubjectMemo

bSuccess = appendSubjectMemo(sSubject, sMemo)

Adds a database entry linked to this specified subject, just as if the user typed it in the Logs dialog.

Inputs Type Values
sSubject string name of subject
sMemo string memo to timestamp and add to subject
Returns
bSuccess boolean 0 (fail), 1 (success)

Example

Add memo to current subject.

currSubject = syn.currentSubject()

syn.appendSubjectMemo(currSubject, 'Subject memo from MATLAB')
currSubject = syn.currentSubject()

syn.appendSubjectMemo(currSubject, 'Subject memo from Python')

appendExperimentMemo

bSuccess = appendExperimentMemo(sExperiment, sMemo)

Adds a database entry linked to this specified experiment, just as if the user typed it in the Logs dialog.

Inputs Type Values
sExperiment string name of experiment
sMemo string memo to timestamp and add to experiment
Returns
bSuccess boolean 0 (fail), 1 (success)

Example

Add memo to current experiment.

currExperiment = syn.currentExperiment()

syn.appendExperimentMemo(currExperiment, 'Experiment memo from MATLAB')
currExperiment = syn.currentExperiment()

syn.appendExperimentMemo(currExperiment, 'Experiment memo from Python')

appendUserMemo

bSuccess = appendUserMemo(sUser, sMemo)

Adds a database entry linked to this specified user, just as if the user typed it in the Logs dialog.

Inputs Type Values
sUser string name of user
sMemo string memo to timestamp and add to user
Returns
bSuccess boolean 0 (fail), 1 (success)

Example

Add memo to current user.

currUser = syn.currentUser()

syn.appendUserMemo(currUser, 'User memo from MATLAB')
currUser = syn.currentUser()

syn.appendUserMemo(currUser, 'User memo from Python')