comparison candisnp.py @ 5:9215ffe7d4d5 draft

Fixed issue with INDEL annotations. Changed output to iframe.
author cschu
date Wed, 24 Jun 2015 11:42:40 -0400
parents 36f6520671b3
children
comparison
equal deleted inserted replaced
4:28990f586370 5:9215ffe7d4d5
117 self.position = int(args[1]) 117 self.position = int(args[1])
118 self.reference_base = args[3] 118 self.reference_base = args[3]
119 self.alternate_base = args[4] 119 self.alternate_base = args[4]
120 120
121 # info = dict([field.split('=') for field in args[7].strip().split(';')]) 121 # info = dict([field.split('=') for field in args[7].strip().split(';')])
122 info = dict(field.split('=') for field in args[7].strip().split(';')) 122 # info = dict(field.split('=') for field in args[7].strip().split(';'))
123 info = dict(field.split('=') for field in args[7].strip().split(';') if len(field.split('=')) == 2)
123 # self.log.write('***'+str(info.get('EFF', '@@@')+'***\n')) 124 # self.log.write('***'+str(info.get('EFF', '@@@')+'***\n'))
124 125
125 self.allele_frequency = float(info.get('AF', '0.0')) 126 self.allele_frequency = float(info.get('AF', '0.0'))
126 self.effects = [effect 127 self.effects = [effect
127 for effect in info.get('EFF', '').split(',') 128 for effect in info.get('EFF', '').split(',')
197 except urllib2.URLError, e: 198 except urllib2.URLError, e:
198 candiURL = '' 199 candiURL = ''
199 sys.stderr.write(str(e.reason) + '\n') 200 sys.stderr.write(str(e.reason) + '\n')
200 201
201 if candiURL: 202 if candiURL:
202 body = urllib2.urlopen(candiURL) 203 # body = urllib2.urlopen(candiURL)
203 fo.write(body.read()) 204 # fo.write(body.read())
204 #fo.write('<iframe src="%s"></iframe>\n' % candiURL) 205 #fo.write('<iframe name="galaxy_main" id="galaxy_main" frameborder="0" style="position: absolute; width: 100%; height: 100%;" src="%s"></iframe>' % candiURL)
206 #fo.write('<iframe name="galaxy_main" id="galaxy_main" frameborder="0" style="position: absolute; width: 100%; height: 100%;" src="%s"></iframe>' % candiURL)
207 fo.write('<iframe src="%s" frameborder="0" style="position: absolute; width: 100%%; height: 100%%;"></iframe>\n' % candiURL)
208 # fo.write('<iframe src="%s"></iframe>\n' % candiURL)
205 else: 209 else:
206 fo.write('I am sorry. CandiSNP does not pick up. Maybe (<a href="%s" target="_blank">try it manually?</a>)\n' % CANDISNP_SERVER) 210 fo.write('I am sorry. CandiSNP does not pick up. Maybe (<a href="%s" target="_blank">try it manually?</a>)\n' % CANDISNP_SERVER)
207 211
208 fo.close() 212 fo.close()
209 pass 213 pass