<?xml version='1.0'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:atom="http://www.w3.org/2005/Atom" >
<channel>
	<title><![CDATA[BOL: Raku script to find repeats in sequences !]]></title>
	<link>https://bioinformaticsonline.com/snippets/view/44452/raku-script-to-find-repeats-in-sequences?</link>
	<atom:link href="https://bioinformaticsonline.com/snippets/view/44452/raku-script-to-find-repeats-in-sequences?" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/44452/raku-script-to-find-repeats-in-sequences</guid>
	<pubDate>Thu, 01 Feb 2024 01:56:36 -0600</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/44452/raku-script-to-find-repeats-in-sequences</link>
	<title><![CDATA[Raku script to find repeats in sequences !]]></title>
	<description><![CDATA[<code>sub find-repeats($sequence, $min-repeat-length = 3) {
    my @repeats;

    for ^($sequence.chars - $min-repeat-length + 1) -&gt; $i {
        my $substring = $sequence.substr($i, $min-repeat-length);

        if $sequence.contains($substring) &gt; 1 &amp;&amp; $substring !~~ any(@repeats) {
            @repeats.push($substring);
        }
    }

    return @repeats;
}

# Example usage
my $genome-sequence = &quot;ATCGATCGATCGATCG&quot;;
my @result = find-repeats($genome-sequence);

say &quot;Repeats found: &quot;, @result;</code>]]></description>
	<dc:creator>LEGE</dc:creator>
</item>

</channel>
</rss>