Skip to content

Commit

Permalink
Updated visualization page
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhuBry committed Jan 2, 2024
1 parent 3ec2291 commit 3d64b55
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 22 deletions.
36 changes: 14 additions & 22 deletions website/docs/Guides/Visualization.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,30 @@
# Graph Visualization

By passing the ```--graphs-dir``` parameter and providing a directory where you want the graphs to be placed, Lancet will write deBruijn graphs for each window inspected and place them into the directory as dot files. NOTE: whichever directory is given as the graphs-dir will be cleared so be mindful of what directory you provide.
By passing the ```--graphs-dir``` parameter and providing a directory where you want the graphs to be placed, Lancet will write deBruijn graphs for each window inspected and place them into directories within the designated graphs directory. NOTE: whichever directory is given as the graphs-dir will be cleared so be mindful of what directory you provide.

```bash
lancet2 pipeline -t tumor.bam -n normal.bam -r ref.fasta --graphs-dir ./dot_graphs_dir
lancet2 pipeline -t tumor.bam -n normal.bam -r ref.fasta --graphs-dir ./graphs
```

The above command will export the DeBruijn graph at various stages of the assembly (low coverage removal, graph compression and traversal) to the following set of files:
The above command will create dbg_graph and poa_graph directories in the provided ./graphs directory. In the dbg_graph directory, you will find the dot files generated by the tool for each window. In the poa_graph directory, you will find the gfa graphs generated for each window along with an accompanying fasta file

1. chr:start-end_c0_raw_graph.dot
2. chr:start-end_cX_before_compression.dot
3. chr:start-end_cX_after_compression.dot
4. chr:start-end_cX_path_flow.dot

Where X refers to the connected component within the graph (in most cases only one).

These files can be rendered using the dot utility available in the [Graphviz](http://www.graphviz.org/) visualization software package.
## deBruijn DOT graphs
The dot files can be rendered using the dot utility available in the [Graphviz](http://www.graphviz.org/) visualization software package.

```bash
dot -Tpdf -o example_file.pdf example_file.dot
```

The above command will create a example_file.pdf file that shows the graph. For large graphs, Adobe Acrobat Reader may have troubles rendering the graph in which case we recommend opening the PDF file using the "Preview" image viewer software available in MacOS.

Below is an example of what the generated graphs may look like. The blue nodes are k-mers shared by both tumor and normal; the white nodes are k-mer with low support (likely sequencing errors); the green nodes are k-mers only present in the normal; the red nodes are k-mers only present in the tumor.:

The first image below shows the raw graph before removing the low coverage nodes.
![raw_graph](../../static/img/chr14_72547800-72548098_c0_raw_graph.png)
## GFA graphs
The generated gfa files can be viewed using the [Bandage-NG](https://github.com/asl/BandageNG) program.

The second image below shows the graph before compression and tip removal.
![before_compression](../../static/img/chr14_72547800-72548098_c1_before_compression.png)
By loading these gfa files directly into Bandage-NG and viewing the graphs, you get something that looks like this:
![raw_gfa](../../static/img/raw.png)

The third image below shows the graph after compression and tip removal.
![after_compression](../../static/img/chr14_72547800-72548098_c1_after_compression.png)

The fourth image below highlights all the assembly path flows taken through the graph.
![path_flow](../../static/img/chr14_72547800-72548098_c1_path_flow.png)
By adding an additional step of using the unchop command in the [vg](https://github.com/vgteam/vg) repository, the GFAs can be simplified such that nodes are combined by removing edges where doing so has no effect on the graph. Here is the general command for unchopping the gfa along with the resulting graph of the same window:
```bash
vg mod --unchop $INPUT_GFA > $OUTPUT_GFA
```
![unchopped_gfa](../../static/img/unchopped.png)
Binary file added website/static/img/raw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/static/img/unchopped.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3d64b55

Please sign in to comment.