예제 #1
0
###########################################################################
from precursor import Precursors
myprecursors = Precursors()
myprecursors.getFromDB(par, db.cursor(), min_q1 - par.q1_window, max_q1 + par.q1_window)
if not options.query_peptide_table is None and not options.query_peptide_table == "":
  print "Using a different table for the query peptides than for the background peptides!"
  print "Will use table %s " % options.query_peptide_table
  query_precursors = Precursors()
  query_par = copy(par)
  query_par.peptide_tables = [options.query_peptide_table]
  query_precursors.getFromDB(query_par, db.cursor(), min_q1 - par.q1_window, max_q1 + par.q1_window)
  precursors_to_evaluate = query_precursors.getPrecursorsToEvaluate(min_q1, max_q1)
else:
  precursors_to_evaluate = myprecursors.getPrecursorsToEvaluate(min_q1, max_q1)
myprecursors.build_parent_id_lookup()
myprecursors.build_transition_group_lookup()

# If we dont use the DB, we use the rangetree to query and get our list of
# precursors that are interfering. In SWATH we dont include a +/- q1_window
# around our range or precursors because the precursor window is fixed to
# (min_q1,max_q1) and no other precursors are considered.
if not use_db and swath_mode: 
  myprecursors.getFromDB(par, cursor, min_q1, max_q1)
  rtree = myprecursors.build_rangetree()
elif not use_db:
  #myprecursors.getFromDB(par, cursor, min_q1 - par.q1_window, max_q1 + par.q1_window)
  rtree = myprecursors.build_rangetree()

# In SWATH mode, select all precursors that are relevant for the background at
# once. Select all precursors between min_q1 - correction and max_q1 and then
# only append those to all_swath_precursors that are actually included in the
예제 #2
0
  def setUp(self):

    self.transitions = transitions_def1
    self.collisions  = collisions_def1

    self.EPSILON = 10**-5

    self.min_q1 = 400
    self.max_q1 = 1500

    par = collider.SRM_parameters()
    par.q1_window = 1 / 2.0
    par.q3_window = 1 / 2.0
    par.ssrcalc_window = 10 / 2.0
    par.ppm = False
    par.isotopes_up_to = 3
    par.q3_low = 400
    par.q3_high = 1400
    par.max_uis = 5
    par.peptide_tables = [ PEPTIDE_TABLE_NAME ]
    par.mysql_config = '~/.my.cnf'
    par.sqlite_database = test_shared.SQLITE_DATABASE_LOCATION
    print par.sqlite_database 
    par.use_sqlite = USE_SQLITE
    par.quiet = False

    par.bions      =  True
    par.yions      =  True
    par.aions      =  False
    par.aMinusNH3  =  False
    par.bMinusH2O  =  False
    par.bMinusNH3  =  False
    par.bPlusH2O   =  False
    par.yMinusH2O  =  False
    par.yMinusNH3  =  False
    par.cions      =  False
    par.xions      =  False
    par.zions      =  False
    par.MMinusH2O  =  False
    par.MMinusNH3  =  False
    par.q3_range = [par.q3_low, par.q3_high]
    par.set_default_vars()
    par.eval()

    self.par = par
    self.R = Residues('mono')

    self.acollider = collider.SRMcollider()
    self.aparamset = collider.testcase()

    self.db = par.get_db()


    # Get the precursors
    ###########################################################################
    myprecursors = Precursors()
    cursor = self.db.cursor()
    myprecursors.getFromDB(par, cursor, self.min_q1 - par.q1_window, self.max_q1 + par.q1_window)
    testrange = myprecursors.build_rangetree()
    self.precursors_to_evaluate = myprecursors.getPrecursorsToEvaluate(self.min_q1, self.max_q1)
    myprecursors.build_parent_id_lookup()
    myprecursors.build_transition_group_lookup()
    self.myprecursors = myprecursors
    cursor.close()