From 5a592a553b8b0162ae142a45da95042108d103a5 Mon Sep 17 00:00:00 2001 From: pratas <6882743+pratas@users.noreply.github.com> Date: Tue, 26 Sep 2023 15:34:05 +0100 Subject: [PATCH] fix bug of specific init with AAAAA... in sequence and kmer --- benchmark/Download_FASTA.sh | 3 --- src/repeats.c | 7 ++++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/benchmark/Download_FASTA.sh b/benchmark/Download_FASTA.sh index 9d9ca0c..98d5fda 100755 --- a/benchmark/Download_FASTA.sh +++ b/benchmark/Download_FASTA.sh @@ -25,6 +25,3 @@ cat DNACorpus/* | gto_fasta_from_seq -n "CORPUS" > CORPUS.fa # # ----------------------------------------------------------------------------- # -wget virus.fa -# -# diff --git a/src/repeats.c b/src/repeats.c index c6f864d..1cb93e8 100644 --- a/src/repeats.c +++ b/src/repeats.c @@ -127,8 +127,11 @@ int32_t StartRM(RCLASS *C, uint32_t m, uint64_t i, uint8_t r) if(last == 0) return 0; RM = &C->RM[m]; - uint64_t idx = rand() % C->T->nPos; + uint64_t idx = rand() % C->T->nPos; + if(E[idx] <= C->P->ctx+1) + return 0; + if(r == 0) // REGULAR REPEAT { if(E[idx] == 0) @@ -138,8 +141,6 @@ int32_t StartRM(RCLASS *C, uint32_t m, uint64_t i, uint8_t r) } else // INVERTED REPEAT { - if(E[idx] <= C->P->ctx+1) - return 0; RM->pos = E[idx] - C->P->ctx - 1; } }