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

		"""Read nucleic acid bend analysis file (*.bend) and append to bendref database"""

		readfile = file(infile, 'r')
		lines = readfile.readlines()
		
		lib = {}
		for n in range(9):
			lib[n] = []

		for line in lines[18:]:
			params = line.split()
			try:
				lib[0].append(str(params[1]))
				for value in range(2,9):
					lib[value].append(float(params[value]))
			except:
				break		

		if self.sequence == None:
			self.sequence = lib[0]
			self.bendref['fractilt'] = lib[2]
			self.bendref['fracroll'] = lib[3]
			self.bendref['bpangle'] = lib[4]
			self.bendref['orient'] = lib[5]
			self.bendref['gtilt'] = lib[6]
			self.bendref['groll'] = lib[7]
			self.bendref['acctwist'] = lib[8]
		elif len(self.sequence) == len(lib[0]):
			self.bendref['fractilt'] = lib[2]
			self.bendref['fracroll'] = lib[3]
			self.bendref['bpangle'] = lib[4]
			self.bendref['orient'] = lib[5]
			self.bendref['gtilt'] = lib[6]
			self.bendref['groll'] = lib[7]
			self.bendref['acctwist'] = lib[8]
		else:
			print("Number of base-pairs in reference does not match the number of base-pairs in the model(s): %i versus %i" % (len(lib[0]),len(self.sequence)))
			print("\nNo reference used")
				
		lib.clear()
Read nucleic acid bend analysis file (*.bend) and append to bendref database
Read nucleic acid bend analysis file (*.bend) and append to bendref database
Read nucleic acid bend analysis file ( * . bend ) and append to bendref database
def ReadBend(self,infile):
		readfile = file(infile, 'r')
		lines = readfile.readlines()
		lib = {}
		for n in range(9):
			lib[n] = []
		for line in lines[18:]:
			params = line.split()
			try:
				lib[0].append(str(params[1]))
				for value in range(2,9):
					lib[value].append(float(params[value]))
			except:
				break		
		if self.sequence == None:
			self.sequence = lib[0]
			self.bendref['fractilt'] = lib[2]
			self.bendref['fracroll'] = lib[3]
			self.bendref['bpangle'] = lib[4]
			self.bendref['orient'] = lib[5]
			self.bendref['gtilt'] = lib[6]
			self.bendref['groll'] = lib[7]
			self.bendref['acctwist'] = lib[8]
		elif len(self.sequence) == len(lib[0]):
			self.bendref['fractilt'] = lib[2]
			self.bendref['fracroll'] = lib[3]
			self.bendref['bpangle'] = lib[4]
			self.bendref['orient'] = lib[5]
			self.bendref['gtilt'] = lib[6]
			self.bendref['groll'] = lib[7]
			self.bendref['acctwist'] = lib[8]
		else:
			print("Number of base-pairs in reference does not match the number of base-pairs in the model(s): %i versus %i" % (len(lib[0]),len(self.sequence)))
			print("\nNo reference used")
		lib.clear()
def ReadBend ( self , infile ) : readfile = file ( infile , 'r' ) lines = readfile . readlines ( ) lib = { } for n in range ( 9 ) : lib [ n ] = [ ] for line in lines [ 18 : ] : params = line . split ( ) try : lib [ 0 ] . append ( str ( params [ 1 ] ) ) for value in range ( 2 , 9 ) : lib [ value ] . append ( float ( params [ value ] ) ) except : break if self . sequence == None : self . sequence = lib [ 0 ] self . bendref [ 'fractilt' ] = lib [ 2 ] self . bendref [ 'fracroll' ] = lib [ 3 ] self . bendref [ 'bpangle' ] = lib [ 4 ] self . bendref [ 'orient' ] = lib [ 5 ] self . bendref [ 'gtilt' ] = lib [ 6 ] self . bendref [ 'groll' ] = lib [ 7 ] self . bendref [ 'acctwist' ] = lib [ 8 ] elif len ( self . sequence ) == len ( lib [ 0 ] ) : self . bendref [ 'fractilt' ] = lib [ 2 ] self . bendref [ 'fracroll' ] = lib [ 3 ] self . bendref [ 'bpangle' ] = lib [ 4 ] self . bendref [ 'orient' ] = lib [ 5 ] self . bendref [ 'gtilt' ] = lib [ 6 ] self . bendref [ 'groll' ] = lib [ 7 ] self . bendref [ 'acctwist' ] = lib [ 8 ] else : print ( "Number of base-pairs in reference does not match the number of base-pairs in the model(s): %i versus %i" % ( len ( lib [ 0 ] ) , len ( self . sequence ) ) ) print ( "\nNo reference used" ) lib . clear ( )
Read nucleic acid bend analysis file (*.bend) and append to bendref database
Read nucleic acid bend analysis file ( * . bend ) and append to bendref database
"""Read nucleic acid bend analysis file (*.bend) and append to bendref database"""
self
infile