示例#1
0
	def write_color_as_temperature(self, FILE=omitted):
		" Print raw PDB structure to file given as argument (defaults to stdout), replacing the temperature factor by color "
		if FILE is omitted: HANDLE = sys.stdout
		else:
			try: HANDLE = open(FILE, 'w')
			except IOError:
				writeout("Can't open "+FILE+"\n")
				message()
		for i in range(self.ATOMSIZE):
			HANDLE.write("ATOM  %5d %-4s %-3s %1s%4d    %8.3f%8.3f%8.3f%6.2f%6.2f      %-4s%+2s%+2s\n" % (self.ATOMSTART+i,self.ATOMNAME[i],self.AMINOACID[i],self.CHAIN[i],self.RESIDUE[i],self.X[i],self.Y[i],self.Z[i],self.OCCUPANCY[i],self.COLOR[i],self.SEGMENT[i],self.ELEMENT[i],self.CHARGE[i]))
		HANDLE.close
示例#2
0
	def write_grasp_list(self, FILE=omitted):
		" Print GRASP property file from colors in PDB structure to file given as argument (defaults to stdout) "
		if FILE is omitted: HANDLE = sys.stdout
		else:
			try: HANDLE = open(FILE, 'w')
			except IOError:
				writeout("Can't open "+FILE+"\n")
				message()
		HANDLE.write("atoms=gproperty1\n")
		for i in range(self.ATOMSIZE):
			HANDLE.write("%.2f\n" % self.COLOR[i])
		HANDLE.close
示例#3
0
	def write_pymol(self, FILE=omitted, favorite_color=0):
		" Print PYMOL macro from colors in PDB structure to file given as argument (defaults to stdout) "
		if FILE is omitted: HANDLE = sys.stdout
		else:
			try: HANDLE = open(FILE, 'w')
			except IOError:
				writeout("Can't open "+FILE+"\n")
				message()				
		
		current_res = 0; 
		for i in range(self.ATOMSIZE):	# for each atom
			if self.RESIDUE[i] != current_res:	# next residue
				current_res = self.RESIDUE[i]
				HANDLE.write("set_color color%d = " % self.RESIDUE[i])
				HANDLE.write(set_pymol_color(self.COLOR[i],favorite_color))
				HANDLE.write("color color%d, resi %d\n" % (self.RESIDUE[i],self.RESIDUE[i]))
		HANDLE.close
示例#4
0
	def write_molmol_surface(self, FILE=omitted, favorite_color=0):
		" Print MOLMOL macro from colors in PDB structure to file given as argument (defaults to stdout) "
		if FILE is omitted: HANDLE = sys.stdout
		else:
			try: HANDLE = open(FILE, 'w')
			except IOError:
				writeout("Can't open "+FILE+"\n")
				message()
		HANDLE.write("SelectBond ''\n")
		HANDLE.write("StyleBond invisible\n")
		self.list_molmol_color(HANDLE,favorite_color)
		HANDLE.write("Light point 5 2 15\n")
		HANDLE.write("Projection perspective\n")
		HANDLE.write("SelectAtom ''\n")
		HANDLE.write("AddSurface vdw solvent 1.4 shaded 0\n")
		HANDLE.write("PaintSurface atom 0 1.4 0 0 ''\n")
		HANDLE.close
示例#5
0
	def write_molmol_worm(self, FILE=omitted, favorite_color=0):
		" Print MOLMOL macro from colors in PDB structure to file given as argument (defaults to stdout) "
		if FILE is omitted: HANDLE = sys.stdout
		else:
			try: HANDLE = open(FILE, 'w')
			except IOError:
				writeout("Can't open "+FILE+"\n")
				message()
		HANDLE.write("SelectBond ''\n")
		HANDLE.write("StyleBond invisible\n")
		HANDLE.write("CalcSecondary\n")
		HANDLE.write("SelectAtom '@CA'\n")
		HANDLE.write("AddRibbon\n")
		HANDLE.write("StyleRibbon round sharp sharp const\n")
		HANDLE.write("RadiusPrim 1.0\n")
		HANDLE.write("PaintRibbon atom_smooth\n")
		HANDLE.write("SelectAtom '@CA'\n")
		HANDLE.write("ColorAtom 1 1 1\n")
		HANDLE.write("Light infinite 0 0 7\n")
		HANDLE.write("Projection perspective\n")
		self.list_molmol_color(HANDLE,favorite_color)
		HANDLE.close
示例#6
0
            ARGUMENTS.pop(0)
            FILE_PREFIX = ''

#	print ARGUMENTS

    OPT = ''
    while len(ARGUMENTS) > 0 and re.search(r'^-\w*', ARGUMENTS[0]):
        OPT += re.search(r'^-(\w*)', ARGUMENTS[0]).group(1)
        del ARGUMENTS[0]

# Get files and check for void files
    if len(ARGUMENTS) < 2 or ARGUMENTS[1] == '':
        PDB_EXIST = 0
        if len(ARGUMENTS) < 1 or ARGUMENTS[0] == '':
            man(sys.stdout)
            message('Missing argument')
    else:
        PDB_EXIST = 1

    try:
        HANDLE = open(ARGUMENTS[0], 'rU')
    except IOError:
        message("Can't open file : " + ARGUMENTS[0] + "\n")
    BLAST_lines = HANDLE.readlines()
    HANDLE.close()

    if PDB_EXIST:
        try:
            HANDLE = open(ARGUMENTS[1], 'rU')
        except IOError:
            message("Can't open file : " + ARGUMENTS[1] + "\n")