Beispiel #1
0
for peak in real_peak_list:
    area = peak_sum_area(real_im, peak)
    peak.set_area(area)

# real_peak_list is PyMS' best guess at the true peak list

################## Run Simulator ######################
# Simulator takes a peak list, time_list and mass_list
# and returns an IntensityMatrix object.
# The mass_list and time_list are the same for the real
# data and the simulated data.

time_list = real_im.get_time_list()
mass_list = real_im.get_mass_list()

sim_im = gcms_sim(time_list, mass_list, real_peak_list)
# sim_im is an IntensityMatrix object

# Now add noise to the simulated intensity matrix object
scale = 1000
add_gaussc_noise(sim_im, scale)

### Now display the ics from the simulated data
ics = []
for i in range(n_mz):
    ics.append(sim_im.get_ic_at_index(i))

display = Display()
display.plot_ics(ics)
display.do_plotting(
    'ICs of Simulated Data with gaussian noise (constant scale)')
Beispiel #2
0
    area = peak_sum_area(real_im, peak)
    peak.set_area(area)


# real_peak_list is PyMS' best guess at the true peak list

################## Run Simulator ######################
# Simulator takes a peak list, time_list and mass_list
# and returns an IntensityMatrix object.
# The mass_list and time_list are the same for the real
# data and the simulated data.

time_list = real_im.get_time_list()
mass_list = real_im.get_mass_list()

sim_im = gcms_sim(time_list, mass_list, real_peak_list)
# sim_im is an IntensityMatrix object

# Now add noise to the simulated intensity matrix object
scale = 1000
cutoff = 10000
prop = 0.0003
add_gaussv_noise(sim_im, scale, cutoff, prop)


### Now display the ics from the simulated data
ics = []
for i in range(n_mz):
    ics.append(sim_im.get_ic_at_index(i))

display = Display()