Parvfect / HelixWorks

Code for the Channels and Decoding Methods
0 stars 1 forks source link

Fix Symbol Possibilites for the Reads #34

Closed Parvfect closed 10 months ago

Parvfect commented 10 months ago

All possible symbols compatible with motifs that are encountered - not at a symbol level

Parvfect commented 10 months ago

Take some time and think about it and do it. Here we go.

Parvfect commented 10 months ago

DONE!! Code is shit and needs to be verified but look at this

Image

The Threshold is around 4 and our decoder performs so much better than BEC! We are onto the finish line boys

Parvfect commented 10 months ago

Double check this method


def get_possible_symbols(reads, symbols, motifs, n_picks):

    reads = [set(i) for i in reads]
    symbol_possibilities = []
    for i in reads:

        # Will only work for the Coupon Collector Channel
        motifs_encountered = i
        motifs_not_encountered = set(motifs) - set(motifs_encountered)

        read_symbol_possibilities = []

        if len(motifs_encountered) == n_picks:
            read_symbol_possibilities = [get_symbol_index(symbols, motifs_encountered)]

        else:

            # The symbol possibilites are the motifs that are encountered in combination with the motifs that are not encountered

            remaining_motif_combinations = [set(i) for i in combinations(motifs_not_encountered, n_picks - len(motifs_encountered))]

            for i in remaining_motif_combinations:
                possibe_motifs = motifs_encountered.union(i)
                symbols = [set(i) for i in symbols]
                if possibe_motifs in symbols:
                    read_symbol_possibilities.append(get_symbol_index(symbols, motifs_encountered.union(i)))

        symbol_possibilities.append(read_symbol_possibilities)

    return symbol_possibilities
Parvfect commented 10 months ago

This will only work for the Coupon Collector Channel, will need to be changed for the Distracted CC case

Parvfect commented 10 months ago

Closing the Issue, going to make further changes in code optimization and generalization

rsokolovskii commented 10 months ago

Not sure why this line of code is where it is, seems to be done every time for no reason:

symbols = [set(i) for i in symbols]

Otherwise looks correct