%%file dna_analysis.py """Code for analyzing DNA sequences""" from __future__ import division def get_gc_content(seq): """Determine the GC content of a sequence""" seq = seq.upper() gc_content = 100 * (seq.count('G') + seq.count('C')) / len(seq) return gc_content %%file test_dna.py from dna_analysis import get_gc_content def test_get_gc_content_zero(): assert get_gc_content('ATTATTAAA') == 0 def test_get_gc_content_lowercase(): assert get_gc_content('atgcatgc') == 50 def test_get_gc_content_multiline(): sequence = """atta gccg attt cccg""" assert get_gc_content(sequence) == 50 !nosetests