-
Notifications
You must be signed in to change notification settings - Fork 0
Handling Bad Kmers
This section explains how to handle bad k-mers during counting.
Create empty table:
# New KmerCountTable object that will count 31-mers
kct = oxli.KmerCountTable(ksize=31)
You can fail on bad k-mers:
kct.consume('XXXCGGAGGAAGCAAGAACAAAATATTTTTTCATGGG', allow_bad_kmers=False)
>>>
Traceback (most recent call last):
...
ValueError: bad k-mer encountered at position 0
or skip them without raising an error (which is the default):
kct.consume('XXXCGGAGGAAGCAAGAACAAAATATTTTTTCATGGG', allow_bad_kmers=True)
#4
If you tolerate non-DNA characters with allow_bad_kmers=True
, then all of the valid k-mers will be counted, and all of the bad k-mers will be skipped:
kct.get("CGGAGGAAGCAAGAACAAAATATTTTTTCAT")
#2
kct.get("AGGAAGCAAGAACAAAATATTTTTTCATGGG")
#1
Installing Oxli
Basic Setup
For Developers
Getting Started
Getting Started
Counting Kmers
Basic Counting
Extracting from Files
Handling Bad Kmers
Looking up Counts
Single Kmer Lookup
Multiple Kmer Lookup
Removing Records Remove Kmers Abundance Filtering
Exploring Count Tables
Iterating Records
Attributes
Set Operations
Basic SetOps
Exporting Data
Histo: Export Frequency Counts
Dump: Write Hash:Count Pairs
Save and Load KmerCountTables