Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!c:/Python26/python.exe
- import cgi
- import os
- import cgitb; cgitb.enable()
- print 'Content-type: text/html\n\n'
- from index import HtmlTemplate
- t = HtmlTemplate()
- t.Header()
- t.Body()
- form=cgi.FieldStorage()
- a=(form["dfile"].filename)
- (name,ext) = os.path.splitext(a)
- import sys, subprocess
- from Bio import AlignIO
- from Bio import SeqIO
- from Bio.Align.Applications import ClustalwCommandline
- cline = ClustalwCommandline("clustalw", infile=a, seqnos="ON")
- child = subprocess.call(str(cline), shell=(sys.platform!="win32"))
- alignfile=name+'.aln'
- alignment =AlignIO.read(alignfile, "clustal")
- print "<b><u> Result Analysis</u></b></br>"
- print "Input file name : "+a
- print "<br>"
- print "Total Number of Records: %i" % len(alignment)
- handle=open(alignfile,'rU')
- for seql in SeqIO.parse(handle, "clustal"):
- seq_length = len(seql.seq)
- print "<br>"
- print "Total number of Sequences: %i" % seq_length
- print "<br>"
- print "<b><u> Alignment Result</u></b></br>"
- print "<pre>"
- f = open(alignfile)
- for line in f.readlines():
- print line
- print "</pre>"
- print "</br>"
- print "<b><u> Guide Tree Result</u></b></br>"
- print "<pre>"
- f = open(name + '.dnd')
- for line in f.readlines():
- print line
- print "</pre>"
- t.Footer()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement