Skip to content

Getting started

Brian Wandell edited this page Jun 4, 2024 · 15 revisions

This wiki describes how to use the scitran client methods. It describes how to accomplish several tasks include

  • search for data and metadata
  • download and upload data and metadata
  • download-analyze-upload loop
  • launch jobs (Gears), check their status, and download their outputs

scitran is built on the FLywheel SDK, and thus the content of this wiki extends the Flywheel documentation. The Flywheel SDK commands are all available directly through the scitran object. The scitran object extends the Flywheel SDK by including methods that are written at a more abstract level. Examples are provided below.

Printing object information

This example illustrates the 'look-and-feel' of the scitran code. The first example identifies a group, the projects that are part of the group, and then prints them out

st = scitran('stanfordlabs');      % Connect to 'stanfordlabs'
group = st.lookup('wandell');      % Lookup a group based on its ID
projects = group.projects();       % Find the projects associated with this group
stPrint(projects,'label');         % Print out the project labels ...

Returns

Entry: label.
-----------------------------
	1 - BCBL_ILLITERATES 
	2 - Brain Beats 
	3 - CoRR 
	4 - EJ Apricot 
	5 - Graphics assets 
	6 - HCP 
	7 - HCP_preproc 
        ....

Using lookup

>> thisProject = st.lookup('wandell/HCP')    % This is the HCP project in the group 'wandell'

thisProject = 

  ResolverProjectNode with properties:

         public: []
          label: 'HCP'
           info: [1×1 flywheel.model.CommonInfo]
    description: ' ... .... '
          group: 'wandell'
             id: '57745645ce3b5900238d466c'
        parents: [1×1 flywheel.model.ContainerParents]
     infoExists: []
        created: 29-Jun-2016 23:14:13
       modified: 09-Nov-2018 05:30:55
      templates: []
    permissions: {16×1 cell}
          files: {3×1 cell}
          notes: []
           tags: []
       analyses: []

Using the 'find' methods

Use the several 'find' operators, which work with most Flywheel objects. In this case we find all the projects with the label 'HCP'.

>> group.projects.find('label=HCP')

ans =

  1×1 cell array

    {1×1 flywheel.model.Project}

The object thisProject has the project information. These Flywheel objects include methods that return information. In this case, we return a list of all the sessions that are part of the project

>> sessions = thisProject.sessions();
>> numel(sessions)

ans =

    31

To find a particular session, use this method

thisSession = thisProject.sessions.findOne('operator=David');

Or find a cell array of sessions within thisProject

thisSession = thisProject.sessions.find('group=wandell');

Or find the first session meeting the criteria, this way

thisSession = thisProject.sessions.findFirst('group=wandell');

Subject information

You might get information about all the subjects in a project

>> subjects = thisProject.subjects();
>> numel(subjects)

ans =

    30

Each subject object stores (potentially) a lot of information

>> subjects{1}

ans = 

  Subject with properties:

             id: '5abbb955032b6f00019a5813'
        project: '57745645ce3b5900238d466c'
         public: []
      firstname: []
       lastname: []
            age: []
            sex: []
         cohort: []
           type: []
           race: []
      ethnicity: []
        species: []
         strain: []
          label: '100307'
           code: '100307'
           tags: []
           info: [1×1 flywheel.model.CommonInfo]
          files: []
        parents: [1×1 flywheel.model.ContainerParents]
        created: 01-Jul-2016 00:40:13
       modified: 27-Nov-2018 13:17:11
    permissions: {15×1 cell}
          notes: []
     infoExists: 0
       analyses: []
Clone this wiki locally