diff --git a/src/long_read_profiles.py b/src/long_read_profiles.py index 73a0efe6..71347077 100644 --- a/src/long_read_profiles.py +++ b/src/long_read_profiles.py @@ -139,7 +139,8 @@ def construct_profile_for_features(self, read_features, mapped_region=(0, 0), po matched_features[read_pos].append(gene_pos) gene_pos += 1 elif overlaps(read_feature, isoform_feature): - intron_profile[gene_pos] = -1 + if self.absence_condition(mapped_region, isoform_feature): + intron_profile[gene_pos] = -1 gene_pos += 1 # eliminating non unique features diff --git a/tests/test_long_read_profile.py b/tests/test_long_read_profile.py index 8be455dc..49cba9d5 100644 --- a/tests/test_long_read_profile.py +++ b/tests/test_long_read_profile.py @@ -72,7 +72,9 @@ def test_intron_profile(self, known_features, gene_region, read_exons, polya_pos ([(20, 60), (90, 110), (180, 200)], (20, 200), [(20, 60), (90, 110)], -1, -1, 3, [1, 1, 0], [1, 1]), ([(20, 60), (90, 110), (180, 200)], (20, 200), [(90, 110), (180, 200)], - -1, -1, 3, [0, 1, 1], [1, 1]) + -1, -1, 3, [0, 1, 1], [1, 1]), + ([(20, 60), (90, 110), (180, 200)], (20, 200), [(20, 60), (90, 100)], + -1, -1, 3, [1, 0, 0], [1, -1]), ]) def test_exon_profile(self, known_features, gene_region, read_exons, polya_pos, polyt_pos, delta, expected_gene, expected_read): exon_profile_constructor = \