Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions 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 generic_a_star/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "generic_a_star"
description = "A generic implementation of the A* algorithm"
version = "3.0.0"
version = "4.0.0"
edition.workspace = true
rust-version.workspace = true
license.workspace = true
Expand Down
6 changes: 3 additions & 3 deletions lib_ts_chainalign/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
name = "lib_ts_chainalign"
description = "A chaining-based sequence-to-sequence aligner that accounts for template switches"
authors = ["Sebastian Schmidt <sebastian.schmidt@helsinki.fi>"]
version = "3.0.0"
version = "4.0.0"
license.workspace = true
edition.workspace = true
rust-version.workspace = true
repository.workspace = true

[dependencies]
generic_a_star = { version = "3.0.0", path = "../generic_a_star" }
lib_tsalign = { version = "3.0.0", path = "../lib_tsalign" }
generic_a_star = { version = "4.0.0", path = "../generic_a_star" }
lib_tsalign = { version = "4.0.0", path = "../lib_tsalign" }
ndarray = { version = "0.17.1", features = ["serde"] }
num-traits.workspace = true
serde = { workspace = true, features = ["derive"] }
Expand Down
6 changes: 3 additions & 3 deletions lib_tsalign/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "lib_tsalign"
description = "A sequence-to-sequence aligner that accounts for template switches"
authors = ["Sebastian Schmidt <sebastian.schmidt@helsinki.fi>"]
version = "3.0.0"
version = "4.0.0"
license.workspace = true
edition.workspace = true
rust-version.workspace = true
Expand All @@ -26,9 +26,9 @@ thiserror = "2.0.3"
num-traits.workspace = true
serde = { workspace = true, features = ["derive"], optional = true }
noisy_float = { version = "0.2.0" }
generic_a_star = { version = "3.0.0", path = "../generic_a_star" }
generic_a_star = { version = "4.0.0", path = "../generic_a_star" }
log.workspace = true
rustc-hash = "2.1.1"
seed_chain = { version = "3.0.0", path = "../seed_chain" }
seed_chain = { version = "4.0.0", path = "../seed_chain" }
extend_map = "0.14.3"
template-switch-error-free-inners = "0.1.1"
4 changes: 2 additions & 2 deletions lib_tsshow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ name = "lib_tsshow"
description = "A visualiser for template-switch alignments"
license.workspace = true
authors = ["Sebastian Schmidt <sebastian.schmidt@helsinki.fi>"]
version = "3.0.0"
version = "4.0.0"
edition.workspace = true
rust-version.workspace = true
repository.workspace = true

[dependencies]
lib_tsalign = { version = "3.0.0", path = "../lib_tsalign" }
lib_tsalign = { version = "4.0.0", path = "../lib_tsalign" }
log.workspace = true
svg = "0.18.0"
resvg = "0.45.0"
Expand Down
6 changes: 3 additions & 3 deletions python_bindings/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = [
"Sebastian Schmidt <sebastian.schmidt@helsinki.fi>",
"Jasper Krauter <jasper.krauter@helsinki.fi>",
]
version = "3.0.0"
version = "4.0.0"
edition.workspace = true
rust-version.workspace = true
repository.workspace = true
Expand All @@ -18,10 +18,10 @@ crate-type = ["cdylib"]

[dependencies]
pyo3 = "0.26"
lib_tsalign = { version = "3.0.0", path = "../lib_tsalign", features = [
lib_tsalign = { version = "4.0.0", path = "../lib_tsalign", features = [
"serde",
] }
lib_tsshow = { version = "3.0.0", path = "../lib_tsshow" }
lib_tsshow = { version = "4.0.0", path = "../lib_tsshow" }
serde.workspace = true
pythonize = "0.26"
pyo3-log = "0.13"
Expand Down
4 changes: 2 additions & 2 deletions seed_chain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "seed_chain"
description = "A seeding and generic chaining mechanism for sequence-to-sequence alignment"
license.workspace = true
authors = ["Sebastian Schmidt <sebastian.schmidt@helsinki.fi>"]
version = "3.0.0"
version = "4.0.0"
edition.workspace = true
rust-version.workspace = true
repository.workspace = true
Expand All @@ -12,5 +12,5 @@ repository.workspace = true
[dependencies]
compact-genome.workspace = true
log.workspace = true
generic_a_star = { version = "3.0.0", path = "../generic_a_star" }
generic_a_star = { version = "4.0.0", path = "../generic_a_star" }
num-traits.workspace = true
2 changes: 1 addition & 1 deletion tsalign-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "tsalign-tests"
license.workspace = true
authors = ["Sebastian Schmidt <sebastian.schmidt@helsinki.fi>", "Jasper Krauter <jasper.krauter@helsinki.fi>"]
version = "3.0.0"
version = "4.0.0"
edition.workspace = true
rust-version.workspace = true
repository.workspace = true
Expand Down
23 changes: 18 additions & 5 deletions tsalign/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,31 @@ name = "tsalign"
description = "A sequence-to-sequence aligner that accounts for template switches"
license.workspace = true
authors = ["Sebastian Schmidt <sebastian.schmidt@helsinki.fi>"]
version = "3.0.0"
version = "4.0.0"
edition.workspace = true
rust-version.workspace = true
repository.workspace = true

[features]
alphabet_dna = []
alphabet_dna_n = []
alphabet_dna_iupac = []
alphabet_rna = []
alphabet_rna_n = []
alphabet_rna_iupac = []

strategy_total_length_none = []
strategy_total_length_maximise = []

default = ["strategy_total_length_maximise", "alphabet_dna", "alphabet_dna_n"]

[dependencies]
generic_a_star = { version = "3.0.0", path = "../generic_a_star" }
lib_tsalign = { version = "3.0.0", path = "../lib_tsalign", features = [
generic_a_star = { version = "4.0.0", path = "../generic_a_star" }
lib_tsalign = { version = "4.0.0", path = "../lib_tsalign", features = [
"serde",
] }
lib_ts_chainalign = { version = "3.0.0", path = "../lib_ts_chainalign" }
lib_tsshow = { version = "3.0.0", path = "../lib_tsshow" }
lib_ts_chainalign = { version = "4.0.0", path = "../lib_ts_chainalign" }
lib_tsshow = { version = "4.0.0", path = "../lib_tsshow" }
clap.workspace = true
compact-genome = { workspace = true, features = ["io"] }
traitsequence.workspace = true
Expand Down
36 changes: 26 additions & 10 deletions tsalign/src/align.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,7 @@ use clap::{
builder::{BoolishValueParser, TypedValueParser},
};
use compact_genome::{
implementation::{
alphabets::{
dna_alphabet::DnaAlphabet, dna_alphabet_or_n::DnaAlphabetOrN,
dna_iupac_nucleic_acid_alphabet::DnaIupacNucleicAcidAlphabet,
rna_alphabet::RnaAlphabet, rna_alphabet_or_n::RnaAlphabetOrN,
rna_iupac_nucleic_acid_alphabet::RnaIupacNucleicAcidAlphabet,
},
vec_sequence::VectorGenome,
vec_sequence_store::VectorSequenceStore,
},
implementation::{vec_sequence::VectorGenome, vec_sequence_store::VectorSequenceStore},
interface::{
alphabet::Alphabet,
sequence::{GenomeSequence, OwnedGenomeSequence},
Expand Down Expand Up @@ -50,6 +41,19 @@ use template_switch_distance_type_selectors::{
align_a_star_template_switch_distance,
};

#[cfg(feature = "alphabet_dna")]
use compact_genome::implementation::alphabets::dna_alphabet::DnaAlphabet;
#[cfg(feature = "alphabet_dna_n")]
use compact_genome::implementation::alphabets::dna_alphabet_or_n::DnaAlphabetOrN;
#[cfg(feature = "alphabet_dna_iupac")]
use compact_genome::implementation::alphabets::dna_iupac_nucleic_acid_alphabet::DnaIupacNucleicAcidAlphabet;
#[cfg(feature = "alphabet_rna")]
use compact_genome::implementation::alphabets::rna_alphabet::RnaAlphabet;
#[cfg(feature = "alphabet_rna_n")]
use compact_genome::implementation::alphabets::rna_alphabet_or_n::RnaAlphabetOrN;
#[cfg(feature = "alphabet_rna_iupac")]
use compact_genome::implementation::alphabets::rna_iupac_nucleic_acid_alphabet::RnaIupacNucleicAcidAlphabet;

use crate::align::{
a_star_chain_ts::align_a_star_chain_ts,
fasta_parser::{parse_pair_fasta_file, parse_single_fasta_file},
Expand Down Expand Up @@ -282,11 +286,17 @@ enum AlignmentMethod {

#[derive(Debug, Clone, Eq, PartialEq, ValueEnum)]
enum InputAlphabet {
#[cfg(feature = "alphabet_dna")]
Dna,
#[cfg(feature = "alphabet_dna_n")]
DnaN,
Comment thread
sebschmi marked this conversation as resolved.
#[cfg(feature = "alphabet_rna")]
Rna,
#[cfg(feature = "alphabet_rna_n")]
RnaN,
#[cfg(feature = "alphabet_dna_iupac")]
DnaIupac,
#[cfg(feature = "alphabet_rna_iupac")]
RnaIupac,
}

Expand All @@ -308,11 +318,17 @@ pub fn cli(cli: Cli) -> Result<()> {
}

match cli.alphabet {
#[cfg(feature = "alphabet_dna")]
InputAlphabet::Dna => execute_with_alphabet::<DnaAlphabet>(cli)?,
#[cfg(feature = "alphabet_dna_n")]
InputAlphabet::DnaN => execute_with_alphabet::<DnaAlphabetOrN>(cli)?,
Comment thread
sebschmi marked this conversation as resolved.
#[cfg(feature = "alphabet_rna")]
InputAlphabet::Rna => execute_with_alphabet::<RnaAlphabet>(cli)?,
#[cfg(feature = "alphabet_rna_n")]
InputAlphabet::RnaN => execute_with_alphabet::<RnaAlphabetOrN>(cli)?,
#[cfg(feature = "alphabet_dna_iupac")]
InputAlphabet::DnaIupac => execute_with_alphabet::<DnaIupacNucleicAcidAlphabet>(cli)?,
#[cfg(feature = "alphabet_rna_iupac")]
InputAlphabet::RnaIupac => execute_with_alphabet::<RnaIupacNucleicAcidAlphabet>(cli)?,
}

Expand Down
14 changes: 10 additions & 4 deletions tsalign/src/align/template_switch_distance_type_selectors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ use lib_tsalign::{
PreprocessedLookaheadTemplateSwitchMinLengthStrategy,
PreprocessedTemplateSwitchMinLengthStrategy, TemplateSwitchMinLengthStrategy,
},
template_switch_total_length::{
MaxTemplateSwitchTotalLengthStrategy, NoTemplateSwitchTotalLengthStrategy,
TemplateSwitchTotalLengthStrategy,
},
template_switch_total_length::TemplateSwitchTotalLengthStrategy,
},
},
template_switch_distance_a_star_align,
Expand All @@ -41,6 +38,11 @@ use lib_tsalign::{
};
use log::info;

#[cfg(feature = "strategy_total_length_none")]
use lib_tsalign::a_star_aligner::template_switch_distance::strategies::template_switch_total_length::NoTemplateSwitchTotalLengthStrategy;
#[cfg(feature = "strategy_total_length_maximise")]
use lib_tsalign::a_star_aligner::template_switch_distance::strategies::template_switch_total_length::MaxTemplateSwitchTotalLengthStrategy;

use super::Cli;
use crate::util::load_tsa_config;

Expand Down Expand Up @@ -71,7 +73,9 @@ pub enum TemplateSwitchChainingStrategySelector {

#[derive(Clone, ValueEnum)]
pub enum TemplateSwitchTotalLengthStrategySelector {
#[cfg(feature = "strategy_total_length_none")]
None,
#[cfg(feature = "strategy_total_length_maximise")]
Maximise,
}
Comment thread
sebschmi marked this conversation as resolved.

Expand Down Expand Up @@ -375,6 +379,7 @@ fn align_a_star_template_switch_select_template_switch_total_length_strategy<
template_switch_count_memory: <TemplateSwitchCount as TemplateSwitchCountStrategy>::Memory,
) {
match cli.ts_total_length_strategy {
#[cfg(feature = "strategy_total_length_none")]
TemplateSwitchTotalLengthStrategySelector::None => {
align_a_star_template_switch_select_template_switch_descendant_strategy::<
_,
Expand All @@ -395,6 +400,7 @@ fn align_a_star_template_switch_select_template_switch_total_length_strategy<
template_switch_count_memory,
)
}
#[cfg(feature = "strategy_total_length_maximise")]
TemplateSwitchTotalLengthStrategySelector::Maximise => {
align_a_star_template_switch_select_template_switch_descendant_strategy::<
_,
Expand Down
Loading