Skip to content

Commit

Permalink
fix biopython GC change in recent versions #1000
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Palmer committed Feb 25, 2024
1 parent 788e20f commit 4c2bbde
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions funannotate/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -2740,7 +2740,15 @@ def dict2nucleotides2(input, prots, trans, cdstrans):


def simpleFastaStats(fasta):
from Bio.SeqUtils import GC
try:
from Bio.SeqUtils import gc_fraction

def GC(sequence):
return 100 * gc_fraction(sequence, ambiguous="ignore")

except ImportError:
# Older versions have this:
from Bio.SeqUtils import GC
from Bio.SeqIO.FastaIO import SimpleFastaParser

contigs = []
Expand Down Expand Up @@ -9184,7 +9192,15 @@ def splitFASTA(input, outputdir):


def genomeStats(input):
from Bio.SeqUtils import GC
try:
from Bio.SeqUtils import gc_fraction

def GC(sequence):
return 100 * gc_fraction(sequence, ambiguous="ignore")

except ImportError:
# Older versions have this:
from Bio.SeqUtils import GC

lengths = []
GeeCee = []
Expand Down

0 comments on commit 4c2bbde

Please sign in to comment.