Exemplo n.º 1
0
import os
path = os.getcwd() + "/"
sys.path.append('../..')
from ctools.System import System
System._sys = System("Redone Sample")
print "System initialized\n"
f = open("DesmondToGromacsErrors.txt", "w")
for dir in os.listdir(path):
    if os.path.isdir("%s" % (dir)):
        for file in os.listdir("%s" % (dir)):
            if ".cms" in file:
                filename = string.rstrip(file, ".cms")
                print "\nReading in Desmond structure %s" % (filename)
                sys.path.append('../../ParserFiles')
                from ctools.DesmondExt.DesmondParser import DesmondParser
                DesmondParser = DesmondParser()
                try:
                    DesmondParser.readFile(path + filename + "/" + filename +
                                           ".cms")
                except Exception, e:
                    f.write("\nError reading %s -- %s" % (filename, e))
                filename_out = filename + "_OUT"
                try:
                    if not (os.path.exists('%sDesmondToGromacsInputs/%s' %
                                           (path, filename))):
                        os.makedirs('%sDesmondToGromacsInputs/%s' %
                                    (path, filename))
                    filename_out = os.path.abspath(
                        '%sDesmondToGromacsInputs/%s/%s' %
                        (path, filename, filename_out))
                    print "\nWriting out Gromacs topology %s.top" % (
Exemplo n.º 2
0
path = os.getcwd()+"/"
sys.path.append('../../..')
from ctools.System import *

System._sys = System("Redone Sample")
print "System initialized\n"
f = open("DesmondToDesmondErrors.txt", "w")
for dir in os.listdir(path+"/"):
	if os.path.isdir("%s" % (dir)):
		for file in os.listdir("%s" %(dir)):
			if (( ".cms" in file)):
				filename = string.rstrip(file,".cms")
				print "\nReading in Desmond structure %s"%(filename)
				sys.path.append('../../ParserFiles')
				from ctools.DesmondExt.DesmondParser import DesmondParser
				DesmondParser = DesmondParser()
				try:
					DesmondParser.readFile(path+filename+"/"+filename+".cms")
				except Exception,e:
					print "%s" %(e)
					f.write("\nError reading %s.cms --  %s"  %(filename, e))

				filename_out = filename + "_OUT"
				try:
					 if not (os.path.exists('%sDesmondToDesmondInputs/%s' %(path,filename))):
	                                       	 os.makedirs('%sDesmondToDesmondInputs/%s' %(path, filename))
                               		 filename_out = os.path.abspath('%sDesmondToDesmondInputs/%s/%s' %(path, filename, filename_out))

					 DesmondParser.writeFile(filename_out+".cms")
				except Exception,e:
					print "%s" %(e)
Exemplo n.º 3
0
sys.path.append('../..')
from ctools.System import System
System._sys = System("Redone Sample")
print "System initialized\n"
f = open( "DesmondToGromacsErrors.txt", "w")
for dir in os.listdir(path):
        if os.path.isdir("%s" % (dir)):
                for file in os.listdir("%s" %(dir)):
                        if ".cms" in file:
                                filename = string.rstrip(file,".cms")
                                print "\nReading in Desmond structure %s"%(filename)
                                sys.path.append('../../ParserFiles')
                                from ctools.DesmondExt.DesmondParser import DesmondParser
                                DesmondParser = DesmondParser()
                                try:
					DesmondParser.readFile(path+filename+"/"+filename+".cms")
				except Exception,e:
					f.write("\nError reading %s -- %s" %(filename, e))
				filename_out = filename + "_OUT"
				try:
					if not (os.path.exists('%sDesmondToGromacsInputs/%s' %(path,filename))):
						os.makedirs('%sDesmondToGromacsInputs/%s' %(path,filename))
					filename_out = os.path.abspath('%sDesmondToGromacsInputs/%s/%s' %(path,filename, filename_out))
					print "\nWriting out Gromacs topology %s.top"%(filename_out)
					from ctools.GromacsExt.GromacsTopologyParser import GromacsTopologyParser
					GromacsTopologyParser = GromacsTopologyParser()
					GromacsTopologyParser.writeTopology(filename_out+".top")
				except Exception, e:
					f.write("\nError writing %s.top -- %s" %(filename_out,e))
				print "\nWriting in Gromacs Stucture as %s"%(filename_out+".gro")
				from ctools.GromacsExt.GromacsStructurParser import GromacsStructureParser