def output_sequences(d, connect, fn):
    """Output sequences in Joe's format."""
    f = open(fn, 'w')
    for struct in list(d.structs.values()):
        f.write('%d:%s\n' % (0, struct.name))
        gc_content = (struct.seq.count('C') + struct.seq.count('G')) / (len
            (struct.seq) - len(struct.strands))
        f.write('%s %f %f %d\n' % (struct.seq, 0, gc_content, 0))
        f.write('%s\n' % struct.struct)
        f.write('%s\n' % struct.mfe_struct)
    for seq in list(d.seqs.values()):
        f.write('%d:%s\n' % (0, seq.name))
        gc_content = (seq.seq.count('C') + seq.seq.count('G')) / seq.length
        f.write('%s %f %f %d\n' % (seq.seq, 0, gc_content, 0))
        f.write(('.' * seq.length + '\n') * 2)
        seq = seq.wc
        f.write('%d:%s\n' % (0, seq.name))
        f.write('%s %f %f %d\n' % (seq.seq, 0, gc_content, 0))
        f.write(('.' * seq.length + '\n') * 2)
    f.write('Total n(s*) = %f' % 0)
    f.close()
