nmt/utils/peaks_utils.py
def parse_row(input_row):
  '''Parse input string to data entry'''
  # header = ["sequence", "charge", "mass/charge", "score1", "score2", "spectrum"]
  input_row = input_row.strip()
  data = input_row.split('|')
  
  charge = int(float(data[1]))
  mass_p_charge = float(data[2])
  peptide_mass = charge * mass_p_charge + (2.0 - charge) * input_config.mass_H

  spec = data[-1].split(',')

  positions = spec[::2]
  values = spec[1::2]
  seq = data[0]
  
  positions = [float(posi) for posi in positions]
  values = [float(val) for val in values]

  return seq, charge, mass_p_charge, peptide_mass, positions, values
Parse input string to data entry
Parse input string to data entry
Parse input string to data entry
def parse_row(input_row):
  input_row = input_row.strip()
  data = input_row.split('|')
  charge = int(float(data[1]))
  mass_p_charge = float(data[2])
  peptide_mass = charge * mass_p_charge + (2.0 - charge) * input_config.mass_H
  spec = data[-1].split(',')
  positions = spec[::2]
  values = spec[1::2]
  seq = data[0]
  positions = [float(posi) for posi in positions]
  values = [float(val) for val in values]
  return seq, charge, mass_p_charge, peptide_mass, positions, values
def parse_row ( input_row ) : input_row = input_row . strip ( ) data = input_row . split ( '|' ) charge = int ( float ( data [ 1 ] ) ) mass_p_charge = float ( data [ 2 ] ) peptide_mass = charge * mass_p_charge + ( 2.0 - charge ) * input_config . mass_H spec = data [ - 1 ] . split ( ',' ) positions = spec [ : : 2 ] values = spec [ 1 : : 2 ] seq = data [ 0 ] positions = [ float ( posi ) for posi in positions ] values = [ float ( val ) for val in values ] return seq , charge , mass_p_charge , peptide_mass , positions , values
Parse input string to data entry
Parse input string to data entry
'''Parse input string to data entry''' # header = ["sequence", "charge", "mass/charge", "score1", "score2", "spectrum"]
input_row