Skip to content

Commit

Permalink
set 0 in profile for partially covered exons, affects exon counting and
Browse files Browse the repository at this point in the history
fixes #229
  • Loading branch information
andrewprzh committed Sep 3, 2024
1 parent fd6407d commit ab95731
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/long_read_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion tests/test_long_read_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = \
Expand Down

0 comments on commit ab95731

Please sign in to comment.