diff --git a/tests/tests.yaml b/tests/tests.yaml index b165de09..61a88408 100644 --- a/tests/tests.yaml +++ b/tests/tests.yaml @@ -217,7 +217,7 @@ dedup_single_tag_missing: stdin: chr19_tag_missing.bam outputs: [stdout] references: [single_tag_missing_py3.sam] - options: dedup -L test_missing.log --out-sam --random-seed=123456789 --method=directional --umi-tag=RX --extract-umi-method=tag + options: dedup -L test_missing.log --out-sam --random-seed=123456789 --method=directional --umi-tag=RX --extract-umi-method=tag --output-stats=stats_tag_missing dedup_single_gene_tag: stdin: chr19_gene_tags.bam @@ -311,11 +311,11 @@ group_paired_use_unmapped: references: [paired_group_use_unmapped.sam] options: group -L test.log --out-sam --random-seed=123456789 --method=directional --no-sort-output --output-bam --unmapped=use --paired -### Tests to implement #### +# ### Tests to implement #### -## dedup ## -# mapping-quality (Need a BAM with meaningful MAPQ) -# paired end (obv. need a paired end BAM) -# read-length (ideally with sRNA-Seq BAM?!) +# ## dedup ## +# # mapping-quality (Need a BAM with meaningful MAPQ) +# # paired end (obv. need a paired end BAM) +# # read-length (ideally with sRNA-Seq BAM?!) -# unpaired reads (Need a BAM with mixed paired and single end reads) +# # unpaired reads (Need a BAM with mixed paired and single end reads) diff --git a/umi_tools/umi_methods.py b/umi_tools/umi_methods.py index 3d766d80..d289e3bb 100644 --- a/umi_tools/umi_methods.py +++ b/umi_tools/umi_methods.py @@ -149,6 +149,7 @@ def __init__(self, bamfile, chrom, barcode_getter): self.umis = collections.defaultdict(int) self.barcode_getter = barcode_getter self.random_fill_size = 100000 # Higher = faster, more memory + self.first_kerror = 1 self.fill() def refill_random(self): @@ -169,7 +170,10 @@ def fill(self): if read.is_read2: continue - self.umis[self.barcode_getter(read)[0]] += 1 + try: + self.umis[self.barcode_getter(read)[0]] += 1 + except KeyError: + continue self.umis_counter = collections.Counter(self.umis) total_umis = sum(self.umis_counter.values()) diff --git a/umi_tools/version.py b/umi_tools/version.py index 5becc17c..5c4105cd 100644 --- a/umi_tools/version.py +++ b/umi_tools/version.py @@ -1 +1 @@ -__version__ = "1.0.0" +__version__ = "1.0.1"