Did I find the right examples for you? yes no      Crawl my project      Python Jobs

# Bio.SeqUtils.GC

All Samples(18)  |  Call(9)  |  Derive(0)  |  Import(9)
```Calculates G+C content, returns the percentage (float between 0 and 100).

Copes mixed case sequences, and with the ambiguous nucleotide S (G or C)
when counting the G and C content.  The percentage is calculated against
the full length, e.g.:

>>> from Bio.SeqUtils import GC
>>> GC("ACTGN")
40.0
(more...)
```

```        def GC(seq):
"""Calculates G+C content, returns the percentage (float between 0 and 100).

Copes mixed case sequences, and with the ambiguous nucleotide S (G or C)
when counting the G and C content.  The percentage is calculated against
the full length, e.g.:

>>> from Bio.SeqUtils import GC
>>> GC("ACTGN")
40.0

Note that this will return zero for an empty sequence.
"""
try:
gc = sum(seq.count(x) for x in ['G', 'C', 'g', 'c', 'S', 's'])
return gc*100.0/len(seq)
except ZeroDivisionError:
return 0.0
```

```
from Bio.Seq import reverse_complement, translate
from Bio.SeqUtils import GC

```
```    def gc(self, seq):
"""Returns a float between 0 and 100."""
return GC(seq)

def gcframe(self, seq, translation_table=1):
```

```
from Bio.Seq import reverse_complement, translate
from Bio.SeqUtils import GC

```
```    def gc(self, seq):
"""Returns a float between 0 and 100."""
return GC(seq)

def gcframe(self, seq, translation_table=1):
```

```from Bio.Alphabet.IUPAC             import ambiguous_dna
from Bio.SeqRecord                  import SeqRecord
from Bio.SeqUtils                   import GC
from Bio.SeqUtils.MeltingTemp       import Tm_staluc
from Bio.SeqFeature                 import SeqFeature
```
```        # ing temperature for DNA amplification in vitro
# http://www.ncbi.nlm.nih.gov/pubmed/2003928
GC_prod=GC(str(self.seq))
tml = min(self.tmf,self.tmr)
#print GC(str(self.product.seq)), self.saltc/1000.0, len(self.product)
tmp = 81.5 + 0.41*GC(str(self.seq)) + 16.6*log10(self.saltc/1000.0) - 675/len(self)
```

```from Bio.Alphabet.IUPAC             import ambiguous_dna
from Bio.SeqRecord                  import SeqRecord
from Bio.SeqUtils                   import GC
from Bio.SeqUtils.MeltingTemp       import Tm_staluc
from Bio.SeqFeature                 import SeqFeature
```
```        # ing temperature for DNA amplification in vitro
# http://www.ncbi.nlm.nih.gov/pubmed/2003928
GC_prod=GC(str(self.product.seq))
tml = min(self.tmf,self.tmr)
#print GC(str(self.product.seq)), self.saltc/1000.0, len(self.product)
tmp = 81.5 + 0.41*GC(str(self.product.seq)) + 16.6*log10(self.saltc/1000.0) - 675/len(self.product)
```

```
from Bio import SeqIO
from Bio.SeqUtils import GC

from BCBio import GFF
```
```    for rec in SeqIO.parse(fastafile, "fasta"):
out_dict[rec.id] = {}
out_dict[rec.id]["GC"] = GC(rec.seq)
out_dict[rec.id]["length"] = len(rec.seq)

```

```
from Bio import SeqIO
from Bio.SeqUtils import GC
import sys

def contig_stat(fn, rec):
cols = rec.id.split("_")
return "%s\t%s\t%s\t%s\t%s" % (fn, rec.id, len(rec), GC(rec.seq), cols[5])
```

```		self.length = len(fastaRecord.seq)
self.description=fastaRecord.description
self.gc=SeqUtils.GC(fastaRecord.seq)
self.crc32=CheckSum.crc32(fastaRecord.seq)

```

```'''
from operator import itemgetter
from Bio.SeqUtils import GC
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
```

```from Bio.Seq import Seq, MutableSeq
from Bio.SeqRecord import SeqRecord
from Bio.SeqUtils import GC, seq1, seq3
from Bio.SeqUtils.lcc import lcc_simp, lcc_mult
from Bio.SeqUtils.CheckSum import crc32, crc64, gcg, seguid
```

```from Bio.Seq import Seq, MutableSeq