# Path: pmx/library.py
# PMX_DATA = os.path.join(os.path.dirname(__file__),'data')
# def pmx_data_file( filename ):


import sys,os
from pmx import *
from pmx.parser import *
from pmx import library
from pmx.mutdb import *
from pmx.geometry import *
	return('O')
    
def get_restype(r):
    if r.resname in ['DA','DT','DC','DG']:
        return 'DNA'
    elif r.resname in ['RA','RU','RC','RG']:
        return 'RNA'
    else: return 'PEPTIDE'

def read_script(fn):
    return read_and_format(fn,"is")

def int_input():
    inp = raw_input()
    try:
        inp = int(inp)
        return inp
    except:
        print 'You entered "%s" -> Try again' % inp
        return None

def check_residue_range(m, idx):
    valid_ids = range(1, len(m.residues)+1)
    if idx not in valid_ids: return False
    return True

def select_residue(m):
    valid_ids = range(1, len(m.residues)+1)
    print '\nSelect residue to mutate:'
    for i,r in enumerate(m.residues):

# Path: pmx/library.py
# PMX_DATA = os.path.join(os.path.dirname(__file__),'data')
# def pmx_data_file( filename ):


# Path: scripts/mutate.py
import sys,os
from pmx import *
from pmx.parser import *
from pmx import library
from pmx.mutdb import *
from pmx.geometry import *

	return('O')
    
def get_restype(r):
    if r.resname in ['DA','DT','DC','DG']:
        return 'DNA'
    elif r.resname in ['RA','RU','RC','RG']:
        return 'RNA'
    else: return 'PEPTIDE'

def read_script(fn):
    return read_and_format(fn,"is")

def int_input():
    inp = raw_input()
    try:
        inp = int(inp)
        return inp
    except:
        print 'You entered "%s" -> Try again' % inp
        return None

def check_residue_range(m, idx):
    valid_ids = range(1, len(m.residues)+1)
    if idx not in valid_ids: return False
    return True

def select_residue(m):
    valid_ids = range(1, len(m.residues)+1)
    print '\nSelect residue to mutate:'
    for i,r in enumerate(m.residues):

        if r.resname not in library._ions+library._water: 