Exemplo n.º 1
0
import cherrypy
import operator, os, pickle, sys
from genshi.template import TemplateLoader
from formencode import Invalid
from genshi.filters import HTMLFormFiller
from Digest import Digest

import model
current_dir = os.path.dirname(os.path.abspath(__file__))


enzymelist = model.enzymes()

loader = TemplateLoader(
    os.path.join(os.path.dirname(__file__), 'web'),
    auto_reload=True
)


#enzyme_name = ['Arg-C proteinase', 'Asp-N endopeptidase', 'BNPS-Skatole', 'Caspase1', 'Caspase2', 'Caspase3', 'Caspase4', 'Caspase5', 'Caspase6', 'Caspase7', 'Caspase8', 'Caspase9', 'Caspase10', 'Clostripain(Clostridiopeptidase B', 'CNBr', 'Enterokinase', 'Factor Xa', 'Formic acid', 'Glutamyl endopeptidase', 'GranzymeB', 'Hydroxylamine', 'Iodosobenzoic acid', 'LysC', 'Neutrophil elastase', 'NTCB(2-nitro-5-thiocyanobenzoic acid)', 'Pepsin(pH>2)', 'Proline-endopeptidase', 'Proteinase K', 'Staphylococcal peptidase I', 'Thermolysin']
enzyme_name = []
for i in enzymelist.enzyme:
    enzyme_name.append(i[0])
    
enzyme_id = list(range(len(enzyme_name)))
enzyme_list = zip(enzyme_name,enzyme_id)
#print enzymelist.enzyme
digest = Digest(enzymelist.enzyme)


class ProteinDigest:
Exemplo n.º 2
0
            output_num.append(temp)
            temp = []
            for j in range(i,i+6):
                temp.append(result_seq[j])
            output_seq.append(temp)
            
        temp = []
        for j in range((len(result_seq)-1)/6 *6,len(result_seq)):
            temp.append(result_num[j])
        output_num.append(temp)
        temp = []
        for j in range((len(result_seq)-1)/6 *6,len(result_seq)):
            temp.append(result_seq[j])
        output_seq.append(temp)
        output = []
        for i in range(len(output_num)):
            output.append(output_num[i])
            output.append(output_seq[i])
        return output

# for test
if __name__ == '__main__':
    import model
    el = model.enzymes()
    chosen = []
    #s = 'qweaaaadssss22aaaadssss333aaaadssss44waaaadssssr'
    s = raw_input()
    o = Digest(el.enzyme)
    o.selectenzyme(allselect=True)
    a = o.digest(s.upper())