#!/usr/bin/python # Read GLAM2SCAN output: write an HTML version of it import fileinput version = '' commandline = '' alignments = [] state = 0 for line in fileinput.input(): if state == 0: if line.startswith('Version'): version = line elif line.find('glam2scan') != -1: commandline = line state += 1 elif state == 1: fields = line.split() if len(fields) == 6: alignments.append(fields) # print the HTML header: print '' print '
' print '', version, '
', commandline, '' print '
If you use this program in your research, please cite: \ MC Frith, NFW Saunders, B Kobe, TL Bailey, "Discovering sequence motifs with arbitrary insertions and deletions", PLoS Computational Biology, 4(5):e1000071, 2008. \ \ [full text]
' print 'NAME | ' print 'START | ' print 'SITE | ' print 'END | ' print 'STRAND | ' print 'SCORE | ' print '
---|---|---|---|---|---|
', row[0], ' | ' print '', row[1], ' | ' print '', row[2], ' | ' print '', row[3], ' | ' print '', row[4], ' | ' print '', row[5], ' | ' print '