Skip to content

Commit

Permalink
docs update with vamp-seq example and cross refs
Browse files Browse the repository at this point in the history
  • Loading branch information
nickzoic committed Apr 3, 2024
1 parent 691d9a7 commit ad7eb4c
Show file tree
Hide file tree
Showing 5 changed files with 365 additions and 22 deletions.
47 changes: 47 additions & 0 deletions docs/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/* little overrides to vanilla.css */

body {
max-width: 120ch;
}

div.navbar {
display: block;
border-bottom: 2px solid var(--tertiary-color);
}

dt {
font-weight: bold;
}

table code {
border: none;
background: none;
}

table th code {
font-weight: bold;
}

@media (min-width: 48em) {
.content {
max-width: 38rem;
margin-left: 18rem;
margin-right: 2rem;
}
.sidebar {
max-width: 16rem;
position: fixed;
}
}

@media (min-width: 64em) {
.content {
margin-left: 22rem;
margin-right: 2rem;
}
.sidebar {
max-width: 20rem;
position: fixed;
}
}

189 changes: 189 additions & 0 deletions docs/css/vanilla.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
/* VANILLA.CSS from https://vanillacss.com/ . Thanks Bradley! */

/* Reset */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}

* {
box-sizing: border-box;
}

/* Variables */
:root {
--desktop-font-size: 1.2rem/1.55;
--mobile-font-size: 1rem/1.45;
--text-color: #2d2d2d;
--link-color: blue;
--link-color-alt: darkblue;
--primary-color: lightsteelblue;
--secondary-color: aliceblue;
--tertiary-color: whitesmoke;
}

/* Typography */
body {
color: var(--text-color);
margin: 0 auto;
max-width: 75ch;
padding: 0 0.5rem;
}
body, input {
font: var(--desktop-font-size) -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto, Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji", "Segoe UI Symbol";
}

h1,h2,h3,h4,h5,h6,p,blockquote,dl,img,figure {
margin: 2rem 0;
}

h1,h2,h3,h4,h5,h6 { font-weight: bold; line-height: 1.2; }
h1 { font-size: 200%; }
h2 { font-size: 150%; }
h3 { font-size: 120%; }
h4,h5,h6 { font-size: 100%; }
h5, h6 { text-transform: uppercase; }

header h1 { border-bottom: 1px solid; }

a,a:visited { color: var(--link-color); }
a:hover,a:focus { color: var(--link-color-alt); }

strong, time, b { font-weight: bold; }
em, dfn, i { font-style: italic; }
sub { font-size: 60%; vertical-align: bottom; }
small { font-size: 80%; }

blockquote, q {
background: var(--secondary-color);
border-left: 10px solid var(--primary-color);
display: block;
font-family: "Georgia", serif;
padding: 1rem;
}
blockquote p:first-child { margin-top: 0; }
blockquote p:last-child { margin-bottom: 0; }
cite {
font-family: "Georgia", serif;
font-style: italic;
font-weight: bold;
margin-top: 1rem;
}

kbd,code,samp,pre,var { font: var(--mobile-font-size) monospace; }
code, pre {
background: var(--tertiary-color);
border: 1px solid;
overflow: auto;
padding: 0.25rem 0.5rem;
}
code pre , pre code { border: 0; padding: 0; }

/* Elements */
hr {
background: var(--text-color);
border: 0;
height: 1px;
margin: 4rem 0;
}

img {
display: block;
height: auto;
max-width: 100%;
}

figure {
border: 1px solid var(--primary-color);
display: inline-block;
padding: 1rem;
width: 100%;
}
figure img { margin: 0 auto; }
figure figcaption { font-size: 80%; margin-top: 0.5rem; text-align: center; }

ul, ol { margin: 2rem 0; padding: 0 0 0 2rem; }
ul li, ol li { margin-bottom: 1rem; }
li > ul, li > ol { margin: 0.25rem 0 0.5rem; padding: 0 0 0 2rem; }
li > ul li, li > ol li { margin-bottom: 0.5rem; }

dl dd { padding-left: 2rem; }

table {
border: 1px solid var(--primary-color);
border-collapse: collapse;
table-layout: fixed;
text-align: left;
width: 100%;
}
table caption { margin: 2rem 0; }
table tr { border-bottom: 1px solid var(--primary-color); }
table thead { position: sticky; top: 0; }
table tbody tr:nth-child(even) { background: var(--tertiary-color); }
table th { background: var(--secondary-color); font-weight: bold; }
table th, table td { padding: 0.5rem; }

input {
appearance: none;
border: 1px solid var(--text-color);
display: block;
margin: 0.5rem 0;
padding: 0.8rem;
}
input:focus, input:active { background-color: var(--secondary-color); border-color: var(--link-color); }

sup { font-size: 80%; vertical-align: top; }

/* Mobile Styling */
@media screen and (max-width: 75ch) {
body, input {
font: var(--mobile-font-size) -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto, Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji", "Segoe UI Symbol";
}
table { table-layout: auto; }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
body {
background: #191919;
}
input:focus, input:active {
background-color: var(--text-color);
color: var(--secondary-color);
}
table,
table tr,
table th:not(:last-of-type),
table td:not(:last-of-type) {
border-color: var(--text-color);
}
table thead th,
table tfoot th {
background-color: var(--primary-color-light);
}
:root {
--text-color: #fff;
--link-color: orange;
--link-color-alt: yellow;
--primary-color: orange;
--primary-color-light: dimgrey;
--secondary-color: black;
--tertiary-color: #2d2d2d;
}
}
60 changes: 38 additions & 22 deletions docs/getting-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ time point.

[![Example 1 Image 2](img/example_1_2.png)](img/example_1_2.png)

The "Group By" tool lets us specify some columns to index by.
The [Group By](../included-plugins/#group-by) tool lets us specify some columns to index by.
If no other operations are selected, it will count the number of
rows corresponding to each index value, and put this into a
column called "count".
Expand All @@ -84,7 +84,7 @@ column called "count".
We've now got separate counts for each sequence at each time point,
but we want to compare counts for each sequence across the time points.

To do this, we use the Pivot Tool:
To do this, we use the [Pivot Tool](../included-plugins/#pivot-tool):

[![Example 1 Image 3](img/example_1_3.png)](img/example_1_3.png)

Expand All @@ -106,15 +106,15 @@ one by the other:

[![Example 1 Image 4](img/example_1_4.png)](img/example_1_4.png)

The Python Code tool lets us write small expressions in Python and
The [Python Code](../included-plugins/#python) tool lets us write small expressions in Python and
apply them to each row of the table. In this case we're calculating
score as the fraction of sequences which have survived from time 1
to time 2.

### 5. Saving Results

Now we have a score for each sequence, we need to write our data
out somewhere. The CSV Save tool lets us save our output in a
out somewhere. The [CSV Save](../included-plugins/#csv-writer) tool lets us save our output in a
CSV file for easy use elsewhere.

[![Example 1 Image 5](img/example_1_5.png)](img/example_1_5.png)
Expand Down Expand Up @@ -155,23 +155,17 @@ AGGGCCGTGCCAAGTGCAGT,ATGCTTTGTACGGGTGGTGCCCTGGCTTATCTATCTAGATCCGTCTCCGAGTCACGGTC
TGTAGTGCCGTATTTGTGGC,ATGCTTTGTACGGGTGGTGCCCTGGCTTATCTATCTAGATCCGTCTCCGAGTCACGGTCGAATTTAGGTACTGCACTATCCTTTGAGGCAGGAAGGGCCACAAGGGCCGACCCTTGTCGGATAAAATTTGCTAAGAGGAAGGTCTAG
```

### Reading Sequences

First, we modify our reading and grouping steps to rename the sequence column to `barcode`,

[![Example 2 Image 1](img/example_2_1.png)](img/example_2_1.png)
<!--
[![Example 2 Image 2](img/example_2_2.png)](img/example_2_2.png)
-->

### Reading the Barcode File

We can read the barcode file using the CSV Loader:
We can read the barcode map using the [CSV Loader](../included-plugins/#csv-reader:

[![Example 2 Image 3](img/example_2_3.png)](img/example_2_3.png)

### Joining the Barcode File

Now we add in a Join tool, which joins the two tables using the `barcode` column.

[![Example 2 Image 4](img/example_2_4.png)](img/example_2_4.png)
Expand All @@ -193,7 +187,7 @@ the longer `sequence` column.
Load this example with `countess_gui example_3.ini`.

Working with long sequences is a bit unwieldy: it'd be handy
to be able to process these in a more compact format. The "Variant Translator"
to be able to process these in a more compact format. The [Variant Translator](../included-plugins/#variant-caller)
plugin lets us compare a sequence to a reference sequence and extract
DNA and Protein variants in [HGVS](https://hgvs-nomenclature.org/stable/) format.

Expand All @@ -204,7 +198,8 @@ DNA and Protein variants in [HGVS](https://hgvs-nomenclature.org/stable/) format
[![Example 3 Image 4](img/example_3_4.png)](img/example_3_4.png)
-->

We configure the Variant Translator with our known reference sequence:
We add a Variant Translator to our project, and configure it with
our known reference sequence:

```
ATGCTTTGTACGGGTGGTGCCCTGGCTTATCTATCTAGATCCGTCTCCGAGTCACGGTCGAATTTAGGTACTGCACTATCCTTTGAGGCGGGAAGGGCCACAAGGGCCGACCCTTGTCGGATAAAATTTGCTAAGAGGAAGGTCTAG
Expand All @@ -217,34 +212,55 @@ and even more of the Protein variants turn out to be synonymous (`p.=`).

[![Example 3 Image 5](img/example_3_5.png)](img/example_3_5.png)

### Duplicating Output

#### Pivoting
From here, we perform the same pivot, score and write to CSV steps as
before, but duplicated for both DNA and Protein variants.

<!--
[![Example 3 Image 6](img/example_3_6.png)](img/example_3_6.png)
[![Example 3 Image 9](img/example_3_9.png)](img/example_3_9.png)

#### Scoring

[![Example 3 Image 7](img/example_3_7.png)](img/example_3_7.png)
[![Example 3 Image 10](img/example_3_10.png)](img/example_3_10.png)

#### Writing CSV

[![Example 3 Image 8](img/example_3_8.png)](img/example_3_8.png)
[![Example 3 Image 11](img/example_3_11.png)](img/example_3_11.png)
-->

## Example 4: FASTQ and Vamp-Seq

Load this example with `countess_gui example_4.ini`.

In the previous examples, we've loaded sequence data from CSV files, but
[FASTQ](https://en.wikipedia.org/wiki/FASTQ_format) files are a more common format
for sequence data and we can read these with the [FASTQ Reader](../included-plugins/#fastq-load)

The CSV files had a convenient `time` column for us to use, but our example
FASTQ files do not. We could work around this by using eight FASTQ loaders,
one for each file, but instead what we can do is select the "Filename Column?" option
in the FASTQ Loader which will add an extra `filename` column in to the
dataframe:

[![Example 4 Image 1](img/example_4_1.png)](img/example_4_1.png)

We can then use the [Regex Tool](../included-plugins/#regex-tool) to break this filename down into its
useful parts, extracting `bin` and `rep` columns from the filename.

[![Example 4 Image 2](img/example_4_2.png)](img/example_4_2.png)
<!--
[![Example 4 Image 3](img/example_4_3.png)](img/example_4_3.png)
[![Example 4 Image 4](img/example_4_4.png)](img/example_4_4.png)
[![Example 4 Image 5](img/example_4_5.png)](img/example_4_5.png)
-->

We can then [pivot](../included-plugins/#pivot-tool) on `bin`, giving us columns
`count__bin_1`, `count__bin_2`, `count__bin_3` and `count__bin_4`:

[![Example 4 Image 6](img/example_4_6.png)](img/example_4_6.png)

That's enough to calculate a score for each protein variant:

[![Example 4 Image 7](img/example_4_7.png)](img/example_4_7.png)

<!--
[![Example 4 Image 8](img/example_4_8.png)](img/example_4_8.png)
[![Example 4 Image 9](img/example_4_9.png)](img/example_4_9.png)
-->

3 changes: 3 additions & 0 deletions docs/included-plugins/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ The "required" flag on the input datatables lets you select the type of join:

### Regex Tool

> "Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems."
> -- Jamie Zawinski
Splits a string value into multiple parts using a regular expression.

Specify a pattern to match and columns to output the matching parts to.
Expand Down
Loading

0 comments on commit ad7eb4c

Please sign in to comment.