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

Implement a SequenceTyper #75

Open
apetkau opened this issue Jul 27, 2021 · 0 comments
Open

Implement a SequenceTyper #75

apetkau opened this issue Jul 27, 2021 · 0 comments
Labels
enhancement New feature or request kmer Kmer based analysis mlst MLST analysis variant/mutation Variant/mutation based analysis

Comments

@apetkau
Copy link
Owner

apetkau commented Jul 27, 2021

Since I have access to mutations/mlst/kmers (sketches) I can take advantage of all of these to do sequence typing.

So, one idea is to implement a SequenceTyper class which gets passed to my query API. For example, say I wanted to type sequences based on mutations (e.g., https://github.com/cov-lineages/constellations of SARS-CoV-2). I could create a class like so:

class SARSCov2ConsellationsTyper(SequenceTyper):

    def type_query(sequence_type: str, query: SamplesQuery) -> SamplesQuery:
        samples_with_mutations = query
        for mutation in get_mutations_for_sequence_type(sequence_type):
            samples_with_mutations = samples_with_mutations.hasa(mutation)
            # Actual implementation requires counting mutations to account for missing data
        return samples_with_mutations

Where type_query() is a method to implement to select samples of a particular type.

This could then be used as:

sarscov2_typer = SARSCov2ConstellationsTyper.create(input_data)
delta_samples = query.isa('Delta', kind=sarscov2_typer)
# delta_samples now contains a selection of samples which are of type "Delta"

This wouldn't be limited to mutations/SARS-CoV-2 though. I could do the same thing with MLST results, with kmer sketches, with phylogenetic trees, with attached metadata, or a combination of all of them.

@apetkau apetkau added the enhancement New feature or request label Jul 27, 2021
@apetkau apetkau added kmer Kmer based analysis mlst MLST analysis variant/mutation Variant/mutation based analysis labels Aug 11, 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 kmer Kmer based analysis mlst MLST analysis variant/mutation Variant/mutation based analysis
Projects
None yet
Development

No branches or pull requests

1 participant