CIRDLES / Calamari

Reimplementation of data reduction from Ludwig's Squid 2.50 for SHRIMP mass spectrometers.
Apache License 2.0
1 stars 7 forks source link

Replace header of Prawn files with new header for validation. #33

Closed bowring closed 8 years ago

bowring commented 8 years ago

The current header of Prawn files produced by Shrimp software is invalid. The header should be replaced with the following header in order to perform validation against the current schema. Saving the changed file might be an option for the user. Later, if the schema moves to another location, this functionality can be adapted.

<?xml version="1.0"?>
<!-- SHRIMP SW PRAWN Data File -->
<prawn_file xmlns="https://raw.githubusercontent.com"
            xmlns:xs="http://www.w3.org/2001/XMLSchema"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="https://raw.githubusercontent.com
                                https://raw.githubusercontent.com/bowring/XSD/master/SHRIMP/SHRIMP_PRAWN.xsd">
johnzeringue commented 8 years ago

Is it better to leave the file unchanged and do something like this instead?

bowring commented 8 years ago

The problem is the files come with bad headers that point to non-existent schema (they never validate the files with current software). So the bad header has to be stripped out and at that point, it is easier to replace it.

johnzeringue commented 8 years ago

I guess my thought was that keeping things read-only as far as Calamari is concerned simplifies matters. Do we want to add file management as a responsibility?

Also, could you send me an example of one of these files?

bowring commented 8 years ago

Yeah, so I drafted some code that reads the file, replaces the header, writes it out to a temp and then sends the temp along for processing, then deletes the temp - works well even on files that have already been fixed. Then the user's files aren't changed.

Also, I think I am going to remove the option for reading in a file from a URI as an unrealistic possibility for our users.

see attached file

On Sun, Aug 7, 2016 at 12:23 PM, John Zeringue notifications@github.com wrote:

I guess my thought was that keeping things read-only as far as Calamari is concerned simplifies matters. Do we want to add file management as a responsibility?

Also, could you send me an example of one of these files?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bowring/Calamari/issues/33#issuecomment-238091881, or mute the thread https://github.com/notifications/unsubscribe-auth/ABCtY-0ZivheFI8TILEVCi7vTuNNEnV2ks5qdgaXgaJpZM4JZDHm .

johnzeringue commented 8 years ago

👍 I understand now. That all sounds good.