goldilocks
goldilocks copied to clipboard
ZeroDivisionError when FA contains no valid sequences
nope.fa
>NO
>OP
nope.fa.idx
NO 0 4 -1 -1
OP 0 8 -1 -1
nope.py
from goldilocks.goldilocks import Goldilocks
from goldilocks.strategies import NucleotideCounterStrategy
data = {
"seq": {
"idx": "nope.fa.idx"
}
}
g = Goldilocks(NucleotideCounterStrategy(["A"]), data, length=3, stride=1, is_faidx=True)
g.query("mean", track="A", limit=5).export_meta(sep="\t")
File "/home/sam/Projects/Packages/goldilocks/goldilocks/goldilocks.py", line 525, in __apply_filter_func
mean_percentile = (len(track_scores[track_scores <= 0]) / float(len(track_scores))) * 100
ZeroDivisionError: float division by zero