2. Workflows

Typical workflows that explore the combinations of analysis possible in R2

2.2. Workflow: Marking samples in a YY or XY plot

  1. Marking a single sample

    With the ‘samples to mark’ option, you can make samples stand out. The easiest is marking a single sample using the R2 default setting. Make sure that you add a samplename (e.g. itcc0288) from the current dataset and press ‘redraw’. The indicated sample is now highlighted by an orange line.

_images/marksam_001.pngFigure 1: Mark a single sample

Figure 1: Mark a single sample

  1. Types of markings

    We can change the type of mark by changing the mark method from ‘dot’, to one of the other methods. ‘circle’ will draw an open circle around the sample; epicenter will draw a range of larger circles around the marked patient; and ‘arrow’ will place an arrow pointing to the sample.

_images/marksam_002.pngFigure 2: Mark options

Figure 2: Mark options

  1. Coloring and marking multiple samples

    Marking more than 1 sample is achieved by ’,’ separation (e.g. itcc0288,itcc0021,itcc0013,itcc0132). Thus far all have been of the same color. We can also change the color of the marker by adding ‘:’ followed by a hex color (e.g. itcc0288,itcc0021,itcc0013,itcc0132:00ff00).

_images/marksam_003.pngFigure 3: Mark and color multiple samples

Figure 3: Mark and color multiple samples

  1. Defining sample groups

    The previous example made all 4 samples green. We can also define groups and define different colors to every group. Groups are separated by ‘;’. To color our previous example with 2 groups, each having a different color, we define the following: itcc0288,itcc0021:ff00ff;itcc0013,itcc0132:00ff00

_images/marksam_004.pngFigure 4: Mark with sample groups

Figure 4: Mark with sample groups

  1. Advanced usage

    As a default, the mark method will be defined from the dropdown box as we have used in step 2. However, you can also define the method within the ‘samples to mark’ box by adding another ‘:’ after the color representation. Defining this will overrule the default setting, and thus also enable the use of different markings within the same figure. So the skeleton for advanced usage is : ‘sample1,sample2:color1:method1;sample3,sample4:color2:method2’. For example: ‘”itcc0288:0000ff:dot;itcc0021:ff00ff:arrow;itcc0013,itcc0132:00ff00:epicenter”’ creates the markings as shown in the figure.

_images/marksam_005.pngFigure 5: Mark with advanced options

Figure 5: Mark with advanced options


_images/R2d2_logo.pngDid you know box

R2 knows a couple of mark options, that you can make use of in the advanced prescriptions:
  • ‘dot’: places a thick border around the sample
  • ‘circle’: Places a ring around the sample (diameter 9)
  • ‘circle_2’: Places a ring around the sample (diameter 4)
  • ‘circle_3’: Places a ring around the sample (diameter 1), effectively a thin border
  • ‘epicenter’: Places a set of 3 rings descending in width around a sample
  • ‘arrow’: Places a block arrow pointing to the sample
  • ‘triangle’: Places a filled triangle under the sample
Note: The dotsize does not scale with ‘arrow’ and ‘triangle’ method.

2.3. Workflow: Drawing lines between samples in an XY plot

  1. Drawing a line between 2 samples

    To indicate a relation between different samples within a dataset it can sometimes be informative to add a line between samples. One can think of a pair for example, or perhaps a temporal relationship such as an on-off state or a time series. Within the XY plot of R2, we have a variable called ‘sample paths’, which can be used to add a line between samples. The easiest example, is to connect 2 samples within a plot. Using dataset ‘Mixed Neuroblastoma (MES-ADRN-Crest-Exp) - Versteeg - 52 - MAS5.0 - u133p2’, we can add a line between a pair of samples by putting ‘gsm2413241,gsm2413246’ in the sample paths input.

    gsm2413241,gsm2413246
    

_images/samplepath_001.pngFigure 1: Connect 2 samples

Figure 1: Connect 2 samples

  1. Path properties

    The appearance of the line can also be influenced by providing a color (hex number) and a linewidth. The recipe for these adaptations makes use of ‘:’ and works as follows. sample1,sample2:colorcode:width. Let’s give this a try by making the line red with a thickness of 3. Add ‘gsm2413241,gsm2413246:#ff0000:3’ to the path box.

    gsm2413241,gsm2413246:#ff0000:3
    

    _images/samplepath_002.pngFigure 2: path properties

Figure 2: path properties

  1. Drawing multiple paths

    We can draw multiple paths by separating them with ‘;’. Let’s give this a try by drawing a line between 4 pairs of samples in the current dataset in light grey. Add ‘gsm2413241,gsm2413246:#eeeeee; gsm2413239,gsm2413243:#eeeeee; gsm2413242,gsm2413245:#eeeeee; gsm2413240,gsm2413244:#eeeeee’ in the sample path box.

    gsm2413241,gsm2413246:#eeeeee; gsm2413239,gsm2413243:#eeeeee; gsm2413242,gsm2413245:#eeeeee; gsm2413240,gsm2413244:#eeeeee
    

    _images/samplepath_003.pngFigure 3: Connect 2 samples

Figure 3: Connect 2 samples

  1. Drawing multisample paths

    If the width and color of multiple samples can be the same, then you can also define longer paths by adding more samples in a row, by adding more samples, divided by a ‘,’. Lets give this a try by defining a time series within this dataset. Add ‘gsm2413257, gsm2413247, gsm2413248, gsm2413249, gsm2413250, gsm2413251, gsm2413252, gsm2413253, gsm2413254, gsm2413255, gsm2413256:#222222’ to the box.

    gsm2413257, gsm2413247, gsm2413248, gsm2413249, gsm2413250, gsm2413251, gsm2413252, gsm2413253, gsm2413254, gsm2413255, gsm2413256:#222222

_images/samplepath_004.pngFigure 4: Connect 2 samples

Figure 4: Connect 2 samples

  1. Drawing multisample paths

    We can also combine the 2 previous ones into 1 picture by addding ‘gsm2413241,gsm2413246:#eeeeee; gsm2413239,gsm2413243:#eeeeee; gsm2413242,gsm2413245:#eeeeee; gsm2413240,gsm2413244:#eeeeee; gsm2413257,gsm2413247,gsm2413248,gsm2413249,gsm2413250, gsm2413251,gsm2413252,gsm2413253,gsm2413254,gsm2413255,gsm2413256:#222222’ in the sample path box.

    gsm2413241,gsm2413246:#eeeeee; gsm2413239,gsm2413243:#eeeeee; gsm2413242,gsm2413245:#eeeeee; gsm2413240,gsm2413244:#eeeeee; gsm2413257, gsm2413247, gsm2413248, gsm2413249,gsm2413250, gsm2413251, gsm2413252, gsm2413253, gsm2413254, gsm2413255, gsm2413256:#222222

_images/samplepath_005.pngFigure 5: Connect 2 samples

Figure 5: Connect 2 samples

2.4. Workflow: Final Remarks

For description of many functions in R2, we have assembled a tutorial book, which can be found at r2-tutorials.