Skip to content
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

Documentation? #47

Open
blex-max opened this issue Mar 4, 2022 · 4 comments
Open

Documentation? #47

blex-max opened this issue Mar 4, 2022 · 4 comments

Comments

@blex-max
Copy link

blex-max commented Mar 4, 2022

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?

@jkbonfield
Copy link
Owner

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.

@blex-max
Copy link
Author

blex-max commented Mar 4, 2022

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

@blex-max blex-max closed this as completed Mar 4, 2022
@blex-max
Copy link
Author

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 blex-max reopened this May 11, 2022
@jkbonfield
Copy link
Owner

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.

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

2 participants