unidec.UniDecImporter package

Subpackages

Submodules

unidec.UniDecImporter.FileParser module

unidec.UniDecImporter.FileParser.extract(file, directory, timestep=1.0, output='txt')
unidec.UniDecImporter.FileParser.extract_scans(file, directory, scanbins=1, output='txt')
unidec.UniDecImporter.FileParser.extract_scans_multiple_files(files, dirs, startscan=1.0, endscan=1.0, outputname='Combined', existing_path=None, vars=None, keys=None)
unidec.UniDecImporter.FileParser.extract_timepoints(files, directories, starttp=None, endtp=None, timestep=1.0, outputname='Combined')
unidec.UniDecImporter.FileParser.get_files(directory, timestep=1.0, output='txt')
unidec.UniDecImporter.FileParser.parse(path, times, timestep, volts, outputheader, directory, output='txt')
unidec.UniDecImporter.FileParser.parse_multiple(paths, timestep, newdir, starttp, endtp, voltsarr=None, outputname=None)

unidec.UniDecImporter.ImportTests module

class unidec.UniDecImporter.ImportTests.ImporterTests(methodName='runTest')

Bases: TestCase

test_all_scans()
test_avg_scan_norange()
test_avg_scan_scanrange()
test_avg_scan_timerange()
test_avg_time_norange()
test_check_centroided()
test_full_avg_scan()
test_get_cdms()
test_get_imms_avg_scan()
test_get_imms_scan()
test_get_ms_order()
test_get_polarity()
test_get_scans_times()
test_repeat_avg()
test_single_scan()
test_tic()

unidec.UniDecImporter.ImportTools module

unidec.UniDecImporter.ImportTools.fit_line(x, a, b)
unidec.UniDecImporter.ImportTools.get_longest_index(datalist)
unidec.UniDecImporter.ImportTools.get_resolution(testdata)

Get the median resolution of 1D MS data. :param testdata: N x 2 data (mz, intensity) :return: Median resolution (float)

unidec.UniDecImporter.ImportTools.get_resolution_im(data)

Get the median resolution of 1D MS data. :param testdata: N x 2 data (mz, intensity) :return: Median resolution (float)

unidec.UniDecImporter.ImportTools.header_test(path, deletechars=None, delimiter=' |\t|,', strip_end_space=True)

A quick test of a file to remove any problems from the header.

If scans through each line of an input file specificed by path and count the number of lines that cannot be completely converted to floats. It breaks the loop on the first hit that is entirely floats, so any header lines blow that will not be counted. :param path: Path of file to be scanned :param deletechars: Characters to be removed from the file before scanning :param delimiter: Delimiter to be used in the file :param strip_end_space: Boolean to strip the end space from the line :return: Integer length of the number of header lines

unidec.UniDecImporter.ImportTools.merge_im_spectra(datalist, mzbins=None, type='Integrate')

Merge together a list of ion mobility data. Interpolates each data set in the list to a new nonlinear axis with the median resolution of the first element. Optionally, allows mzbins to create a linear axis with each point spaced by mzbins. Then, adds the interpolated data together to get the merged data. :param datalist: M x N x 2 list of data sets :return: Merged N x 2 data set

unidec.UniDecImporter.ImportTools.merge_spectra(datalist, mzbins=None, type='Interpolate')

Merge together a list of data. Interpolates each data set in the list to a new nonlinear axis with the median resolution of the first element. Optionally, allows mzbins to create a linear axis with each point spaced by mzbins. Then, adds the interpolated data together to get the merged data. :param datalist: M x N x 2 list of data sets :return: Merged N x 2 data set

unidec.UniDecImporter.ImportTools.nonlinear_axis(start, end, res)

Creates a nonlinear axis with the m/z values spaced with a defined and constant resolution. :param start: Minimum m/z value :param end: Maximum m/z value :param res: Resolution of the axis ( m / delta m) :return: One dimensional array of the nonlinear axis.

unidec.UniDecImporter.Importer module

class unidec.UniDecImporter.Importer.Importer(file_path, **kwargs)

Bases: object

avg_fast(scan_range=None, time_range=None)
check_centroided()
close()
get_all_imms_scans()
get_all_scans()
get_avg_scan(scan_range=None, time_range=None)
get_cdms_data(scan_range=None)
get_imms_avg_scan(scan_range=None, time_range=None, mzbins=1)
get_imms_scan(s)
get_max_scan()
get_max_time()
get_ms_order(scan=None)
get_polarity(scan=None)
get_scan_index(scan)
get_scan_time(scan)
get_scans_from_times(time_range)
get_single_scan(scan)
get_tic()
get_time_scan(time)
get_times_from_scans(scan_range)
scan_range_from_inputs(scan_range=None, time_range=None)

unidec.UniDecImporter.ImporterFactory module

To create importer for any of the 4 types, Simply use: importer_name = ImporterFactory.create_importer(file_path) To fetch all scans use importer_name.get_all_scans()

class unidec.UniDecImporter.ImporterFactory.ImporterFactory

Bases: object

static create_importer(file_path, **kwargs)
unidec.UniDecImporter.ImporterFactory.get_polarity(path)

unidec.UniDecImporter.SingleScanImporter module

class unidec.UniDecImporter.SingleScanImporter.SingleScanImporter(filename, **kwargs)

Bases: Importer

get_all_imms_scans()
get_all_scans()
get_avg_scan(scan_range=None, time_range=None)
get_cdms_data()
get_imms_avg_scan(scan_range=None, time_range=None, mzbins=None)
get_imms_scan(s)
get_single_scan(scan=None)
load_data()

unidec.UniDecImporter.reader_tester module

Module contents

unidec.UniDecImporter.get_importer(file_path, **kwargs)