3d-dart/server/plugins/ModelNucleicAcids.py
def ReadMultibend(self,files):
		
		"""Read multibend file and append parameters to database"""
		
		ref = re.compile("Reference base-pair:")
		start = re.compile("index  bp-step")
		readfile = file(files, 'r')
		lines = readfile.readlines()
		linecount = 1
		countstart = []
		for line in lines:
			line = line.strip()
			result1 = ref.match(line)
			result2 = start.match(line)
			if result1:
				refbp = float(line.split()[2])	
			elif result2:
				bendlines = self._ReadTable(linenr=len(countstart),outfile=lines)
			linecount += 1
        		countstart.append(linecount)	
		
		#bendlines.insert(0,([0.00001]*17))
		
		lib = {}
		for n in range(17):
			lib[n] = []
		for lines in bendlines:
			for value in range(17):
				try:
					lib[value].append(TransformDash(lines[value]))
				except:	
					lib[value].append(lines[value])
		self.bendref = DatabaseDeamon()
		self.bendref.Load('refbp', refbp)
		self.bendref.Load('globbend', mean(lib[7]))
		self.bendref.Load('globbendsd', std(lib[7]))
		self.bendref.Load('sequence', lib[1])
		self.bendref.Load('fractilt', lib[3])
		self.bendref.Load('fractiltsd', lib[4])
		self.bendref.Load('fracroll', lib[5])
		self.bendref.Load('fracrollsd', lib[6])
		self.bendref.Load('bpangle', lib[7])
		self.bendref.Load('bpanglesd', lib[8])
		self.bendref.Load('orient', lib[9])
		self.bendref.Load('orientsd', lib[10])
		self.bendref.Load('gtilt', lib[11])
		self.bendref.Load('gtiltsd', lib[12])
		self.bendref.Load('groll', lib[13])
		self.bendref.Load('grollsd', lib[14])
		self.bendref.Load('acctwist', lib[15])
		self.bendref.Load('acctwistsd', lib[16])
		self.bendref.Load('globorient', mean(lib[9]))
		self.bendref.Load('globorientsd', std(lib[9]))
		
		del bendlines
		lib.clear()
Read multibend file and append parameters to database
Read multibend file and append parameters to database
Read multibend file and append parameters to database
def ReadMultibend(self,files):
		ref = re.compile("Reference base-pair:")
		start = re.compile("index  bp-step")
		readfile = file(files, 'r')
		lines = readfile.readlines()
		linecount = 1
		countstart = []
		for line in lines:
			line = line.strip()
			result1 = ref.match(line)
			result2 = start.match(line)
			if result1:
				refbp = float(line.split()[2])	
			elif result2:
				bendlines = self._ReadTable(linenr=len(countstart),outfile=lines)
			linecount += 1
        		countstart.append(linecount)	
		lib = {}
		for n in range(17):
			lib[n] = []
		for lines in bendlines:
			for value in range(17):
				try:
					lib[value].append(TransformDash(lines[value]))
				except:	
					lib[value].append(lines[value])
		self.bendref = DatabaseDeamon()
		self.bendref.Load('refbp', refbp)
		self.bendref.Load('globbend', mean(lib[7]))
		self.bendref.Load('globbendsd', std(lib[7]))
		self.bendref.Load('sequence', lib[1])
		self.bendref.Load('fractilt', lib[3])
		self.bendref.Load('fractiltsd', lib[4])
		self.bendref.Load('fracroll', lib[5])
		self.bendref.Load('fracrollsd', lib[6])
		self.bendref.Load('bpangle', lib[7])
		self.bendref.Load('bpanglesd', lib[8])
		self.bendref.Load('orient', lib[9])
		self.bendref.Load('orientsd', lib[10])
		self.bendref.Load('gtilt', lib[11])
		self.bendref.Load('gtiltsd', lib[12])
		self.bendref.Load('groll', lib[13])
		self.bendref.Load('grollsd', lib[14])
		self.bendref.Load('acctwist', lib[15])
		self.bendref.Load('acctwistsd', lib[16])
		self.bendref.Load('globorient', mean(lib[9]))
		self.bendref.Load('globorientsd', std(lib[9]))
		del bendlines
		lib.clear()
def ReadMultibend ( self , files ) : ref = re . compile ( "Reference base-pair:" ) start = re . compile ( "index  bp-step" ) readfile = file ( files , 'r' ) lines = readfile . readlines ( ) linecount = 1 countstart = [ ] for line in lines : line = line . strip ( ) result1 = ref . match ( line ) result2 = start . match ( line ) if result1 : refbp = float ( line . split ( ) [ 2 ] ) elif result2 : bendlines = self . _ReadTable ( linenr = len ( countstart ) , outfile = lines ) linecount += 1 countstart . append ( linecount ) lib = { } for n in range ( 17 ) : lib [ n ] = [ ] for lines in bendlines : for value in range ( 17 ) : try : lib [ value ] . append ( TransformDash ( lines [ value ] ) ) except : lib [ value ] . append ( lines [ value ] ) self . bendref = DatabaseDeamon ( ) self . bendref . Load ( 'refbp' , refbp ) self . bendref . Load ( 'globbend' , mean ( lib [ 7 ] ) ) self . bendref . Load ( 'globbendsd' , std ( lib [ 7 ] ) ) self . bendref . Load ( 'sequence' , lib [ 1 ] ) self . bendref . Load ( 'fractilt' , lib [ 3 ] ) self . bendref . Load ( 'fractiltsd' , lib [ 4 ] ) self . bendref . Load ( 'fracroll' , lib [ 5 ] ) self . bendref . Load ( 'fracrollsd' , lib [ 6 ] ) self . bendref . Load ( 'bpangle' , lib [ 7 ] ) self . bendref . Load ( 'bpanglesd' , lib [ 8 ] ) self . bendref . Load ( 'orient' , lib [ 9 ] ) self . bendref . Load ( 'orientsd' , lib [ 10 ] ) self . bendref . Load ( 'gtilt' , lib [ 11 ] ) self . bendref . Load ( 'gtiltsd' , lib [ 12 ] ) self . bendref . Load ( 'groll' , lib [ 13 ] ) self . bendref . Load ( 'grollsd' , lib [ 14 ] ) self . bendref . Load ( 'acctwist' , lib [ 15 ] ) self . bendref . Load ( 'acctwistsd' , lib [ 16 ] ) self . bendref . Load ( 'globorient' , mean ( lib [ 9 ] ) ) self . bendref . Load ( 'globorientsd' , std ( lib [ 9 ] ) ) del bendlines lib . clear ( )
Read multibend file and append parameters to database
Read multibend file and append parameters to database
"""Read multibend file and append parameters to database""" #bendlines.insert(0,([0.00001]*17))
self
files