def find_peaks_automatically_and_export (self,
n_expected=None,
include_headers=False) :
err = StringIO()
peak_times, bandwidth = self.find_consensus_peaks(
n_expected=n_expected, err=err)
table, errors = self.extract_peak_areas(peak_times, bandwidth, err=err)
if include_headers :
table.insert(0, ["Sample ID"] +
["Peak %d" % (i+1) for i in range(len(peak_times)) ])
table.insert(1, [None] + ["%.4fm" % x for x in peak_times])
return {
"data_type" : "gc_ms",
"auto_peak" : True,
"bandwidth" : bandwidth,
"bandwidth_auto" : True, #bandwidth_auto,
"peak_times" : peak_times,
"sample_data" : table,
"errors" : errors,
"samples" : jsonpickle.encode(self.samples),
}
评论列表
文章目录