Skip to content

Commit

Permalink
Init plate mixing
Browse files Browse the repository at this point in the history
  • Loading branch information
David O'Connor committed Nov 6, 2024
1 parent 1ddc0ec commit 4b96f4b
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "plascad"
version = "0.7.5"
version = "0.7.6"
edition = "2021"
authors = ["David O'Connor <[email protected]>"]
#description = "Tools for plasmid and primer design, PCR, and related."
Expand Down
3 changes: 3 additions & 0 deletions src/backbones.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
//! This module contains data structures and related for vector backbones, used for cloning. It also pulls data from Addgene.
//! [Popular AddGene Bacterial expression backbones](https://www.addgene.org/search/catalog/plasmids/?sticky=no&q=empty+backbone&page_size=20&expression=Bacterial+Expression&requests=100%2B+requests)
//!
//! [AddGene Backbone page](https://www.addgene.org/collections/empty-backbones/)
// todo: Add more of those.


use std::{fmt, fmt::Formatter};

use na_seq::{seq_complement, seq_from_str, SeqTopology};
Expand Down
2 changes: 0 additions & 2 deletions src/gui/portions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,6 @@ fn media_disp(portions: &mut PortionsState, ui: &mut Ui) {
ui.label(format!("{:.1} μL", result.antibiotic * 1_000.));
});

// todo: Run calc immediately.

if run_calc {
portions.media_result = media_prep(&portions.media_input);
}
Expand Down
4 changes: 3 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ use crate::{
tags::TagMatch,
util::{get_window_title, RangeIncl},
};
use crate::portions::media_prep;

mod alignment;
mod amino_acids;
Expand Down Expand Up @@ -422,7 +423,7 @@ impl Default for StateUi {
text_selection: Default::default(),
quick_feature_add_name: Default::default(),
quick_feature_add_dir: Default::default(),
aa_ident_disp: AaIdent::ThreeLetters,
aa_ident_disp: AaIdent::OneLetter,
pdb_error_received: false,
re: Default::default(),
backbone_filters: Default::default(),
Expand Down Expand Up @@ -563,6 +564,7 @@ impl Default for State {
// which then trigger RE match syncs.
result.restriction_enzyme_lib = load_re_library();
result.backbone_lib = load_backbone_library();

result
}
}
Expand Down
19 changes: 17 additions & 2 deletions src/portions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,28 @@ use std::fmt::Display;

use bincode::{Decode, Encode};

#[derive(Default, Clone, Encode, Decode)]
#[derive(Clone, Encode, Decode)]
pub struct PortionsState {
pub solutions: Vec<Solution>,
pub media_input: MediaPrepInput,
pub media_result: MediaPrep,
}

impl Default for PortionsState {
fn default() -> Self {
let media_input = MediaPrepInput::default();
let media_result = media_prep(&media_input);

let mut result = Self {
solutions: Vec::new(),
media_input,
media_result,
};

result
}
}

#[derive(Default, Clone, Encode, Decode)]
pub struct Solution {
pub name: String,
Expand Down Expand Up @@ -293,7 +308,7 @@ impl Default for MediaPrepInput {
}
}

#[derive(Clone, Default, Encode, Decode)]
#[derive(Clone, Default, Encode, Decode, Debug)]
pub struct MediaPrep {
pub water: f32, // L
pub food: f32, // g
Expand Down

0 comments on commit 4b96f4b

Please sign in to comment.