#!/usr/bin/env python

from nanotechsoftware.base import *
from nanotechsoftware.chemistry import *
from nanotechsoftware.chemistry.framework import *
from nanotechsoftware.chemistry.core import *
from nanotechsoftware.chemistry.io import *

import textwrap
import os



mol = PDB(os.environ['EXAMPLESPATH'] + os.sep + 'Hemoglobin.pdb')

for p in ComponentIteratorFactory.create(Protein, mol) :
    print "Chain : "
    s = ""
    for c in ComponentIteratorFactory.create(Chain, p) :
        for r in ComponentIteratorFactory.create(Residue, c) :
            s = s + r.getName() + " "
        print textwrap.fill(s, width=40)
    print


