Skip to content

aaug1/GenomicsDataStruct

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Kirby Mascot

Computational Genomics: Team 42 Final Project

Authors: Aidan Aug, Mark Tiavas, Karen He, Alan Zhang

drawing drawing

Latest Release Python version

Probabilistic Data Structures: Teaching Lecture

This repository contains the source code for Team 42's Final Project. For our project, we decided to develop a teaching plan for probabilistic data structures with relevance to genomics. Our final deliverable includes a range of supporting materials, such as tutorials, worked examples, pedagogical visualizations or animations, assessments.

This GitHub repository contains the source code for the data structures implemented, as well as the code for the animations created using Manim and Manim Slides.

Table of contents

Implementation Code


Code for implementations can be found in prob-data-struct folder.

There are 3 data structures implemented, BloomFilter, CuckooFilter, and CountMin.

The real implementations are in BloomFilter.py, cuckooFilter.py, and CountMin.py. Simply run the following command to test them out

  python BloomFilter.py

You may need to pip install bitstring to run cuckooFilter.py

The homework assignment templates are in the corresponding Template.Py files. They also will be run by

  python BloomFilterTemplate.py

Examples inputs are present in each file.

Manim Slides


Installation

Please see the source code for the dependencies used in this project:

For convenience, installation instructions are listed here.

While installing Manim Slides and its dependencies on your global Python is fine, it is recommended to use a virtualenv for a local installation. To avoid linting errors, please install both manim and manim-slides in the same virtual environment.

Dependencies

Manim Slides requires either Manim or ManimGL to be installed. Having both packages installed is fine too.

If none of those packages are installed, please refer to their specific installation guidelines:

Note that we require latex to be installed for our presentation.

Download source-code for animations

Alternatively, you can install the original manim-slides repository directly, and copy/paste relevant python files for animation.

The recommended way to install the latest release is to use pip:

pip install manim-slides

If you do not have pip, please refer to the docs for installation: https://pip.pypa.io/en/stable/installation/

Install From Repository

Install this lecture plan by cloning this repository locally, or unzipping the package. Manim Slides is to clone the git repository, and install from there:

git clone https://github.com/aaug1/GenomicsDataStruct.git

Note: the -e flag allows you to edit the files, and observe the changes directly when using Manim Slides

Usage

Tool for live presentations using either Manim (community edition) or ManimGL. Manim Slides will automatically detect the one you are using!

Using Manim Slides is a two-step process:

  1. Render animations using Slide (resp. ThreeDSlide) as a base class instead of Scene (resp. ThreeDScene), and add calls to self.pause() everytime you want to create a new slide.
  2. Run manim-slides on rendered animations and display them like a Power Point presentation.

The command-line documentation is available online.

Basic Example

Wrap a series of animations between self.start_loop() and self.stop_loop() when you want to loop them (until input to continue):

# example.py

from manim import *
# or: from manimlib import *
from manim_slides import Slide

class Example(Slide):
    def construct(self):
        circle = Circle(radius=3, color=BLUE)
        dot = Dot()

        self.play(GrowFromCenter(circle))
        self.pause()  # Waits user to press continue to go to the next slide

        self.start_loop()  # Start loop
        self.play(MoveAlongPath(dot, circle), run_time=2, rate_func=linear)
        self.end_loop()  # This will loop until user inputs a key

        self.play(dot.animate.move_to(ORIGIN))
        self.pause()  # Waits user to press continue to go to the next slide

        self.wait()

You must end your Slide with a self.play(...) or a self.wait(...).

First, render the animation files:

manim example.py
# or
manimgl example.py

To start the presentation using Scene1, Scene2 and so on simply run:

manim-slides [OPTIONS] Scene1 Scene2...

Or in this example:

manim-slides Example

Rendering the bloom filter animation (works for bloom, cuckoo, or countmin)

First, render the animation files:

manim bloom.py
# or
manimgl bloom.py

To start the interactive manim presentation

manim-slides Bloom

Key Bindings

The default key bindings to control the presentation are:

manim-wizard

You can run the configuration wizard to change those key bindings:

manim-slides wizard

A default file can be created with:

manim-slides init

NOTE: manim-slides uses key codes, which are platform dependent. Using the configuration wizard is therefore highly recommended.

Features and Comparison with original manim-presentation

Below is a non-exhaustive list of features:

Feature manim-slides manim-presentation
Support for Manim ✔️ ✔️
Support for ManimGL ✔️ ✖️
Configurable key bindings ✔️ ✔️
Configurable paths ✔️ ✖️
Play / Pause slides ✔️ ✔️
Next / Previous slide ✔️ ✔️
Replay slide ✔️ ✔️
Reverse slide ✔️ ✖️
Multiple key per actions ✔️ ✖️
One command line tool ✔️ ✖️
Robust config file parsing ✔️ ✖️
Support for 3D Scenes ✔️ ✖️
Documented code ✔️ ✖️
Tested on Unix, macOS, and Windows ✔️ ✖️
Hide mouse cursor ✔️ ✖️

F.A.Q

How to increase quality on Windows

On Windows platform, one may encounter a lower image resolution than expected. Usually, this is observed because Windows rescales every application to fit the screen. As found by @arashash, in #20, the problem can be addressed by changing the scaling factor to 100%:

Windows Fix Scaling

in Settings->Display.

About

Computational genomics data structures teaching lesson

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages