Skip to content

Commit

Permalink
Add more readme videos
Browse files Browse the repository at this point in the history
  • Loading branch information
RagnarGrootKoerkamp committed Mar 27, 2024
1 parent f81bf74 commit 28f1fb5
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 6 deletions.
10 changes: 7 additions & 3 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ An alignment of two sequences of length 500 with 30% error rate using A*PA:

[[file:imgs/readme/layers.gif]]

- Citations ::
For A*PA, re recommend reading the bioRxiv version which directly includes the
An alignment of two sequences of length 10'000 with 15% error rate using A*PA2:

[[file:imgs/readme/astarpa2.gif]]

- Papers ::
For A*PA, we recommend reading the bioRxiv version which directly includes the
supplement and has better formatting. But please cite the Bioinformatics version!
- A*PA BioRxiv preprint:

Expand Down Expand Up @@ -152,7 +156,7 @@ comparable due to differences in visualization strategies (cell vs layer updates
|----------------------------------------------------------------------+----------------------------------------------------------------------------|
| Dijkstra [[file:imgs/readme/2_dijkstra.gif]] | Ukkonen's exponential search (Edlib) [[file:imgs/readme/1_ukkonen.gif]] |
| Diagonal transition (WFA) [[file:imgs/readme/3_diagonal_transition.gif]] | DT + Divide & Conquer (BiWFA) [[file:imgs/readme/4_dt-divide-and-conquer.gif]] |
| A*PA (GCSH+DT) [[file:imgs/readme/5_astarpa.gif]] | |
| A*PA (GCSH+DT) [[file:imgs/readme/5_astarpa.gif]] | A*PA2-full (8-bit words; block size 32) [[file:imgs/readme/6_astarpa2.gif]] |

* Paper artefacts
- Figures ::
Expand Down
Binary file added imgs/readme/6_astarpa2.gif
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 imgs/readme/astarpa2.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 9 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,29 @@ fig-no-matches:
rm imgs/paper/no-matches.bmp

# ========== README VIDEOS ==========
readme: readme-layers readme-intro
readme: readme-layers readme-astarpa2 readme-intro
readme-layers:
cargo run --features example --release --example readme-layers
ffmpeg -y -framerate 20 -i imgs/readme/layers/%d.bmp $(FILTER) imgs/readme/layers.gif
gifsicle -O3 --batch imgs/readme/layers.gif
rm -rf imgs/readme/layers/

readme-astarpa2:
cargo run --features example --release --example readme-astarpa2
ffmpeg -y -framerate 10 -i imgs/readme/astarpa2/%d.bmp $(FILTER) imgs/readme/astarpa2.gif
gifsicle -O3 --batch imgs/readme/astarpa2.gif
rm -rf imgs/readme/astarpa2

# https://superuser.com/questions/1049606/reduce-generated-gif-size-using-ffmpeg
FILTER = -filter_complex "tpad=stop_mode=clone:stop_duration=3[t];[t]split[s0][s1];[s0]palettegen=max_colors=64[p];[s1][p]paletteuse=dither=bayer"
readme-videos:
cargo run --features example --release --example readme-videos
cargo run --features example,small_blocks --release --example readme-videos
ffmpeg -y -framerate 1 -i imgs/readme/1_ukkonen/%d.bmp $(FILTER) imgs/readme/1_ukkonen.gif
ffmpeg -y -framerate 10 -i imgs/readme/2_dijkstra/%d.bmp $(FILTER) imgs/readme/2_dijkstra.gif
ffmpeg -y -framerate 10 -i imgs/readme/3_diagonal-transition/%d.bmp $(FILTER) imgs/readme/3_diagonal_transition.gif
ffmpeg -y -framerate 20 -i imgs/readme/4_dt-divide-and-conquer/%d.bmp $(FILTER) imgs/readme/4_dt-divide-and-conquer.gif
ffmpeg -y -framerate 2 -i imgs/readme/5_astarpa/%d.bmp $(FILTER) imgs/readme/5_astarpa.gif
ffmpeg -y -framerate 8 -i imgs/readme/6_astarpa2/%d.bmp $(FILTER) imgs/readme/6_astarpa2.gif
gifsicle -O3 --batch imgs/readme/*.gif
rm -rf imgs/readme/*/

Expand Down
2 changes: 1 addition & 1 deletion pa-bin/examples/astarpa2-figures/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fn main() {
panic!("WARNING: Without the example feature, pruned matches aren't shown red for SH");
}
if pa_bitpacking::B::BITS != 8 {
panic!("Small blocks feature is required for useful scale");
panic!("small_blocks feature is required for useful scale");
}

let mut config = visualizer::Config::default();
Expand Down
17 changes: 17 additions & 0 deletions pa-bin/examples/readme-videos.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#![feature(trait_upcasting)]
//! This generates the visualizations used in figure 1 in the paper and in the slides.

use astarpa::{astar, AstarPa};
use astarpa2::AstarPa2Params;
use pa_affine_types::AffineCost;
use pa_base_algos::{
dt::{DiagonalTransition, GapCostHeuristic},
Expand All @@ -23,6 +25,13 @@ fn main() {
eprintln!("Distance {cost}");
eprintln!("Divergence {}", cost as f32 / a.len() as f32);

if !cfg!(feature = "example") {
panic!("WARNING: Without the example feature, pruned matches aren't shown red for SH");
}
if pa_bitpacking::B::BITS != 8 {
panic!("small_blocks feature is required for useful scale");
}

let cm = AffineCost::unit();
let mut config = visualizer::Config::default();
config.draw = When::None;
Expand Down Expand Up @@ -79,6 +88,14 @@ fn main() {
dt: true,
v: config.with_filename("5_astarpa"),
}),
{
let mut config = config.with_filename("6_astarpa2");
config.save = When::All;
config.draw_old_on_top = false;
let mut params = AstarPa2Params::full();
params.block_width = 32;
params.make_aligner_with_visualizer(true, config)
},
];
for aligner in aligners {
aligner.align(a, b);
Expand Down

0 comments on commit 28f1fb5

Please sign in to comment.