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

Function to compress / decompress sequence only #10

Open
jguhlin opened this issue Oct 12, 2020 · 2 comments
Open

Function to compress / decompress sequence only #10

jguhlin opened this issue Oct 12, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@jguhlin
Copy link

jguhlin commented Oct 12, 2020

Is there or could there be a function to compress / decompress sequence only? I have a format I'm using as a replacement for FASTA now, and using zstd as the sequence compression (seq ID's are not compressed). If you could expose a function to do compression/decompression or point me to the right place, I could include naf as an option there.

Thanks

@KirillKryukov
Copy link
Owner

You can compress nameless sequence using naf. Just leave the IDs empty and it will work fine. You can have one or many such nameless sequences in a naf archive without problem. As for decompressing, "unnaf --seq" produces just the sequence (without IDs, and all sequences are concatenated into one). Also "unnaf --sequences" produces sequences one per line (without IDs).

There's no API currently, but naf code is relatively tiny and straightforward. I guess the relevant code could be embedded into your project if you'd like to avoid calling an external binary and streaming the data back and forth. It would be nice if you supported naf as option in your format, and I'll be glad to help if you need adjustment from my side.

@jguhlin
Copy link
Author

jguhlin commented Oct 13, 2020

Thanks, I'll see if I can convert the code / embed it somehow. As it's definitely a for-speed algo I don't want to do any streaming. Will reach out if I need anything! Cheers

@KirillKryukov KirillKryukov added the enhancement New feature or request label Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants