From f1d462b6bcbb1d479255a9c8d6a535536c921272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bertrand=20N=C3=A9ron?= <bneron@pasteur.fr> Date: Thu, 5 Jun 2025 08:51:27 +0200 Subject: [PATCH] remove useles float casting in gc_percent --- source/_static/code/gc_percent.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/_static/code/gc_percent.py b/source/_static/code/gc_percent.py index 0f6575d..a9abe85 100644 --- a/source/_static/code/gc_percent.py +++ b/source/_static/code/gc_percent.py @@ -1,11 +1,13 @@ def gc_percent(seq): """ + Compute the ratio of GC in a DNA sequence + :param seq: The nucleic sequence to compute :type seq: string :return: the percent of GC in the sequence :rtype: float """ seq = seq.upper() - gc_pc = float(seq.count('G') + seq.count('C')) / float(len(seq)) + gc_pc = seq.count('G') + seq.count('C') / len(seq) return gc_pc -- GitLab