io_lib icon indicating copy to clipboard operation
io_lib copied to clipboard

Documentation?

Open blex-max opened this issue 4 years ago • 4 comments

Hello, thanks for maintaining Staden/io_lib!

I'm trying to batch convert old v2 SCFs to v3, which I believe I can achieve with this library, but I can't find any documentation on how to get started with it - is it available anywhere? I see scramble is implemented as a command line utility, is there an equivalent for managing trace files?

blex-max avatar Mar 04 '22 14:03 blex-max

That's going back a bit in my memory! I had to hunt.

There's scf_update which has a -v option to control the version number. It's a very simple program which just reads an SCF, changes the version, and writes it back out again.

jkbonfield avatar Mar 04 '22 14:03 jkbonfield

You have no idea how much hassle you've saved me! Thanks a lot!

blex-max avatar Mar 04 '22 15:03 blex-max

I just wanted to double check the function of the -v flag - does it specify the version you want to change to, or the version you want to change from? If you have a folder containing scfs of both versions and you run the command, will it just ignore those that don't match? Thanks!

blex-max avatar May 11 '22 13:05 blex-max

It's the version you're writing too. From recollection the reading automatically detects the version and works either way.

As an example:

@ seq4c[io_lib/build.x8...]; ./progs/scf_update -v 2 ~/work/mut_data/000906_11cR.scf _.scf;ls -l _.scf;gzip < _.scf|wc -c;bzip2 < _.scf|wc -c
-rw-r--r-- 1 jkb team117 72823 May 11 15:10 _.scf
31241
26894
@ seq4c[io_lib/build.x8...]; ./progs/scf_update -v 3 ~/work/mut_data/000906_11cR.scf _.scf;ls -l _.scf;gzip < _.scf|wc -c;bzip2 < _.scf|wc -c
-rw-r--r-- 1 jkb team117 72823 May 11 15:10 _.scf
20558
14674

Personally though I'd recommend ZTR instead of SCF as it's natively compressed (instead of needing an external tool) and is smaller than either. The convert_trace tool can switch formats.

@ seq4c[io_lib/build.x8...]; ./progs/convert_trace scf ztr < _.scf > _.ztr;ls -l _.ztr
-rw-r--r-- 1 jkb team117 12146 May 11 15:10 _.ztr
@ seq4c[io_lib/build.x8...]; ./progs/convert_trace scf ztr3 < _.scf > _.ztr;ls -l _.ztr; #NB slower to encode and decode
-rw-r--r-- 1 jkb team117 11173 May 11 15:10 _.ztr

Io_lib can read them in the same way as SCFs obviously, but some third party tools will only accept SCFs.

jkbonfield avatar May 11 '22 14:05 jkbonfield