Organizing Data into a Study View

A nicely-organized study. The study is expressed as a JSON file, which contains one single object. To debug JSON, try

Example study:

    "name":"example study",
        "name":"DNA mutation"

Study attributes are listed below, they are case-sensitive.


Name of the reference genome, e.g. hg19 or hg38


The name of this study/cohort.

Assay, tracks, and genome browser

Assays, tracks, and genome browser


Declares all assay names. Example:

   "assays":["H3K4me3","RNA-seq","Splice junctions"],
        ... ... 
        ... ... 
   "Splice junctions":{
        ... ... 
  • Assay names can be arbitrary words e.g.

    • "H3K4me3"

    • "RNA-seq"

    • "Splice junctions"

    • Do not use reserved words such as "assay" or "genome"

  • Assay names are case-sensitive

  • Each name should appear as an attribute in the study.

  • Each assay is a set of tracks, organized by "individual" → "sample type" → track list

    • There can be one or more "sample type" for an "individual"

    • In case this is not applicable e.g. for cell lines, use cell line name for both individual and sample type (the hierarchy is hardcoded...)

    • For each sample type, there can be one or multiple tracks associated with it

      • If one track, the value is an object

      • If multiple tracks, the value is an array of track objects

  • Tracks in one assay should be the same type. Supported types:

    • bigWig

    • Splice junction

    • VCF

    • Allelic imbalance (todo)

  • Assay tracks can be presented in a sample-by-assay matrix, so called "facet table". The facet table can be generated by default, and can be customized. See section on facet table.

bigWig tracks

Declare an assay type for the bigWig track, e.g.:

    "config": {
            "type": "bigwig",
            "pcolor": "red",
            "height": 70,
            "scale":{   "max":500,   "min":0   }
    "patient1": {
            "sampletype1": {
                     "file": "path/to/",
            "sampletype2": [
                 ... a list of tracks ... 
            .... more sample types
    ... more tracks
  • config : { }

    • config.type value must be "bigwig"

    • The rest of config contains type-specific configurations that will be applied to every track in this assay. See below link for all available options.

  • [ Patient name ]

    • Name of the patient/individual, value is a hash of types of samples from this patient

    • Note that the 2-level patient-sampletype arrangement is hard-coded and applies to any type of assay.

  • [ Sample type ]

    • Value could be an object or an array of objects

      • Each object is a track
    • The track object should contain "file" or "url" to point to the source of the track file

    • The track object can contain any configurations and will override the ones in "config".

Read bigWig track configuration options.

Splice junction tracks

Declare an assay type for the junction tracks, e.g.:

    "config": {
            "type": "junction",
                 "known":{"color":"#9C9C9C", "label":"Known"},
                 "novel":{"color":"#cc0000", "label":"Novel"}
    "patient1": {
            "sampletype1": {
                 "file": "path/to/RNA-patient1-sampletype1.gz"
            .... more sample types
    ... more tracks
  • Config.type value is "junction"

  • Config.categories lists types of junctions and their rendering colors

Read junction track configuration options.

Read junction file format.

VCF tracks

Declare an assay type for the VCF tracks, e.g.:

    "config": {
            "type": "vcf"
    "patient1": {
            "sampletype1": {"file": "path/to/patient1-sampletype1.vcf.gz"},
            .... more sample types
    ... more tracks

VCF format specification

Additional requirements on the VCF format in ProteinPaint

Assay of AI (allelic imbalance) tracks


Assay of positional annotation tracks


In JSON-BED format

E.g. called peaks ...

Facet tables

To define what samples and assays are to be used in making a facet table, use the "trackfacets" attribute.

The value is an array, where each element defines one facet table. This way it allows multiple facet tables to be defined.

       "name": "name of this table",
       "samples": [  "sample1", "sample2", ],
       "assays": [ "assay1", "assay2" ],

   ... additional facet tables ... 



Will launch a browser and show some tracks over the given position in the genome.

    "position":{ "chr":"chr10", "start":8081012,  "stop":8103311 },
        { "assay":"assayname1", "level1":"patientname" },
        { ... another track finder ... }
         { ... track 1 ... },
         { ... track 2 ... }
  • browserview.position

    • Optional. If not provided, will use default position of the genome.

    • Value can be string or object:

      • { chr:"...", start:..., stop:...}

      • "chr1:12345-67890"

    • Coordinates are 0-based

  • browserview.nativetracks

    • Specify what "native" tracks to be loaded by default, usually the gene track. Check with your ProteinPaint server to find out what tracks are available "natively" for that genome.

    • Value can be:

      • A string of track name

      • A string of multiple track names, joined by comma, no space

      • An array of track names

    • Track names should match with what's specified for the tracks of that genome, but case-insensitive

    • TODO: allow customizations

  • browserview.assays : { }

    • Optional. To show all tracks from specified assays.

    • If you don't want to show all tracks of an assay, use "assaytracks" attributes instead (see below)

    • Value is an object. Keys are assay names, and the name must exist in the "assays" array.

    • Value to each assay can vary. In above example:

      • By using value "1", all tracks from "rna_seq" will be displayed as separate tracks.

      • By using value {"combined":1}, all tracks from this assay type will be aggregated into one track. This only applies to these track types:

        • Junction

        • VCF

  • browserview.defaultassaytracks : [ {} ]

    • Optional. To select a set of tracks from the assays defined in this study, and show them by default.

    • Each element is a "track finder", with these attributes to pinpoint the track:

      • "assay":""

        • The assay name, required.
      • "level1":""

        • Patient name, but here it's a generic name. Required.
      • "level2":""

        • Optional, the sample type. If specified, will use track from only this sample type of the patient as specified by "level1". Else, it will use all tracks from this patient.
  • browserview.tracks : [ ]

    • Optional. To provide a list of custom tracks.

    • Custom tracks defined as JSON objects, see JSON format of tracks.

    • This allows adding tracks in freedom, directly encoded, rather than systematic way of "assays". Such tracks are not associated with any assay type and won't show up in facet table.

Mutation data in tabular format


Lists all mutation datasets for this cohort, and the mutation data files associated for each set.

        "name":"DNA somatic",

This example provides two sets of mutation for a cohort from both DNA and RNA, as indicated in the name. The name can be arbitrary string. In each dataset, different types of mutations are provided in the form of separate text files.

The "datadir" from above example is relative to the ROOT directory.

Mutation data type keys, each should point to a server-hosted text file.

  • snvindel

  • sv

  • fusion

    • Structural variation OR fusion, they are in the same tabular text format

    • Note that "sv" is used in "DNA", and "fusion" is used in "RNA-seq"

  • svfusion

    • JSON format data for sv/fusion/ITD/deletion/truncation, format is the same as the JSON file made by fusion editor export.
  • cnv

  • deletion

  • truncation

  • Variant_gene_assoc

    • No longer supported!!

    • For describing genes associated with particular variants

    • Per-sample based: each line is one variant from one sample.

    • This will trigger a browser view for exploring variant and genes together.

    • 7 columns:

      i. Chromosome

      ii. Position

      iii. Reference_allele

      iv. Mutant_allele

      v. Patient

      vi. Sampletype

      vii. geneset

    • The "geneset" is a JSON array, representing associated genes from each sample, example:

      i. [{"name":"TAL1","isoform":"NM_003189","position":"chr1:47681961-47698007","score_1":0.543,"score_2":0.543}, {... second gene ...} ]


It provides a gene-level expression values over a group of samples from a database table on the server, and show it when the gene is shown in the protein-view.

"Dbexpression" should work with "mutationset".

    "tablename":"[name of the table]",
    "keyname":"[name of the table field to query against, e.g. gene]",
    "tidy":"function(rows){rows.forEach(function(row){ ... })}",
  • dbexpression.dbfile

    • Path to the SQLite database file. Must be relative to the directory.
  • dbexpression.tablename

    • Name of the database table to query against with
  • dbexpression.tidy

    • Provides a Javascript function in the form of a string, argument is an array of all records fetched from the database, the function will apply certain tidying operation on each of the record
  • dbexpression.attrlst

Note that the db table can contain data for samples that are not from this cohort, and they will still be displayed in the expression data panel.

Gene-sample heatmap


An JSON object that configures the heatmap layout. Refer to heatmap configuration tutorial.


Provides one or more "hard-coded heatmap".


File format:

  • Columns are samples

  • Rows are items (e.g. genes, or other attributes describing samples)

  • First line is header

    • First column is metadata keys, the value must be found as one of the keys in hardcodemap.metadata

    • Second column is row name

  • Cell value is one of the values of each key (of that row). Join multiple values by semicolon.

Metadata annotation

(under development)


An object to define metadata annotation at patient level.

This should also be used when there is only information on samples but not patients (in which case sample name/id should be expressed at "patient" level).

patientannotation.annotation provides actual annotation of each patient/sample.

patientannotation.metadata provides the list of metadata terms, and attributes associated with the term.


                ... more patients ... 

   "label":"Age at diagnosis",
      "label":"Child (<10yrs)",
      "label":"Adult (>18yrs)",
   ... more terms ... 

Such metadata annotation can be applied to:

  • Expression - PCA plot

  • Splice junction track (TODO)


An object to define metadata annotation by input file.

.idkey "STRING"

The column value, typically "sample" or "samplename", to use for collecting annotations into an object

.files [ARRAY]

An array of string filepaths to use as metadata source data

inputFormat "STRING"

Indicates the format for parsing the source file, defaults to "metadataTsv"

Expression - PCA plot


A list of plots to be made, each defines an "expression - PCA" plot.

More on Expression PCA plot.

"e2pca": [
      "name": "optional name of this plot",
      "vectorfile": "path/to/vectorfile.txt",
      "dbfile": "path/to/data.db",
    ... one more plot ... 

Other controls


An object of possible configurations to the disease-gene sankey diagram.

Use sankey.genes:[] to define a set of genes to be used in the diagram:

        {"name":"MYCBP2","color":"red"}, ....

Use sankey.geneset:[] to define gene sets to be used in the diagram, all genes in a set share the same color, legend will be rendered:

            {"name":"gene set 1",
            {"name":"gene set 2","color":"blue","genes":[ ...... ]}


An object to define rendering color for different diseases. Applies to sankey diagram and gene network chart.


To provide one or more gene network diagrams.

          { a JSON object representing a network },
          { one more network }

Each network is defined as a JSON object, see example.


Will not apply the genome-equipped gene set to generate the heatmap view, but rather, to use highly recurrent genes based on the data:

  • Max 20 genes, all in one group.


Will show the gene table by default. Only applicable when "mutationset" is used. Value is "1" for true.


Will show the sample table by default. Value is "1" for true.

Samples can come from either "mutationset", or assays.


Will hide the sample table.


Will show the heatmap by default. Value is "1" for true.


Will show the genome browser by default. Value is "1" for true.


Will show the hard-coded heatmap by default.


Will show the expression - PCA plots by default.


Will hide the gene network function.


Will hide the "+NEW FILE" tab.


Will hide all navigation buttons on the left.


Will replace the default "individual" with the given word in the "# individuals" tab on left of the study view.

Obsolete contents



The rest of these contents are obsoletse. We're busy porting them to the new ProteinPaint.

Attribute: aicheck (moved to "assays")

This is the "aicheck" track.

This is the integrative display of allelic frequency imbalance of variants or genetic markers, as well as DNA sequencing coverage over these markers. Adapted from the "aicheck" figure invented by Xiaotu Ma.

Note that this is designed for tumor-normal matched paired samples only.

"aicheck": {
    "20-PABLDZ": {
      "sampletypes": [
      "relapse": {
        "file2": "aml/ai_check_SJBALL013790_R1_G1.txt.gz",
        "readdepthcutoff": 126
      "diagnosis": {
        "file": "aml/fullMaf_TARGET-20-PABLDZ-09A-02D_NormalVsPrimary.maf.txt.gz",
        "readdepthcutoff": 126
    "patient2":{ ... },
    ... more patients ... 

The "samplekeys" is an array of sample type. This is a relic of initial design and will be abandoned. By then it will be ignored by ProteinPaint.

There are two file formats for aicheck, identified by "file" and "file2". "file2" format comes right off the CompBio pipeline (generated by one of Xiaotu's script).

"file" columns

  1. chromosome name, must be "chr1" but not "1"
  2. coordinate, 1-based
  3. MinD: mutant allele read count in tumor DNA
  4. TinD: total read count in tumor DNA
  5. MinN: mutant allele read count in normal DNA
  6. TinN: total read count in normal DNA

"file2" columns

  1. chromosome name, must be "chr1" but not "1"
  2. coordinate, 1-based
  3. SNP, value seems always is "SNP"
  4. rsNumber: dbSNP name
  5. TinD: total read count in tumor DNA
  6. dMAF: mutant allele frequency in tumor DNA
  7. TinN: total read count in normal DNA
  8. nMAF: mutant allele frequency in normal DNA

The "readdepthcutoff" value defines the Y-axis max value of read depth track for both tumor and normal. It is pre-calculated by following Xiaotu's method below. User is free to use any other method.

######## to calculate trimmed media, in 1% to 99% range
trimed.median<-function(xx) {
  if(sum(xx>dnn & xx<upp)>2) {
    use<-(xx>dnn & xx<upp)
  if(medd.D<1) medd.D<-1
  if(medd.G<1) medd.G<-1

Broadly, there are two types of tracks that ProteinPaint can read: numerical, and positional. Bedgraph and bigWig are numerical track formats, the generic bed is the positional format.

In the cohort definition, you have to first declare what the tracks are about, then the type/format of the track. The first layer is assay type, like RNA-seq, or it can be anything with a name. We will refer to it as "assay type".

Assay types are predefined, allowed values are (case-sensitive):

  • rnaseq

Each assay type must be declared as a hash, with patient names as keys. Patients from different assay types may or may not be the same.

There is always a reserved key called "config", providing configurations applicable to all tracks of this assay type. Each track can have its own configurations in order to be different from the "global" attributes in config.

Numerical track Y-scale configuration

  • percentile

    • Value is positive integer from 1 to 99

    • If provided, the nth percentile value in the view range will be used to set Y-axis. This is useful for preventing large outlier values from skewing the display.

    • When there are both positive and negative values in the view range, the percentile calculation will be applied separately to positive and negative values for calculating max and min values.

  • min, max

    • When valid values are provided for both, will set fixed scale.
  • autoscale

    • Apply auto-scale, will override percentile or min/max settings.

File or URL?

Track: bedGraph

bedGraph track example for RNA-seq

        "name":"RNA-seq coverage",
    "patient1": {
    "patient2": { ... },
    ... more patients ... 

Track: bigWig

bigWig example for RNA-seq

        "name":"RNA-seq coverage",
    "patient1": {
    ... more ...  

Track: numeric2 (a pair of numerical tracks)

Overlaying of two numerical tracks, noted by "track1" and "track2".

  • Track 1

    • Displayed on foreground, axis on left
  • Track 2

    • Displayed on background, axis on right

rnaseq coverage-FPKM overlay example

    "patient1": {
    "patient2": { ... },
    ... more patients ... 

Track: junction (RNA-seq junction reads)

junction example, along with a "browserview" trigger for displaying

"junction": {
"30-PAIFXV": {
    "diagnosis": {
    "file": "junction/targetNBL/30-PAIFXV-diagnosis-SJNBL017066_D1.gz"
"30-PAIPGU": {
    "diagnosis": {
    "file": "junction/targetNBL/30-PAIPGU-diagnosis-SJNBL017070_D1.gz"
    "position":{ "chr":"chr12","start":25357723,"stop":25403865    },

Each junction track file contains splicing junctions identified in ONE SAMPLE only. Primarily this is converted from the RNApeg output (

To convert an RNApeg output file into a track file to be displayed on ProteinPaint, run:

node utils/rnapegjunction2tabix.js sample.RNApeg.output sample.junction

The converted file has 5 columns:

  1. Chromosome name, e.g. "chr1"

  2. Start, 1-based position of the last exon nucleotide

  3. Stop, 1-based position of the first exon nucleotide

  4. Number of (high-quality) junction reads

  5. Type of junction

    a. RNApeg outputs two types of junction (known/novel). For displaying, arbitrary types can be used. Any used types should be stated in the config.jtype2color so they can be distinguished by color

Track: VCF

VCF examples, along with "browserview" trigger for displaying


"Vcf_cohort" specifies one single VCF file.

"Vcf" specifies the VCF file from each sample.

Track: vafs1 (variant allele fraction of a single sample)

vafs1 example

  ... next person ... 

Track file has 6 columns:

  1. Chromosome

  2. Position (1-based)

  3. Reference allele

  4. alternative allele

  5. Total reads

  6. Variant allele fraction

Note that for one sample type, there can be multiple types of tracks (DNA/RNA in above example). The type names can be arbitrary.

Track: BAM

In progress ...