Skip to content

Sketch sequences in memory without writing to disk #75

Description

@tmaklin

Hi, I've been writing something that uses sketchlib to sketch a filtered set of reads. The current library works OK but requires first writing the filtered reads to a file, which is a little cumbersome in my case and takes extra disk space that I don't need for anything else in the application.

To get around this, I rewrote the sketching functions here: https://github.com/tmaklin/sketchlib.rust/tree/sketching-api by making the functions called from within sketch_files take an interator over the bases and (optional) quality scores in a record. This allows sketching a subset of reads by creating an iterator over the unfiltered set that only returns records that pass the filter. It should also work for a case where the sequence data never existed on disk in the first place, eg. inside tests.

If you think this would be useful to have in the main branch I can turn this into a pull request. There's a few other things that could also be useful in that case, such as replacing the strings that point to a file with PathBuf and creating an options structure for sketching that holds all the parameters with some defaults so I don't have to declare/remember all of them.

I didn't test webassembly or the 3di features but the branch passes all of the tests in your code.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions