casanovoutils.constants
=======================

.. py:module:: casanovoutils.constants

.. autoapi-nested-parse::

   Shared constants for column names and sentinel values used across the package.



Classes
-------

.. autoapisummary::

   casanovoutils.constants.Constants


Module Contents
---------------

.. py:class:: Constants

   Global constants for column names and sentinel values.

   ground_truth_sequence_column : str
       Name of the column holding ground truth peptide sequences.
   aa_scores_column : str
       Name of the column holding per-amino-acid score strings.
   pep_score_column : str
       Name of the column holding peptide-level search engine scores.
   aa_idx_column : str
       Name of the column holding per-amino-acid positional indices,
       added during alignment and explosion.
   precision_column : str
       Name of the column holding cumulative precision values computed
       by ``calc_precision_coverage``.
   coverage_column : str
       Name of the column holding cumulative coverage values computed
       by ``calc_precision_coverage``.
   min_score : float
       Sentinel score assigned to gap positions during sequence alignment.


   .. py:attribute:: ground_truth_sequence_column
      :type:  str
      :value: 'mgf_seq'



   .. py:attribute:: aa_scores_column
      :type:  str
      :value: 'mztab_opt_ms_run[1]_aa_scores'



   .. py:attribute:: pep_score_column
      :type:  str
      :value: 'mztab_search_engine_score[1]'



   .. py:attribute:: aa_idx_column
      :type:  str
      :value: 'pc_aa_idx'



   .. py:attribute:: precision_column
      :type:  str
      :value: 'pc_precision'



   .. py:attribute:: coverage_column
      :type:  str
      :value: 'pc_coverage'



   .. py:attribute:: predicted_tokens
      :type:  str
      :value: 'mztab_tokens'



   .. py:attribute:: ground_truth_tokens
      :type:  str
      :value: 'mgf_tokens'



   .. py:attribute:: min_score
      :type:  float
      :value: -1.0



   .. py:method:: get_pred_sequence_column(df: polars.DataFrame) -> str
      :staticmethod:


      Determine the name of the predicted sequence column.

      Checks for the presence of a ProForma-formatted prediction column first,
      falling back to the plain mzTab sequence column if it is absent.

      :param df: A DataFrame expected to contain either
                 ``"mztab_opt_ms_run[1]_proforma"`` or ``"mztab_sequence"``.
      :type df: pl.DataFrame

      :returns: The name of the predicted sequence column.
      :rtype: str



