Giter Site home page Giter Site logo

chromatography's Introduction

Chromatography Toolbox

Open-source code for processing chromatography and mass spectrometry data in the MATLAB programming environment

Download

Select the Download ZIP button on this page or visit the MATLAB File Exchange to download a copy of the current release.

Features

Import Data
Type Extension
Agilent .D, .MS
Thermo .RAW
netCDF .CDF
mzXML .mzXML
Baseline Correction
Curve Fitting
Visualize

System Requirements

Current release stable on the following systems:

  • MATLAB 2013b+

Documentation

Visit the wiki for a full list of methods and options.

Getting Started

Initialize Toolbox

Add the @Chromatography folder to your MATLAB path and run the following code in the MATLAB command window:

obj = Chromatography();

Find out which version is currently installed using the command below:

obj.version

ans =

    '0.1.51'

Load Data

Import raw data files into the MATLAB workspace:

% Import Agilent '.D' files
data = obj.import('.D');

% Append data with Thermo '.RAW' files
data = obj.import('.RAW', 'append', data);

Baseline Correction

Calculate baselines for the total ion chromatograms (TIC) in all samples:

data = obj.baseline(data,...
    'samples',    'all',...
    'ions',       'tic',...
    'smoothness', 1E7,...
    'asymmetry',  5E-6);

Smoothing

Apply a smoothing filter to the total ion chromatograms (TIC) in all samples:

% Small amount of smoothing
data = obj.smooth(data,...
    'samples',    'all',...
    'ions',       'tic',...
    'smoothness', 10,...
    'asymmetry',  0.5);

% Heavy amount of smoothing
data = obj.smooth(data,...
    'samples',    'all',...
    'ions',       'tic',...
    'smoothness', 1000,...
    'asymmetry',  0.5);

Reset Data

Reset data to its original state with the command:

data = obj.reset(data);

Plotting

Plot all total ion chromatograms (TIC) in a stacked layout:

fig = obj.visualize(data,...
    'samples',  'all',...
    'ions',     'tic',...
    'layout',   'stacked',...
    'scale',    'normalized',...
    'xlim',     [5,45],...
    'colormap', 'jet',...
    'legend',   'on');

Plot the total ion chromatogram (TIC) for a single sample and save as a JPG (400 DPI):

fig = obj.visualize(data,...
    'samples', 4,...
    'ions',    'tic',...
    'xlim',    [2,50],...
    'color',   'black',...
    'legend',  'on',...
    'export',  {'MyFileName', '-djpeg', '-r400'});

Plot selected extracted ion chromatograms (XIC) for selected samples and save as a PNG (150 DPI):

fig = obj.visualize(data,...
    'samples',  [1:2,6,9:10],...
    'ions',     [10:50,55,59,100:200],...
    'layout',   'stacked',...
    'scale',    'full',...
    'xlim',     [10,30],...
    'colormap', 'winter',...
    'legend',   'on',...
    'export',   {'MyFileName', '-dpng', '-r150'});

chromatography's People

Contributors

chemplexity avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chromatography's Issues

Premature termination in delta compression decode

if bitshift(buffer(1), 12, 'int16') == 0

Thank you for this code, I can't express how much time this has saved me in not dealing with Chemstation software directly. I'm noticing a small bug when decoding HPLC files (file ID 130). If buffer(1) is a factor of 16, the last four bits are all zero ending the decode and truncating the data. The program only checks the last 4 bits--is there a reason why it doesn't look at the entire int16 number it loads into buffer(1)? I don't have access to every type of .ch file but I can only find one case out of tens of thousands of files where the last two bytes aren't zero, an obviously corrupt file.

I checked 23913 ".ch" files from several different types of detectors (DAD, FLD and RID) and it seems to occur in some RID1A.ch and DAD1A.ch files, 541 out of 12093 times for RID1A and 109 out of 5620 times for DAD1A.

I changed the line to
if buffer(1) == 0
and it seems to work, but I don't know if this would break compatibility with some other file types.

Question for loading data from Thermo Fisher MS

Hello,

I really like this software and have been looking for something like it for some time. I was attempting to load a thermo fisher file (.raw) and got the error:

Input data of type 'V.66' is currently unsupported.
[1/1] Error loading 'D:\Graduate Work\Project Work\Matlab Tools\playground\Blank_ACN_1.raw'
Unable to import selection

does that mean that it would not work for this specific .raw file or is there a way to change syntax to resolve this?

thanks!

Export

Good Morning!

I need to export the Time and Signal column, but when I go to the export code this gives this error, which is in the image. Is it possible for me to export only these two columns in a .CSV file?

Thanks!!!

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.