Skip to content
Open
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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ keywords = ["metagenomics", "transcriptonomics", "bio", "DNA", "unipept"]
categories = ["command-line-utilities", "science"]
license = "MIT"
include = ["Cargo.toml", "LICENSE", "README.md", "scripts/umgap*.sh", "src/**/*.rs"]
edition = "2018"
edition = "2024"
rust-version = "1.88"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion src/commands/snaptaxon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use std::path::PathBuf;

use std::str::FromStr;

use clap::builder::{PossibleValuesParser, TypedValueParser};
use clap::Args;
use clap::builder::{PossibleValuesParser, TypedValueParser};

use crate::errors;
use crate::rank;
Expand Down
2 changes: 1 addition & 1 deletion src/commands/taxa2agg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use std::path::PathBuf;
use std::str::FromStr;

use crate::agg;
use clap::builder::{PossibleValuesParser, TypedValueParser};
use clap::Args;
use clap::builder::{PossibleValuesParser, TypedValueParser};

use crate::errors;
use crate::io::fasta;
Expand Down
2 changes: 1 addition & 1 deletion src/commands/taxa2freq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ use std::path::PathBuf;

use std::str::FromStr;

use clap::builder::{PossibleValuesParser, TypedValueParser};
use clap::Args;
use clap::builder::{PossibleValuesParser, TypedValueParser};

use crate::errors;
use crate::rank;
Expand Down
14 changes: 8 additions & 6 deletions src/commands/translate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ use std::fmt;
use std::io;
use std::str::FromStr;

use crate::dna::translation::TranslationTable;
use crate::dna::Strand;
use clap::builder::{PossibleValuesParser, TypedValueParser};
use crate::dna::translation::TranslationTable;
use clap::Args;
use clap::builder::{PossibleValuesParser, TypedValueParser};

use crate::errors;
use crate::io::fasta;
Expand Down Expand Up @@ -128,10 +128,12 @@ pub fn translate(args: Translate) -> errors::Result<()> {
} else {
header.clone() + "|" + &name.to_string()
},
sequence: vec![String::from_utf8(
table.translate_frame(args.methionine, strand.frame(frame)),
)
.unwrap()],
sequence: vec![
String::from_utf8(
table.translate_frame(args.methionine, strand.frame(frame)),
)
.unwrap(),
],
})?;
}
}
Expand Down
6 changes: 1 addition & 5 deletions src/dna/translation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,7 @@ impl TranslationTable {
/// Translate the given codon to an AA. Translate each start codon to methionine if asked.
pub fn translate(&self, methionine: bool, codon: &Codon) -> u8 {
let &(start, codon) = self.table.get(codon).unwrap_or(&(false, b'-'));
if start && methionine {
b'M'
} else {
codon
}
if start && methionine { b'M' } else { codon }
}

/// Translate the given DNA frame to a peptide. Translate each start codon to methionine if
Expand Down
Loading