Skip to content

Commit 81f44aa

Browse files
Merge branch 'main' into celiosantosjr-patch-1
2 parents 2993803 + c59432b commit 81f44aa

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

macrel/data/scripts/count.ngl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
ngless "1.0"
22

3-
input = samfile(ARGV[1], name="MACREL")
3+
input = samfile(ARGV[1],
4+
name="MACREL")
45

56
# Keep only primary alignments
6-
filtered = select(input, keep_if=[is_primary(read)])
7+
filtered = select(input, keep_if=[{unique}])
78

89
# Count features from filtered alignments
910
counts = count(filtered,
1011
features=["seqname"],
1112
include_minus1=False,
12-
normalization={raw})
13+
normalization={raw},
14+
multiple={unique_only})
1315

14-
# Ensure integer counts
1516
counts = as_integer(round(counts))
1617
write(counts, ofile=ARGV[2])

0 commit comments

Comments
 (0)