2. Make your own copy and edit it¶
Overview
Questions
- Can I change a dashboard someone shared with me?
- How do I add a figure, and keep it?
Objectives
- Duplicate a dashboard into a copy of your own.
- Open your copy in Edit mode and add a figure.
- Save it.
The shared dashboard almost suits you. You cannot change it, since others use it as it is. You make a copy: the copy belongs to you, and you are its owner. As a designer, you change the dashboard, never the data.
Hands-on 2 · Step 1: make your copy¶
- On Dashboards, open the ⋮ menu of nf-core/ampliseq and click Duplicate. The copy is made at once: nf-core/ampliseq (copy).
- Rename it with your first name. On the copy whose Owner is your e-mail, open ⋮, then Edit. In Dashboard Title, write for example
nf-core/ampliseq Ana, then Save Changes. Everyone who opens the project sees your copy in the list, read-only: with a name, you find yours.
Step 2: open it in Edit mode¶
Open your copy and click Edit, the pencil icon in the bottom toolbar.
Step 3: add a figure¶
- Click + in the bottom toolbar, then Component, New component and Figure.
- Pick the data collection ancombc_results, the differential abundance results, then Next Step.
- Set X axis to
lfc, Y axis toneg_log10_qvaland Color by tocontrast, then Create component. - The figure lands on the tab you are on: scroll to find it.
Prefer code? Edit your figure and switch to Code Mode: Depictio wrote the same figure as one line of Python. See the Bonus at the end.
Step 4: save¶
Click Save in the bottom toolbar. Every save is kept as a version of your dashboard; you go back to one on Day 2.
Check your understanding
Who owns nf-core/ampliseq (copy), and what happened to the shared nf-core/ampliseq when you added a figure? Did you change the data?
Answer
You own the copy, and only you can edit it. The shared dashboard is as it was, and so is the data: a designer changes a dashboard, never the data.
Challenge: read your figure
What does each point stand for, and where are the taxa that differ the most?
Solution
One point per phylum and contrast, each habitat against groundwater. The phyla that differ the most are high (small q-value) and far from 0 on x (large log fold change). This is a volcano plot: the Differential Abundance tab draws the same data.
Key points
- Duplicate a shared dashboard to change it: the copy is yours, the original stays as it was.
- A figure is a data collection plus a few choices (x, y, colour); Code mode gives the same in Python.
- Annotations, versions and Export (a dashboard as one HTML file that opens without a server) are on Day 2.
Bonus · More component types
Goal: add a table, two kinds of MultiQC plot, a card with several numbers and an advanced figure to your copy. Each one starts the same way: click +, then Component, then New component. Click the type you want: the page moves on to Data Source. Pick the data collection and click Next Step, then design the component and click Create component. The new component lands on the tab you are on: scroll to find it.
The list has ten types: Figure, Card, Interactive (filters), Table, MultiQC, Image, Map, Genome browser, Text (a heading or a note) and Advanced viz.
1. A table¶
- Click Table, pick the data collection
read_tracking(the reads kept at each step, one row per sample), then Next Step. - Open Display options: Striped rows and CSV export are on. Switch Compact rows on.
- Open Columns visibility and untick
depictio_run_id. - Click Create component.
2. Two kinds of
MultiQC component¶
Click MultiQC, pick the data collection multiqc_data, then Next Step. The Module list has General Stats Table, cutadapt, fastqc, nf-core-ampliseq-methods-description and nf-core-ampliseq-summary.
-
A summary of all samples. In Module, pick General Stats Table. There is no plot to choose: the tile shows General Statistics, one row per metric (trimmed bases, duplicates, GC, number of reads...) with one dot per sample. Click Create component.
-
One plot of one module. Add a second MultiQC component. In Module, pick
fastqc. Then in Plot, pick Per Sequence GC Content, and in Dataset, pick Percentages. One line per sample: the GC share of the reads. Click Create component.
The Plot list of fastqc has eleven plots, for example Sequence Quality Histograms, Adapter Content and Status Checks.
3. A card with several numbers¶
A card shows one value. A breakdown adds a strip with more numbers under it.
- Click Card, pick the data collection
read_tracking, then Next Step. - Under Value, write the Card title
Reads kept, median and range. In Select your column, pickkept_percent. In Select your aggregation method, pick Median. - Open Breakdown. In Multi-metric style, pick Vertical list (median / min / max).
- Open Display. For Style, click Accent. In Caption, write
over the 12 samples. In Decimals, write1. - Click Create component.
The big number shows 61.5 because of Decimals; the list keeps its own digits. Other choices you can try:
- Aggregation: Count, Distinct count, Sum, Average, Median, Min, Max, Range, Variance, Std deviation, Percentile, Skewness and Kurtosis.
- Multi-metric style: lists, a box plot, a histogram, a threshold, a gauge, a trend line, top-N bars, a donut and more.
- Style: Default, Headline, Compact, Minimal, Accent and Split.
- Link & help: Link to a tab makes the card open that tab when you click it.
- Colours & icon: background, title colour, icon and title size.
4. An advanced figure¶
Advanced viz holds ready-made figures for a type of result, such as a volcano plot. Depictio ranks them by how well they fit your data collection.
- Click Advanced viz, pick the data collection
ancombc_results, then Next Step. - Under Recommended for this data collection you see Differential-abundance bars (tool), Volcano plot, Parallel coordinates and Scatter (X/Y). Other visualisations has 45 more kinds. Click Volcano plot.
- Under Column bindings, the three required roles are already filled:
feature_idisid,effect_sizeislfcandsignificanceisq_val. The optional roles arelabel,category,p_valueandavg_log_intensity: leave them empty. - Click Create component.
The volcano plot counts the taxa that go up (UP: 54), go down (DN: 43) or do not change (NS: 80), and draws the labels of the strongest ones. On the dashboard, the Controls panel on its right sets the thresholds: p / padj (0.05) and |effect| (1).
Click Save to keep your new components.
Bonus · The same figure as code (Python, optional)
Goal: build a richer figure with clicks, then read it as one call of Plotly Express.
A richer figure¶
- Click +, Component, New component and Figure. Pick
ancombc_results, then Next Step. - Set X axis to
lfc, Y axis toneg_log10_qvaland Color by tocontrast. Stay in UI Mode. - Open Styling & Layout. Set Hover title to
Phylum. In Hover fields, pickq_valandKingdom. - Open Advanced Options. Set Facet columns by to
contrast. - Open Scatter Plot Options. Set Size by to
se(the standard error of the log fold change).
You get one panel per contrast, and a bigger dot where the estimate is less sure. Point at a dot: the tooltip shows the phylum, then contrast, lfc, neg_log10_qval, se, q_val and Kingdom.
Read it as code¶
-
Above the form, click Code Mode. Depictio wrote your settings as Python:
-
Read it.
px.scatterdraws the dots, anddfis your data collection. Hover title becamehover_name, Hover fields becamehover_data, Facet columns by becamefacet_coland Size by becamesize. -
Click Execute Code to run it. Code runs on the server, and only for editors of the project. If you are a viewer, you see this message instead, and your UI Mode figure is not affected:
Good to know: Depictio writes the code the first time you open Code Mode on a figure. Set the options first, then switch. A later change in UI Mode does not rewrite code you already have.
Challenge (optional): two more arguments
Make a new figure with lfc, neg_log10_qval and contrast like above. In Styling & Layout, write a Title and set an Opacity of 0.6, then open Code Mode. Which two arguments did Depictio add?














