rustdf::sim::utility

Function sequence_to_all_ions

Source
pub fn sequence_to_all_ions(
    sequence: &str,
    charge: i32,
    intensity_pred_flat: &Vec<f64>,
    normalize: bool,
    half_charge_one: bool,
    peptide_id: Option<i32>,
) -> String
Expand description

helper function to convert a peptide ion to all possible ions and serialize the result to a json string

§Arguments

  • sequence - A string representing the peptide sequence
  • charge - An i32 representing the charge
  • intensity_pred_flat - A vector of f64 representing the flat prosit predicted intensity array
  • normalize - A bool indicating whether to normalize the intensity values
  • half_charge_one - A bool indicating whether to use half charge one

§Returns

  • A json string representing the peptide ions ready to pe put into a database