3d-dart/server/plugins/PlotData.py
def ReadMultibend(self,infile):

		"""Read multibend file and append parameters to database"""

		ref = re.compile("Reference base-pair:")
		start = re.compile("index  bp-step")
		readfile = file(infile, '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(self.TransformDash(lines[value]))
				except:	
					lib[value].append(lines[value])

		self.sequence = lib[1]
		self.refbp = refbp
		self.bend['fractilt' ] = lib[3]
		self.bendsd['fractiltsd'] = lib[4]
		self.bend['fracroll'] = lib[5]
		self.bendsd['fracrollsd'] = lib[6]
		self.bend['bpangle'] = lib[7]
		self.bendsd['bpanglesd'] = lib[8]
		self.bend['orient'] = lib[9]
		self.bendsd['orientsd'] = lib[10]
		self.bend['gtilt'] = lib[11]
		self.bendsd['gtiltsd'] = lib[12]
		self.bend['groll'] = lib[13]
		self.bendsd['grollsd'] = lib[14]		
		self.bend['acctwist'] = lib[15]
		self.bendsd['acctwistsd'] = lib[16]

		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,infile):
		ref = re.compile("Reference base-pair:")
		start = re.compile("index  bp-step")
		readfile = file(infile, '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(self.TransformDash(lines[value]))
				except:	
					lib[value].append(lines[value])
		self.sequence = lib[1]
		self.refbp = refbp
		self.bend['fractilt' ] = lib[3]
		self.bendsd['fractiltsd'] = lib[4]
		self.bend['fracroll'] = lib[5]
		self.bendsd['fracrollsd'] = lib[6]
		self.bend['bpangle'] = lib[7]
		self.bendsd['bpanglesd'] = lib[8]
		self.bend['orient'] = lib[9]
		self.bendsd['orientsd'] = lib[10]
		self.bend['gtilt'] = lib[11]
		self.bendsd['gtiltsd'] = lib[12]
		self.bend['groll'] = lib[13]
		self.bendsd['grollsd'] = lib[14]		
		self.bend['acctwist'] = lib[15]
		self.bendsd['acctwistsd'] = lib[16]
		del bendlines
		lib.clear()
def ReadMultibend ( self , infile ) : ref = re . compile ( "Reference base-pair:" ) start = re . compile ( "index  bp-step" ) readfile = file ( infile , '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 ( self . TransformDash ( lines [ value ] ) ) except : lib [ value ] . append ( lines [ value ] ) self . sequence = lib [ 1 ] self . refbp = refbp self . bend [ 'fractilt' ] = lib [ 3 ] self . bendsd [ 'fractiltsd' ] = lib [ 4 ] self . bend [ 'fracroll' ] = lib [ 5 ] self . bendsd [ 'fracrollsd' ] = lib [ 6 ] self . bend [ 'bpangle' ] = lib [ 7 ] self . bendsd [ 'bpanglesd' ] = lib [ 8 ] self . bend [ 'orient' ] = lib [ 9 ] self . bendsd [ 'orientsd' ] = lib [ 10 ] self . bend [ 'gtilt' ] = lib [ 11 ] self . bendsd [ 'gtiltsd' ] = lib [ 12 ] self . bend [ 'groll' ] = lib [ 13 ] self . bendsd [ 'grollsd' ] = lib [ 14 ] self . bend [ 'acctwist' ] = lib [ 15 ] self . bendsd [ 'acctwistsd' ] = lib [ 16 ] 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"""
self
infile