Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement alignment param presets #1569

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ivan-aksamentov
Copy link
Member

Define some hard-coded presets of alignment parameters additionally to the default one.

The --alignment-preset arg allows users to toggle between presets.

Example:

nextclade run --dataset-name=sars-cov-2 -O tmp/sars-cov-2 sequences.fasta --alignment-preset=high-diversity --verbosity=info

Comment on lines 199 to 220
pub fn from_preset(preset_name: impl AsRef<str>) -> Result<AlignPairwiseParams, Report> {
let preset_name = preset_name.as_ref();
match preset_name {
"default" => Ok(AlignPairwiseParams::default()),
"high-diversity" => Ok(AlignPairwiseParams {
alignment_preset: o!("high-diversity"),
penalty_gap_extend: 0,
penalty_gap_open: 999999, // FIXME: dummy values
penalty_gap_open_in_frame: 88888, // FIXME: dummy values
penalty_gap_open_out_of_frame: 77777, // FIXME: dummy values
penalty_mismatch: 6666, // FIXME: dummy values
score_match: 33333, // FIXME: dummy values
..AlignPairwiseParams::default()
}),
"short-sequences" => Ok(AlignPairwiseParams {
alignment_preset: o!("short-sequences"),
min_length: 0, // FIXME: dummy values
..AlignPairwiseParams::default()
}),
_ => make_error!("Alignment params preset not found: {preset_name}"),
}
}
Copy link
Member Author

@ivan-aksamentov ivan-aksamentov Feb 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The presets are defined here.

These are the dummy values to be tweaked.

Comment on lines +33 to +35
/// Alignment param preset
#[clap(long, default_value = ALIGNMENT_PRESET_DEFAULT)]
pub alignment_preset: String,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLI arg help text needs to be adjusted

Define some hard-coded presets of alignment parameters additionally to the default one.

The `--alignment-preset` arg allows users to toggle between presets.

Example:

```bash
nextclade run --dataset-name=sars-cov-2 -O tmp/sars-cov-2 sequences.fasta --alignment-preset=high-diversity --verbosity=info
```
@corneliusroemer
Copy link
Member

Nice stuff! @anna-parker you might be interested in this one potentially 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants