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
Branches
Tags
No related merge requests found
Pipeline #157788 passed
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment