pyahmed / PyCORN

A script to extract data from ÄKTA/UNICORN result-files (.res)
47 stars 26 forks source link

Pycorn does not recognize injection points properly #12

Closed misterlf closed 7 years ago

misterlf commented 8 years ago

Hi,

I have a unicorn file with multiple injections points. However Pycorn is not able to properly recognize the injection points. In fact, it does recognize two injection points. However, these are not at the correct volume position and there are actually more than just two injection points. Any ideas on how to fix that?

I'm happy to provide the .res where the injections are not properly recognized.

misterlf commented 8 years ago

The injections points are getting correctly written in the .csv that I can generate via PyCorn but the -t option does not properly recognize them!

pyahmed commented 8 years ago

I'm happy to provide the .res where the injections are not properly recognised.

Yes, please provide the res file, that will make it easier to debug.

misterlf commented 8 years ago

The file is zipped because GitHub does not allow the direct upload of .res files. I tried the module mode and I got the correct data. The pycorn-bin.py seems to create the problem.

Thank you, Ahmed!

161009_GF_Runs.res.zip

misterlf commented 8 years ago

The correct positions should be: 0.0, 0.0, 2.39, 5.22, 8.2, 8.2, and 11.16. Pycorn-bin.py with -t option recognizes 0 and 2.46.

pyahmed commented 8 years ago

OK - I will take a look.. once I have time ;-)

misterlf commented 8 years ago

Cool! This would make things a lot easier.

Thank you.

pyahmed commented 8 years ago

I had a look with a HEX-viewer. Injection points are at (absolute mL): 2.46 2.46 4.85 7.68 10.66 10.66 13.62

The module mode gets it wrong as well if you do:

from pycorn import pc_res3
myres = pc_res3("d:/161009_GF_Runs.res")
myres.load()
print(myres.injection_points)

gives:

[0.0, 2.46]

But they are correctly read out from the file by the pycorn class: print(myres['Inject']['data'])

which returns: [(0.0, '3'), (0.0, '3'), (2.39, '3'), (5.22, '3'), (8.2, '3'), (8.2, '3'), (11.16, '3')]

So when doing full-extraction meta1_read is only called twice (for 0.0 and 2.46).. need to investigate further..

misterlf commented 8 years ago

Okay. Sounds good. I looked in your source but couldn't really find the problem. I also barely know how to run scripts...

misterlf commented 8 years ago

In def inject_det in the pycorn.py you only call two variables (for x,y) could that be a problem?

pyahmed commented 8 years ago

This should be fixed with the latest dev-version. If you don't want to wait for me updating the PyPI package then just replace current pycorn.py with the one from dev-branch ( https://github.com/pyahmed/PyCORN/commit/dcb350cd6c3e6f4c3d1765912d5bdb8e42687db1 ).

Thanks for reporting :-)

misterlf commented 8 years ago

Works like a charm. Thank you very much for your hyper fast fix!

pyahmed commented 7 years ago

Merged & Uploaded to PyPI.