Skip to content

Commit ac7eaa0

Browse files
committed
Updated docs
1 parent 626d885 commit ac7eaa0

4 files changed

Lines changed: 67 additions & 16 deletions

File tree

README.rst

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ A script to extract data from UNICORN result (.res) files and plot them.
66
.. image:: https://raw.githubusercontent.com/pyahmed/PyCORN/master/samples/sample1_2009Jun16no001_plot.jpg
77

88

9-
A script to extract data from .res (results) files generated by UNICORN
10-
Chromatography software supplied with AKTA Systems. This script will
11-
find all data blocks, extract the data and write out csv-files. If you
12-
have matplotlib installed it will also plot all the curves including
13-
fractions if present. Plots can be saved in any format supported by
14-
matplotlib (default is pdf).
9+
A script to extract data from .res (results) files generated by UNICORN Chromatography software supplied with AKTA Systems. This script will
10+
find all data blocks, extract the data and write out csv-files. If you have matplotlib installed it will also plot all the curves including
11+
fractions if present. Plots can be saved in any format supported by matplotlib (default is pdf). Alternatively you may import pycorn into your script and access the data inside res-files.
12+
13+
Installation:
14+
15+
- pip install pycorn
1516

1617
Limitations:
1718

@@ -24,7 +25,9 @@ Requirements:
2425

2526
Usage:
2627

27-
- See docs/USAGE.txt
28+
- See docs/USAGE_pycorn-bin.txt if you want to extract/plot data directly
29+
- See docs/USAGE_pycorn_module.txt if you want to use it as module
30+
2831

2932
License:
3033

docs/CHANGES.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
v0.13
2+
======
3+
- Conversion to of PyCORN to class-structure, allows using PyCORN in other scripts (by Wendell Smith)
4+
- Plots are now UV + user selectable 2nd/3rd data block (2nd y-axis is Conductivity by default)
5+
- Made some changes to adapt for PyPI
6+
- Installation should place pycorn-bin.py in Python/Scripts-folder
7+
18
v0.12
29
======
310
- Logbook is extracted and written to txt-file

docs/USAGE.txt renamed to docs/USAGE_pycorn-bin.txt

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
How to use PyCORN
2-
=================
2+
3+
PyCORN may be used either via the pycorn-bin.py-script or imported as a module in your scripts (see USAGE_pycorn_module.txt).
4+
5+
pycorn-bin.py:
6+
--------------
7+
The default installation places pycorn-bin.py in the python/scripts-folder and therefor ready-to-use on most platforms. This script re-implements most of the features of the original pycorn.py-script. Usage is very similar, as only a few paramters have changed.
8+
9+
310
usage: pycorn-bin.py [-h] [-c] [-n] [-i #] [-r #] [-t] [-e] [-p]
411
[--no_fractions] [--xmin #] [--xmax #] [--par1 PAR1]
512
[--par2 PAR2]
@@ -46,26 +53,26 @@ z,tif,tiff,jpg,jpeg,png,ps,eps,raw,rgba,pdf,pgf}
4653
etc.). Default is 300.
4754

4855
Notes:
49-
By default PyCORN will plot from first to last fraction, as that is usually the interesting part. If no fractions are present in the run then from beginning to end. To override this behaviour you can use the (both) optional --xmin/--xmax switches to specify beginning and of the plot.
56+
By default pycorn-bin.py will plot from first to last fraction, as that is usually the interesting part. If no fractions are present in the run then from beginning to end. To override this behaviour you can use the (both) optional --xmin/--xmax switches to specify beginning and end of the plot.
5057

5158
Examples:
5259
Show user who ran method:
53-
pycorn.py -u input.res
60+
pycorn-bin.py -u input.res
5461

5562
Show injection points:
56-
pycorn.py -t input.res
63+
pycorn-bin.py -t input.res
5764

5865
Extract data to csv files:
59-
pycorn.py -e input.res
66+
pycorn-bin.py -e input.res
6067

6168
Plot all data:
62-
pycorn.py -p input.res
69+
pycorn-bin.py -p input.res
6370

6471
Extract/plot data and adjust retention volume to injection point 1 (counting starts at 0!):
65-
pycorn.py -p -e -i 1 input.res
72+
pycorn-bin.py -p -e -i 1 input.res
6673

6774
Plot every third value:
68-
pycorn.py -p -r 3 input.res
75+
pycorn-bin.py -p -r 3 input.res
6976

7077
Plot from 100 to 200ml:
71-
pycorn.py -p --xmin 100 --xmax 200 input.res
78+
pycorn-bin.py -p --xmin 100 --xmax 200 input.res

docs/USAGE_pycorn_module.txt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Using the pycorn module:
2+
3+
# Importing the module
4+
from pycorn import pc_res3
5+
6+
# Create an instance of the pycorn object, there are a couple of options that can be specified:
7+
# file_name = file name of the res-file that you want to load
8+
# reduce = integer to only read every n sample (similar to the option found in UNICORN during export to asc)
9+
# inj_sel = which injection point to use as zero-rentention. By default the last injection point is used (same as in UNICORN)
10+
11+
# Create the instance using default options
12+
my_res_file = pc_res3("sample1.res")
13+
14+
# Parse the file
15+
my_res_file.load()
16+
17+
# Show available data
18+
print(list(my_res_file.keys()))
19+
20+
>>>[u'CreationNotes', u'Logbook', u'UV', u'Cond', u'pH', u'Pressure', u'Temp', u'Conc', u'Fractions']
21+
22+
# The above list is your key to access the data inside the file
23+
# my_res_file[key][value] value can be:
24+
# data: contains the actual data, either pure text or a list with x/y-pairs as tuples
25+
# unit: the unit for this data block (mAu, ms/cm etc.)
26+
# run_name: an internal name (like "Manual Run 8")
27+
28+
# For example to read-out the the unit for the UV-block:
29+
my_res_file['UV']['unit']
30+
31+
# To read the actual UV-data:
32+
x = my_res_file['UV']['data']
33+
print(x[0:3])
34+
>>>[(0.0, -9.22), (0.06, -0.007), (0.13, -0.004)]

0 commit comments

Comments
 (0)