Skip to content
Snippets Groups Projects
Commit f1d462b6 authored by Bertrand  NÉRON's avatar Bertrand NÉRON
Browse files

remove useles float casting in gc_percent

parent 919f6144
No related branches found
No related tags found
No related merge requests found
Pipeline #157788 passed
def gc_percent(seq): def gc_percent(seq):
""" """
Compute the ratio of GC in a DNA sequence
:param seq: The nucleic sequence to compute :param seq: The nucleic sequence to compute
:type seq: string :type seq: string
:return: the percent of GC in the sequence :return: the percent of GC in the sequence
:rtype: float :rtype: float
""" """
seq = seq.upper() 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 return gc_pc
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment