Chapter 15 Apps (i.e. plug-ins)

Lets say a researcher begins a brand new research project and requires to analyze many RNAseq measurements. The researcher opens Tercen and proceeds to browse the Tercen library for a relevant workflow and eventually discovers a workflow template called “RNAseq” and installs it and voilà the research can begin. This is the concept of an app. An app is a sort of plug-in, just like an iPhone app.

There are currently three types of apps: template app (e.g. RNAseq), workflow app (e.g. two group comparison, PCA), and operator app (e.g. mean, PCA, t-test). Each app has an app version and is located in an app library.

The three types of apps including some examples are:

A template app is a type of template data analysis pipeline and it allows a researcher to start a complete standard analysis defined by the template (e.g. a RNAseq workflow, or a bioconductor workflow). The researcher would install a RNAseq workflow app from the Tercen library.

A workflow app is a mini workflow and allows a researcher to perform a set of computations and/or visualizations e.g. the researcher requires to perform a PCA including some automated visuals of the results. The researcher would install a PCA step app from the Tercen library.

A operator app performs a computation on the projection views in the cross-tab window (e.g. a PCA function) e.g. the researcher requires to perform a simple PCA without any automated visuals. The researcher would install a PCA operator app from the Tercen library. For a complete list of operators go to the operator catalog.

Typically a there is a hierarchy of apps where a template app contains workflow app and a workflow app contains operator app.

As an example, think of an RNAseq app template app in which there is a PCA workflow app and this in turn contains a PCA operator app.

App libraries

There is more than one app library. However the main publicly available library is called the Tercen app library. The other app libraries have different location and permission levels.

Library Location Permission level
Tercen app library tercen github Public
Site app library tercen server Site only
Team app library tercen team area Team only

A site is a Tercen server installed on a machine at an installation site.

A library consists of a set of apps and their versions.

Tercen app library:

All public Tercen operators and apps are found on the (tercen github)[https://github.com/tercen].

The contents of the public Tercen app library are found in a json file in github app library

The public operators and apps are also found on the Tercen area, see (https://github.com/tercen)

Installing apps

A researcher installs an app by sourcing it from any of the libraries (tercen app library, site library, team library) or from a git repository.

Structure of an operator app

A Tercen operator is composed of three main activities:

  • Getting the data
  • Operating on the data
  • Returning the results

A Tercen operator requires a Tercen data step in order to work. The operator is defined in a data step and the data step contains all that is necessary for the operator, namely structure data. The structure of the data becomes clear when you explore the table data structure of a data step. Go ahead and open a data step and you will notice three vertical tabs on the left of the window. The first tab is the default view is called the cross tab view. The other two are associated with data tables. For each data step there are two tables tabs:

  • Tables tab (i.e. the data input to the operator)
  • Computed tables tab (i.e. the data output of the operator)

Note: the Computed tables tab only appears when the data step has been computed (i.e. the data step has a green executed status)

Each table contains data as a result of the definition of the cross-tab view.

The Tables tab contain the following three tables:

  • Main table
  • Row table
  • Col table

The Main table contains the data to be used to compute in long format. Each row represents a value and the column names are a mixture of the the original table names and Tercen system column names. The Tercen system table names are there for the correct operation of Tercen and are automatically added by Tercen. They usually begin with a dot ., examples are:

.ri row index of data, represented by an integer

.ci col index of data, represented by an integer

Using these table column names you can see the structure of Tercen and how Tercen ‘thinks’.

The Computed tables only appears when the data step is computed. It contains the following the results of the computation.

If you are familiar with reading code then take some time to look at the operator code on the public tercen github. It gives a good outline on how operators are structured. Look at the file called main.R file. This is the key code for performing the operator.

Tercen R package

There is currently an R package in the tercen repository to help in creating R operators called teRcen. If you wish to use other programming languages then it is possible by using the Tercen API directly. The tercen R package is purely a wrapper package for the Tercen API.

Creating an operator app

The ability to create a new Tercen operator requires basic programming skills.

Here is the top-level development process to create an operator app:

  • Download and setup tercen studio
  • Write the operator (with tercen studio)
  • Deploy the operator (with tercen studio)

For further documentation regarding building operators. Please go the app builders guide.

Creating a workflow app

It is easy to create a workflow app. The first step is to create a Tercen workflow and the second step is to deploy it. There are two main methods of deployment.

The first method to deploy:

  • Make a workflow first
  • Save the workflow
  • Clone the workflow into the apps folder for your team
  • It is now available to your team members

The second method to deploy:

  • Make a workflow first
  • Save the workflow
  • Download the workflow (as zip) of the step app
  • Unzip the folder
  • Add README.md file
  • Add .gitignore file
  • Choose a repository name and add a suffice _app.
  • Create a git repository for the new workflow app
  • Upload the files to the new workflow app git repository

The workflow app can now be installed as any other operator from github.

Creating a template app

It is easy to create a template app. The first step is to create a Tercen workflow and the second step is to deploy it. There are two main methods of deployment. The first method makes it for you team members. The second method allows your template for any team wishing to use it.

The first is:

  • Make a workflow first
  • Save the workflow
  • Clone the worfklow into the templates folder for your team
  • It is now available to your team members

The workflow is now available for use for your Team.

The second is:

  • Make a workflow first
  • Save the workflow

It is straight forward to create a template app. The first step is to create a Tercen workflow and the second step is to deploy it. There are two main methods of deployment. The first method makes it for you team members. The second method allows your template for any team wishing to use it.

The first method to deploy:

  • Make a workflow first
  • Save the workflow
  • Clone the workflow into the templates folder for your team
  • It is now available to your team members

The template app is now available for use for your Team.

The second method to deploy is:

  • Make a workflow first
  • Save the workflow
  • Download the workflow (it downloads as .zip)
  • Unzip the folder
  • Add README.md file
  • Add .gitignore file
  • Choose a repository name and add a suffice _tmpl.
  • Create a git repository for the new template git repository
  • Upload the files to the new template git repository
  • Tag your repository

The template app is now available for installation for any Team.

The template app can now be installed as any other operator from github.

App examples

Operator app examples:

An operator app which performs computation follows either one of the following computing pattern :

  • per row
  • per col
  • per row and per col (i.e. per cell)

App versioning

In science, it is essential to reproduce the complete analysis you may have published many years ago. Tercen manages versions very tightly. This is particular important when you consider the three app layers in Tercen. Each layer requires versioning. Tercen manages the workflow and workflow apps using the metadata associated with both those apps. For operator apps written in R, it uses the renv package. renv makes sure when the researchers chooses to use an operators from the app library it uses exactly the same version of R packages used by the developer who developed the operator and uploaded it in the app library.