<?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 calculate GC content !]]></title>
	<link>https://bioinformaticsonline.com/snippets/view/44429/raku-script-to-calculate-gc-content?</link>
	<atom:link href="https://bioinformaticsonline.com/snippets/view/44429/raku-script-to-calculate-gc-content?" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/44429/raku-script-to-calculate-gc-content</guid>
	<pubDate>Sun, 14 Jan 2024 11:56:51 -0600</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/44429/raku-script-to-calculate-gc-content</link>
	<title><![CDATA[Raku script to calculate GC content !]]></title>
	<description><![CDATA[<code>sub calculate-gc-content(Str $sequence) {
    my $gc-count = $sequence.comb(/&lt;[GCgc]&gt;/).elems;
    my $total-bases = $sequence.chars;

    return $gc-count / $total-bases * 100;
}

my $dna_sequence = &quot;ATGCGCTAAAGCGCGCGCCTTACGCGCGCGCGC&quot;;
my $gc_content = calculate-gc-content($dna_sequence);

say &quot;DNA Sequence: $dna_sequence&quot;;
say &quot;GC Content: $gc_content%&quot;;</code>]]></description>
	<dc:creator>LEGE</dc:creator>
</item>

</channel>
</rss>