Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/designer_dna/oligos.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"complement",
"complement_py",
"gc",
"gc_py",
"manacher",
"nrepeats",
"nrepeats_py",
Expand Down Expand Up @@ -268,7 +269,7 @@ def nrepeats_py(sequence: str, n: int) -> int:
"""Calculate the longest substring of n repeating characters.

Args:
sequence (str): Nucleotide string or Series of string
sequence (str): Nucleotide sequence string.
n (int): stretch of k-mer to observe

Returns:
Expand Down Expand Up @@ -305,7 +306,15 @@ def nrepeats_py(sequence: str, n: int) -> int:


def gc_py(sequence: str) -> float:
"""Calculate gc content of a nucleotide sequence."""
"""Calculate gc content of a nucleotide sequence.

Args:
sequence (str): Nucleotide sequence string.

Returns:
(float) gc fraction content of sequence.

"""
length: float = float(len(sequence))

return length and (sequence.count("G") + sequence.count("C")) / length
Loading