UCore

ursgal.ucore.calculate_mz(mass, charge)

Calculate m/z function

Keyword Arguments:
 
  • mass (float) – mass for calculating m/z
  • charge (int) – charge for calculating m/z
Returns:

calculated m/z

Return type:

float

ursgal.ucore.convert_ppm_to_dalton(ppm_value, base_mz=1000.0)

Normalize the precision in ppm to 1000 Dalton

Keyword Arguments:
 
  • ppm_value (float) – parts per million value to transform
  • base_mz (float) – factor for transformation
Returns:

value in Dalton

Return type:

float

ursgal.ucore.digest(sequence, enzyme, no_missed_cleavages=False)

Amino acid digest function

Keyword Arguments:
 
  • sequence (str) – amino acid sequence to digest
  • enzyme (tuple) – enzyme properties used for cleavage (‘aminoacid(s)’, ‘N/C(terminus)’) e.g. (‘KR’,’C’) for trypsin
  • no_missed_cleavages (bool) – allow missed cleavages or not
Returns:

list of digestes peptides

Return type:

list

ursgal.ucore.parseFasta(io)

Small function to efficiently parse a file in fasta format.

Keyword Arguments:
 io (obj) – openend file obj (fasta file)
Yields:tuple – fasta_id and sequence
ursgal.ucore.print_current_params(params, old_params=None)

Function to print current params

Keyword Arguments:
 params (dict) – parameter dict to print
ursgal.ucore.reformat_peptide(regex_pattern, unimod_name, peptide)

reformats the MQ and Novor peptide string to ursgal format (ac)SSSLM(ox)RPGPSR –> SSSLMRPGPSR#Acetyl:0;Oxidation:5

ursgal.ucore.terminal_supports_color()

Returns True if the running system’s terminal supports color, and False otherwise. Source: https://github.com/django/django/blob/master/django/core/management/color.py