Skip to content

multiple chromatograms within one res file #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
hefemehl opened this issue Feb 14, 2018 · 10 comments
Open

multiple chromatograms within one res file #18

hefemehl opened this issue Feb 14, 2018 · 10 comments

Comments

@hefemehl
Copy link

Nice script! I used it to export a lot of curve data from unicorn res files to xlsx files, and it worked greatly! But each of my res files contains three distinct chromatograms (created by the unicorn 5.3.1. 'new_chromatogram' command). The script only exports the data from the last chromatogram, thus the extracted values start at i.e. 42 ml instead of 0 ml.
Is there a way to export the remaining chromatogramms too?

Many thanks in advance for your support!

@dobrevnm
Copy link

Hi,
if I remember correctly you will need to adjust the injection point. You can see all your injection points if you use the argument -t, and then with -i you can set it to the right one. By default the script will plot/extract only the data for the last injection point. I hope it works for you in this way.

@pyahmed
Copy link
Owner

pyahmed commented Mar 5, 2018

Has this resolved your issue? If not you can always provide a sample file and I can take a look at it :-)

@hefemehl
Copy link
Author

hefemehl commented Apr 4, 2018

Thanks for your response!
But I'm sorry, it didn't work. Creating multiple chromatograms within one res file doesn't create multiple injection points. Or at least I didn't see them. @pyahmed that would be nice, can I provide it to you per PN?

@pyahmed
Copy link
Owner

pyahmed commented Apr 4, 2018

Yes a sample file would be useful. I think you can just attach it to your reply here. Or if it is confidential then send it email etc.

@hefemehl
Copy link
Author

hefemehl commented Apr 4, 2018

I chose a meaningless example file. Its just a hetp determination but the acetone loading is not done by an injection valve. After flushing the column (chromatogram 1) a new chromatogram is created and the inlet valve switches for aceton loading (chromatogram 2)
I'm using the following script (also within the zip file, the code is taken from your script) and run it with spyder (anaconda). The corresponding xlsx file only contains the data from chromatogram 2.

@pyahmed
Copy link
Owner

pyahmed commented Apr 5, 2018

I had a look at the file. Each res file I had encountered so far had the entries at the beginning of the file, with the last entry always being "LogBook" (also see RES_files_layout.txt under pycorn/docs). The file you provided has multiple entries after "LogBook". At the moment the script only looks for entries until "LogBook" see line 94 of pycorn.py:

header_end = fread.find(self.LogBook_id) + 342

So yes it will not see the other run, I might be able to fix it on the weekend. I just have to figure out if there is a more generic solution or if the res files actually encode the number of entries somewhere.

PS: You can remove the file if you want.

@hefemehl
Copy link
Author

hefemehl commented Apr 5, 2018

Thanks! If you want I could provide more/other files for testing.

@pyahmed
Copy link
Owner

pyahmed commented Apr 5, 2018

I think it should be doable with this one - I get back to you if there are problems.

@asihjo
Copy link

asihjo commented Feb 17, 2021

Hello, has this problem been resolved? need the corrected script that can read all the chromatograms..

@euanmacinnes
Copy link

the fix for this is reasonably simple, it's actually a quirk of the file loader using a dictionary to read in the header offsets, the magic blocks with the same name get overridden, so the trick was to change the name:

There's a line, ~ around line # 113:

name = x['data_name']

change to:

x['original_data_name']=x['data_name']
name = x['data_name'] + "_" + str(x['adresse'])

Then you'll get unique sensor outputs in the array based off the data_name, plus the unique address in the file, so that multiple blocks from the same sensor won't override.

This then needs one additional fix, line 259:

self.run_name = self['Logbook']['run_name']

just comment this out

self.run_name = self['Logbook']['run_name']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants