You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-15Lines changed: 16 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,17 +9,19 @@ Originally designed to count patterns in DNA sequences with ambiguous bases as d
9
9
10
10
## Usage
11
11
12
-
> [!IMPORTANT]
13
-
> While the query sequences can all be different lengths, currently `Pattern Buffer` only supports counting these patterns on sequences that are all the same length.
14
-
15
12
`Pattern Buffer` can be used with a broadly functional or object-oriented (OO) interface, with the functional interface geared towards one-time use and the OO interface for use multiple times (i.e. file parsing or PyTorch DataLoaders).
16
13
17
14
To demonstrate, we'll first create some sample sequences and queries. As we're using IUPAC nucleotide sequences, we can use the provided `generate_iupac_embedding` function to provide the embedding tensor.
18
15
19
16
```python
20
17
from pattern_buffer import generate_iupac_embedding
or create an instance of the `PatternBuffer` class, and use the `.count` method to count occurrences in new sequences. This has the advantage of not re-calculating the query embeddings or the `support` tensor each time, so is well suited for fast repeated counting:
@@ -41,20 +43,19 @@ or create an instance of the `PatternBuffer` class, and use the `.count` method
- Currently, the program expects all input sequences to have the same length, but queries can already be different lengths.
53
54
- If all of your patterns contain unique (non-ambiguous) characters then this encoding scheme is likely overkill and other software would be more efficient.
54
55
- The software is designed for use with GPU acceleration, and will likely under-perform on CPU when compared to CPU-optimised counting schemes.
55
56
56
57
## Future work
57
58
58
-
-[] Allow dynamic input lengths with padding
59
+
-[x] Allow dynamic input lengths with padding
59
60
-[ ] Automatic encoding detection from pattern analysis
0 commit comments