TODO: \r
\r
+Add registry service to query services status\r
+\r
+Refactor web services checker to enable a programmatic access to its methods.\r
+Rename it to avoid confusion with jabaws client\r
+\r
+Finish the client\r
+\r
+Add interface for Jalview annotation \r
+Add the method to return Jalview Annotation to SequenceAnnotation IF \r
+\r
+Develop generic Interface to return Jalview annotation for easy to add new \r
+services (?) \r
+\r
Replace conservation.Method with server.ws.Method \r
and try building WS. If this does not work - get rid of Method\r
\r
\r
Add AACon ws\r
Add iupred ws http://iupred.enzim.hu/\r
-Add globprot ws \r
+Add globprot ws - does not report raw scores, just regions\r
Add ronn ws\r
\r
Philogeny Mrbayes + Philip\r
--- /dev/null
+#!/usr/bin/env python
+# Copyright (C) 2003 Rune Linding - EMBL
+# GlobPlot TM
+# GlobPlot is licensed under the Academic Free license
+
+from string import *
+from sys import argv
+import sys,re
+import os
+from os import system,popen3
+
+relpath = re.sub("/GlobPipe.py$","",argv[0])
+newpath =os.getcwd()+"/"+relpath+"/biopython-1.50"
+sys.path.append(newpath)
+
+import Bio
+from Bio import File
+from Bio import Fasta
+import fpformat
+import tempfile
+import math
+
+# Russell/Linding
+RL = {'N':0.229885057471264,'P':0.552316012226663,'Q':-0.187676577424997,'A':-0.261538461538462,'R':-0.176592654077609, \
+ 'S':0.142883029808825,'C':-0.0151515151515152,'T':0.00887797506611258,'D':0.227629796839729,'E':-0.204684629516228, \
+ 'V':-0.386174834235195,'F':-0.225572305974316,'W':-0.243375458622095,'G':0.433225711769886,'H':-0.00121743364986608, \
+ 'Y':-0.20750516775322,'I':-0.422234699606962,'K':-0.100092289621613,'L':-0.337933495925287,'M':-0.225903614457831}
+
+def Sum(seq,par_dict):
+ sum = 0
+ results = []
+ raws = []
+ sums = []
+ p = 1
+ for residue in seq:
+ try:
+ parameter = par_dict[residue]
+ except:
+ parameter = 0
+ if p == 1:
+ sum = parameter
+ else:
+ sum = sum + parameter#*math.log10(p)
+ ssum = float(fpformat.fix(sum,10))
+ sums.append(ssum)
+ p +=1
+ return sums
+
+def getSlices(dydx_data, DOM_join_frame, DOM_peak_frame, DIS_join_frame, DIS_peak_frame):
+ DOMslices = []
+ DISslices = []
+ in_DOMslice = 0
+ in_DISslice = 0
+ beginDOMslice = 0
+ endDOMslice = 0
+ beginDISslice = 0
+ endDISslice = 0
+ for i in range( len(dydx_data) ):
+ #close dom slice
+ if in_DOMslice and dydx_data[i] > 0:
+ DOMslices.append([beginDOMslice, endDOMslice])
+ in_DOMslice = 0
+ #close dis slice
+ elif in_DISslice and dydx_data[i] < 0:
+ DISslices.append([beginDISslice, endDISslice])
+ in_DISslice = 0
+ # elseif inSlice expandslice
+ elif in_DOMslice:
+ endDOMslice += 1
+ elif in_DISslice:
+ endDISslice += 1
+ # if not in slice and dydx !== 0 start slice
+ if dydx_data[i] > 0 and not in_DISslice:
+ beginDISslice = i
+ endDISslice = i
+ in_DISslice = 1
+ elif dydx_data[i] < 0 and not in_DOMslice:
+ beginDOMslice = i
+ endDOMslice = i
+ in_DOMslice = 1
+ #last slice
+ if in_DOMslice:
+ DOMslices.append([beginDOMslice, endDOMslice])
+ if in_DISslice:
+ DISslices.append([beginDISslice,endDISslice])
+ k = 0
+ l = 0
+ while k < len(DOMslices):
+ if k+1 < len(DOMslices) and DOMslices[k+1][0]-DOMslices[k][1] < DOM_join_frame:
+ DOMslices[k] = [ DOMslices[k][0], DOMslices[k+1][1] ]
+ del DOMslices[k+1]
+ elif DOMslices[k][1]-DOMslices[k][0]+1 < DOM_peak_frame:
+ del DOMslices[k]
+ else:
+ k += 1
+ while l < len(DISslices):
+ if l+1 < len(DISslices) and DISslices[l+1][0]-DISslices[l][1] < DIS_join_frame:
+ DISslices[l] = [ DISslices[l][0], DISslices[l+1][1] ]
+ del DISslices[l+1]
+ elif DISslices[l][1]-DISslices[l][0]+1 < DIS_peak_frame:
+ del DISslices[l]
+ else:
+ l += 1
+ return DOMslices, DISslices
+
+
+def SavitzkyGolay(window,derivative,datalist):
+ SG_bin = relpath +'/'+ 'sav_gol -V0 '
+ stdin, stdout, stderr = popen3(SG_bin + '-D' + str(derivative) + ' -n' + str(window)+','+str(window))
+ for data in datalist:
+ stdin.write(`data`+'\n')
+ try:
+ stdin.close()
+ except:
+ print stderr.readlines()
+ results = stdout.readlines()
+ stdout.close()
+ SG_results = []
+ for result in results:
+ SG_results.append(float(fpformat.fix(result,6)))
+ return SG_results
+
+
+def reportSlicesTXT(slices, sequence, maskFlag):
+ if maskFlag == 'DOM':
+ coordstr = '|GlobDoms:'
+ elif maskFlag == 'DIS':
+ coordstr = '|Disorder:'
+ else:
+ raise SystemExit
+ if slices == []:
+ #by default the sequence is in uppercase which is our search space
+ s = sequence
+ else:
+ # insert seq before first slide
+ if slices[0][0] > 0:
+ s = sequence[0:slices[0][0]]
+ else:
+ s = ''
+ for i in range(len(slices)):
+ #skip first slice
+ if i > 0:
+ coordstr = coordstr + ', '
+ coordstr = coordstr + str(slices[i][0]+1) + '-' + str(slices[i][1]+1)
+ #insert the actual slice
+ if maskFlag == 'DOM':
+ s = s + lower(sequence[slices[i][0]:(slices[i][1]+1)])
+ if i < len(slices)-1:
+ s = s + upper(sequence[(slices[i][1]+1):(slices[i+1][0])])
+ #last slice
+ elif slices[i][1] < len(sequence)-1:
+ s = s + lower(sequence[(slices[i][1]+1):(len(sequence))])
+ elif maskFlag == 'DIS':
+ s = s + upper(sequence[slices[i][0]:(slices[i][1]+1)])
+ #insert untouched seq between disorder segments, 2-run labelling
+ if i < len(slices)-1:
+ s = s + sequence[(slices[i][1]+1):(slices[i+1][0])]
+ #last slice
+ elif slices[i][1] < len(sequence)-1:
+ s = s + sequence[(slices[i][1]+1):(len(sequence))]
+ return s,coordstr
+
+
+def runGlobPlot():
+ try:
+ smoothFrame = int(sys.argv[1])
+ DOM_joinFrame = int(sys.argv[2])
+ DOM_peakFrame = int(sys.argv[3])
+ DIS_joinFrame = int(sys.argv[4])
+ DIS_peakFrame = int(sys.argv[5])
+ file = str(sys.argv[6])
+ db = open(file,'r')
+ except:
+ print 'Usage:'
+ print ' ./GlobPipe.py SmoothFrame DOMjoinFrame DOMpeakFrame DISjoinFrame DISpeakFrame FASTAfile'
+ print ' Optimised for ELM: ./GlobPlot.py 10 8 75 8 8 sequence_file'
+ print ' Webserver settings: ./GlobPlot.py 10 15 74 4 5 sequence_file'
+ raise SystemExit
+ parser = Fasta.RecordParser()
+ iterator = Fasta.Iterator(db,parser)
+ while 1:
+ try:
+ cur_record = iterator.next()
+ #uppercase is searchspace
+ seq = upper(cur_record.sequence)
+ # sum function
+ sum_vector = Sum(seq,RL)
+ # Run Savitzky-Golay
+ smooth = SavitzkyGolay(`smoothFrame`,0, sum_vector)
+ dydx_vector = SavitzkyGolay(`smoothFrame`,1, sum_vector)
+ #test
+ sumHEAD = sum_vector[:smoothFrame]
+ sumTAIL = sum_vector[len(sum_vector)-smoothFrame:]
+ newHEAD = []
+ newTAIL = []
+ for i in range(len(sumHEAD)):
+ try:
+ dHEAD = (sumHEAD[i+1]-sumHEAD[i])/2
+ except:
+ dHEAD = (sumHEAD[i]-sumHEAD[i-1])/2
+ try:
+ dTAIL = (sumTAIL[i+1]-sumTAIL[i])/2
+ except:
+ dTAIL = (sumTAIL[i]-sumTAIL[i-1])/2
+ newHEAD.append(dHEAD)
+ newTAIL.append(dTAIL)
+ dydx_vector[:smoothFrame] = newHEAD
+ dydx_vector[len(dydx_vector)-smoothFrame:] = newTAIL
+ globdoms, globdis = getSlices(dydx_vector, DOM_joinFrame, DOM_peakFrame, DIS_joinFrame, DIS_peakFrame)
+ s_domMask, coordstrDOM = reportSlicesTXT(globdoms, seq, 'DOM')
+ s_final, coordstrDIS = reportSlicesTXT(globdis, s_domMask, 'DIS')
+ sys.stdout.write('>'+cur_record.title+coordstrDOM+coordstrDIS+'\n')
+
+# UNCOMMENT THIS IF NEED TO PRODUCE PER RESEDUE VALUES
+ for i in range(len(dydx_vector)):
+# dydx (positive values seems to indicate disorder in rows more than ~6 chars) raw smoothed
+ sys.stdout.write(seq[i]+'\t'+fpformat.fix(dydx_vector[i],4)+ '\t'+fpformat.fix(smooth[i],4)+'\t'+fpformat.fix(sum_vector[i],4)+ '\n')
+
+# print s_final
+ print '\n'
+ except AttributeError:
+ break
+ return
+
+runGlobPlot()
--- /dev/null
+#!/usr/bin/env python
+# Copyright (C) 2003 Rune Linding - EMBL
+# GlobPlot TM
+# GlobPlot is licensed under the Academic Free license
+
+from string import *
+from sys import argv
+import sys
+import os
+from os import system,popen3
+
+relpath = re.sub("/GlobPipe.py$","",argv[0])
+cwd = re.sub("/$","", os.getcwd())
+print '!' +os.getcwd()
+print '!!' +cwd
+newpath =cwd+"/"+relpath+"/biopython-1.50"
+sys.path.append(newpath)
+
+import Bio
+from Bio import File
+from Bio import Fasta
+import fpformat
+import tempfile
+import math
+
+# Russell/Linding
+RL = {'N':0.229885057471264,'P':0.552316012226663,'Q':-0.187676577424997,'A':-0.261538461538462,'R':-0.176592654077609, \
+ 'S':0.142883029808825,'C':-0.0151515151515152,'T':0.00887797506611258,'D':0.227629796839729,'E':-0.204684629516228, \
+ 'V':-0.386174834235195,'F':-0.225572305974316,'W':-0.243375458622095,'G':0.433225711769886,'H':-0.00121743364986608, \
+ 'Y':-0.20750516775322,'I':-0.422234699606962,'K':-0.100092289621613,'L':-0.337933495925287,'M':-0.225903614457831}
+
+def Sum(seq,par_dict):
+ sum = 0
+ results = []
+ raws = []
+ sums = []
+ p = 1
+ for residue in seq:
+ try:
+ parameter = par_dict[residue]
+ except:
+ parameter = 0
+ if p == 1:
+ sum = parameter
+ else:
+ sum = sum + parameter#*math.log10(p)
+ ssum = float(fpformat.fix(sum,10))
+ sums.append(ssum)
+ p +=1
+ return sums
+
+def getSlices(dydx_data, DOM_join_frame, DOM_peak_frame, DIS_join_frame, DIS_peak_frame):
+ DOMslices = []
+ DISslices = []
+ in_DOMslice = 0
+ in_DISslice = 0
+ beginDOMslice = 0
+ endDOMslice = 0
+ beginDISslice = 0
+ endDISslice = 0
+ for i in range( len(dydx_data) ):
+ #close dom slice
+ if in_DOMslice and dydx_data[i] > 0:
+ DOMslices.append([beginDOMslice, endDOMslice])
+ in_DOMslice = 0
+ #close dis slice
+ elif in_DISslice and dydx_data[i] < 0:
+ DISslices.append([beginDISslice, endDISslice])
+ in_DISslice = 0
+ # elseif inSlice expandslice
+ elif in_DOMslice:
+ endDOMslice += 1
+ elif in_DISslice:
+ endDISslice += 1
+ # if not in slice and dydx !== 0 start slice
+ if dydx_data[i] > 0 and not in_DISslice:
+ beginDISslice = i
+ endDISslice = i
+ in_DISslice = 1
+ elif dydx_data[i] < 0 and not in_DOMslice:
+ beginDOMslice = i
+ endDOMslice = i
+ in_DOMslice = 1
+ #last slice
+ if in_DOMslice:
+ DOMslices.append([beginDOMslice, endDOMslice])
+ if in_DISslice:
+ DISslices.append([beginDISslice,endDISslice])
+ k = 0
+ l = 0
+ while k < len(DOMslices):
+ if k+1 < len(DOMslices) and DOMslices[k+1][0]-DOMslices[k][1] < DOM_join_frame:
+ DOMslices[k] = [ DOMslices[k][0], DOMslices[k+1][1] ]
+ del DOMslices[k+1]
+ elif DOMslices[k][1]-DOMslices[k][0]+1 < DOM_peak_frame:
+ del DOMslices[k]
+ else:
+ k += 1
+ while l < len(DISslices):
+ if l+1 < len(DISslices) and DISslices[l+1][0]-DISslices[l][1] < DIS_join_frame:
+ DISslices[l] = [ DISslices[l][0], DISslices[l+1][1] ]
+ del DISslices[l+1]
+ elif DISslices[l][1]-DISslices[l][0]+1 < DIS_peak_frame:
+ del DISslices[l]
+ else:
+ l += 1
+ return DOMslices, DISslices
+
+
+def SavitzkyGolay(window,derivative,datalist):
+ SG_bin = '/homes/pvtroshin/soft/GlobPipe-2.3/sav_gol -V0 '
+ stdin, stdout, stderr = popen3(SG_bin + '-D' + str(derivative) + ' -n' + str(window)+','+str(window))
+ for data in datalist:
+ stdin.write(`data`+'\n')
+ try:
+ stdin.close()
+ except:
+ print stderr.readlines()
+ results = stdout.readlines()
+ stdout.close()
+ SG_results = []
+ for result in results:
+ SG_results.append(float(fpformat.fix(result,6)))
+ return SG_results
+
+
+def reportSlicesTXT(slices, sequence, maskFlag):
+ if maskFlag == 'DOM':
+ coordstr = '|GlobDoms:'
+ elif maskFlag == 'DIS':
+ coordstr = '|Disorder:'
+ else:
+ raise SystemExit
+ if slices == []:
+ #by default the sequence is in uppercase which is our search space
+ s = sequence
+ else:
+ # insert seq before first slide
+ if slices[0][0] > 0:
+ s = sequence[0:slices[0][0]]
+ else:
+ s = ''
+ for i in range(len(slices)):
+ #skip first slice
+ if i > 0:
+ coordstr = coordstr + ', '
+ coordstr = coordstr + str(slices[i][0]+1) + '-' + str(slices[i][1]+1)
+ #insert the actual slice
+ if maskFlag == 'DOM':
+ s = s + lower(sequence[slices[i][0]:(slices[i][1]+1)])
+ if i < len(slices)-1:
+ s = s + upper(sequence[(slices[i][1]+1):(slices[i+1][0])])
+ #last slice
+ elif slices[i][1] < len(sequence)-1:
+ s = s + lower(sequence[(slices[i][1]+1):(len(sequence))])
+ elif maskFlag == 'DIS':
+ s = s + upper(sequence[slices[i][0]:(slices[i][1]+1)])
+ #insert untouched seq between disorder segments, 2-run labelling
+ if i < len(slices)-1:
+ s = s + sequence[(slices[i][1]+1):(slices[i+1][0])]
+ #last slice
+ elif slices[i][1] < len(sequence)-1:
+ s = s + sequence[(slices[i][1]+1):(len(sequence))]
+ return s,coordstr
+
+
+def runGlobPlot():
+ try:
+ smoothFrame = int(sys.argv[1])
+ DOM_joinFrame = int(sys.argv[2])
+ DOM_peakFrame = int(sys.argv[3])
+ DIS_joinFrame = int(sys.argv[4])
+ DIS_peakFrame = int(sys.argv[5])
+ file = str(sys.argv[6])
+ db = open(file,'r')
+ except:
+ print 'Usage:'
+ print ' ./GlobPipe.py SmoothFrame DOMjoinFrame DOMpeakFrame DISjoinFrame DISpeakFrame FASTAfile'
+ print ' Optimised for ELM: ./GlobPlot.py 10 8 75 8 8 sequence_file'
+ print ' Webserver settings: ./GlobPlot.py 10 15 74 4 5 sequence_file'
+ raise SystemExit
+ parser = Fasta.RecordParser()
+ iterator = Fasta.Iterator(db,parser)
+ while 1:
+ try:
+ cur_record = iterator.next()
+ #uppercase is searchspace
+ seq = upper(cur_record.sequence)
+ # sum function
+ sum_vector = Sum(seq,RL)
+ # Run Savitzky-Golay
+ smooth = SavitzkyGolay(`smoothFrame`,0, sum_vector)
+ dydx_vector = SavitzkyGolay(`smoothFrame`,1, sum_vector)
+ #test
+ sumHEAD = sum_vector[:smoothFrame]
+ sumTAIL = sum_vector[len(sum_vector)-smoothFrame:]
+ newHEAD = []
+ newTAIL = []
+ for i in range(len(sumHEAD)):
+ try:
+ dHEAD = (sumHEAD[i+1]-sumHEAD[i])/2
+ except:
+ dHEAD = (sumHEAD[i]-sumHEAD[i-1])/2
+ try:
+ dTAIL = (sumTAIL[i+1]-sumTAIL[i])/2
+ except:
+ dTAIL = (sumTAIL[i]-sumTAIL[i-1])/2
+ newHEAD.append(dHEAD)
+ newTAIL.append(dTAIL)
+ dydx_vector[:smoothFrame] = newHEAD
+ dydx_vector[len(dydx_vector)-smoothFrame:] = newTAIL
+ globdoms, globdis = getSlices(dydx_vector, DOM_joinFrame, DOM_peakFrame, DIS_joinFrame, DIS_peakFrame)
+ s_domMask, coordstrDOM = reportSlicesTXT(globdoms, seq, 'DOM')
+ s_final, coordstrDIS = reportSlicesTXT(globdis, s_domMask, 'DIS')
+ sys.stdout.write('>'+cur_record.title+coordstrDOM+coordstrDIS+'\n')
+ print s_final
+ print '\n'
+ except AttributeError:
+ break
+ return
+
+runGlobPlot()
--- /dev/null
+Academic Free License
+ Version 1.2
+
+This Academic Free License applies to any original work of authorship
+(the "Original Work") whose owner (the "Licensor") has placed the
+following notice immediately following the copyright notice for the
+Original Work:
+
+Licensed under the Academic Free License version 1.2
+
+Grant of License. Licensor hereby grants to any person obtaining a
+copy of the Original Work ("You") a world-wide, royalty-free,
+non-exclusive, perpetual, non-sublicenseable license (1) to use, copy,
+modify, merge, publish, perform, distribute and/or sell copies of the
+Original Work and derivative works thereof, and (2) under patent claims
+owned or controlled by the Licensor that are embodied in the Original
+Work as furnished by the Licensor, to make, use, sell and offer for
+sale the Original Work and derivative works thereof, subject to the
+following conditions.
+
+Attribution Rights. You must retain, in the Source Code of any
+Derivative Works that You create, all copyright, patent or trademark
+notices from the Source Code of the Original Work, as well as any
+notices of licensing and any descriptive text identified therein as an
+"Attribution Notice." You must cause the Source Code for any Derivative
+Works that You create to carry a prominent Attribution Notice reasonably
+calculated to inform recipients that You have modified the Original Work.
+
+Exclusions from License Grant. Neither the names of Licensor, nor the
+names of any contributors to the Original Work, nor any of their
+trademarks or service marks, may be used to endorse or promote products
+derived from this Original Work without express prior written permission
+of the Licensor.
+
+Warranty and Disclaimer of Warranty. Licensor warrants that the copyright
+in and to the Original Work is owned by the Licensor or that the Original
+Work is distributed by Licensor under a valid current license from the
+copyright owner. Except as expressly stated in the immediately proceeding
+sentence, the Original Work is provided under this License on an "AS IS"
+BASIS and WITHOUT WARRANTY, either express or implied, including, without
+limitation, the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL
+WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part
+of this License. No license to Original Work is granted hereunder except
+under this disclaimer.
+
+Limitation of Liability. Under no circumstances and under no legal theory,
+whether in tort (including negligence), contract, or otherwise, shall the
+Licensor be liable to any person for any direct, indirect, special,
+incidental, or consequential damages of any character arising as a result
+of this License or the use of the Original Work including, without
+limitation, damages for loss of goodwill, work stoppage, computer failure
+or malfunction, or any and all other commercial damages or losses. This
+limitation of liability shall not apply to liability for death or personal
+injury resulting from Licensor's negligence to the extent applicable law
+prohibits such limitation. Some jurisdictions do not allow the exclusion or
+limitation of incidental or consequential damages, so this exclusion and
+limitation may not apply to You.
+
+License to Source Code. The term "Source Code" means the preferred form of
+the Original Work for making modifications to it and all available
+documentation describing how to modify the Original Work. Licensor hereby
+agrees to provide a machine-readable copy of the Source Code of the Original
+Work along with each copy of the Original Work that Licensor distributes.
+Licensor reserves the right to satisfy this obligation by placing a
+machine-readable copy of the Source Code in an information repository
+reasonably calculated to permit inexpensive and convenient access by You for
+as long as Licensor continues to distribute the Original Work, and by
+publishing the address of that information repository in a notice immediately
+following the copyright notice that applies to the Original Work.
+
+Mutual Termination for Patent Action. This License shall terminate
+automatically and You may no longer exercise any of the rights granted to You
+by this License if You file a lawsuit in any court alleging that any OSI
+Certified open source software that is licensed under any license containing
+this "Mutual Termination for Patent Action" clause infringes any patent
+claims that are essential to use that software.
+
+Right to Use. You may use the Original Work in all ways not otherwise
+restricted or conditioned by this License or by law, and Licensor promises
+not to interfere with or be responsible for such uses by You.
+
+This license is Copyright (C) 2002 Lawrence E. Rosen. All rights reserved.
+Permission is hereby granted to copy and distribute this license without
+modification. This license may not be modified without the express written
+permission of its copyright owner.
+
+--
+END OF LICENSE. The following is intended to describe the essential
+differences between the Academic Free License (AFL) version 1.0 and other
+open source licenses:
+
+The Academic Free License is similar to the BSD, MIT, UoI/NCSA and Apache
+licenses in many respects but it is intended to solve a few problems with
+those licenses.
+
+* The AFL is written so as to make it clear what software is being
+licensed (by the inclusion of a statement following the copyright notice
+in the software). This way, the license functions better than a template
+license. The BSD, MIT and UoI/NCSA licenses apply to unidentified software.
+
+* The AFL contains a complete copyright grant to the software. The BSD
+and Apache licenses are vague and incomplete in that respect.
+
+* The AFL contains a complete patent grant to the software. The BSD, MIT,
+UoI/NCSA and Apache licenses rely on an implied patent license and contain
+no explicit patent grant.
+
+* The AFL makes it clear that no trademark rights are granted to the
+licensor's trademarks. The Apache license contains such a provision, but the
+BSD, MIT and UoI/NCSA licenses do not.
+
+* The AFL includes the warranty by the licensor that it either owns the
+copyright or that it is distributing the software under a license. None of
+the other licenses contain that warranty. All other warranties are disclaimed,
+as is the case for the other licenses.
+
+* The AFL is itself copyrighted (with the right granted to copy and distribute
+without modification). This ensures that the owner of the copyright to the
+license will control changes. The Apache license contains a copyright notice,
+but the BSD, MIT and UoI/NCSA licenses do not.
--- /dev/null
+Quick install:
+
+-install python2.2+
+-install Biopython from www.biopython.org
+
+-download TISEAN source: http://www.mpipks-dresden.mpg.de/~tisean/archive.html#source
+-compile the TISEAN package and get the sav_gol binary from the TISEAN_2.1/source_c directory,
+move it to the same directory as this archive was extracted to or change the path in
+the SavitzkyGolay routine.
+
+run globplot: ./GlobPlot.py
+
+
+note: only Russell/Linding propensities are currently in the script,
+you can replace them manually or mail and ask me to do it...but these
+parameters are the ones we had best results with!
+
+
+input: sequence_file is a fasta or file with multiple fasta sequences in!
+output: note that the masking is OPPOSITE the one the www servers is giving,
+CAPITAL letters means GlobDom or disorder!
+
+
+
+
+cheers
+r.
+
+GlobPlot & GlobPipe
+Rune Linding
+Copyright (C) 2003
+email: linding@embl.de
import java.io.FileNotFoundException;\r
import java.io.IOException;\r
import java.io.InputStream;\r
-\r
import java.util.Map;\r
import java.util.Set;\r
\r
import org.apache.log4j.Logger;\r
\r
-\r
import compbio.data.sequence.Score;\r
import compbio.data.sequence.SequenceUtil;\r
import compbio.data.sequence.UnknownFileFormatException;\r
-\r
import compbio.engine.client.Executable;\r
import compbio.engine.client.PipedExecutable;\r
import compbio.engine.client.SkeletalExecutable;\r
import compbio.runner.Util;\r
\r
/**\r
- * DisEMBL.py smooth_frame peak_frame join_frame fold_coils fold_hotloops\r
- * fold_rem465 sequence_file print \r
- * \r
- * 'A default run would be: ./DisEMBL.py 8 8 4 1.2 1.4 1.2 fasta_file > out' \r
- * \r
- * This version of DisEMBL is 1.4 (latest available for download in Feb 2011)\r
- * capable of outputting raw values \r
- * \r
- * The values of the parameters are hard coded in DisEMBL.py script. \r
- * smooth_frame=8 peak_frame=8 join_frame=4 fold_coils=1.2 fold_hotloops=1.4\r
- * fold_rem465=1.2 \r
- * \r
- * Changing these values are not recommended by developers, apart from smoothing window. \r
- * However, 5 orders of magnitude changes in this parameter does not change the output\r
- * so allowing this change also seems pointless. Finally, the binary, DisEMBL depends on\r
- * - Tisean is not happy with arbitruary changes to these values, so changing them can \r
- * lead to problems.\r
- * \r
+ * DisEMBL.py smooth_frame peak_frame join_frame fold_coils fold_hotloops\r
+ * fold_rem465 sequence_file print\r
+ * \r
+ * 'A default run would be: ./DisEMBL.py 8 8 4 1.2 1.4 1.2 fasta_file > out'\r
+ * \r
+ * This version of DisEMBL is 1.4 (latest available for download in Feb 2011)\r
+ * capable of outputting raw values\r
+ * \r
+ * The values of the parameters are hard coded in DisEMBL.py script.\r
+ * smooth_frame=8 peak_frame=8 join_frame=4 fold_coils=1.2 fold_hotloops=1.4\r
+ * fold_rem465=1.2\r
* \r
- * This is not a standard DisEMBL! The script has been modified! \r
+ * Changing these values are not recommended by developers, apart from smoothing\r
+ * window. However, 5 orders of magnitude changes in this parameter does not\r
+ * change the output so allowing this change also seems pointless. Finally, the\r
+ * binary, DisEMBL depends on - Tisean is not happy with arbitruary changes to\r
+ * these values, so changing them can lead to problems.\r
+ * \r
+ * \r
+ * This is not a standard DisEMBL! The script has been modified!\r
* \r
*/\r
public class Disembl extends SkeletalExecutable<Disembl>\r
\r
public static final String KEY_VALUE_SEPARATOR = Util.SPACE;\r
\r
+ /**\r
+ * For the region to be considered disordered the values must exceed these\r
+ */\r
+ public final double COILS_EXPECTATION_THRESHOLD = 0.43;\r
+ public final double REM_EXPECTATION_THRESHOLD = 0.5;\r
+ public final double LOOPS_EXPECTATION_THRESHOLD = 0.086;\r
+\r
/* The parameter list there must not contain same values! */\r
public Disembl() {\r
// remove default input to prevent it to appear in the parameters list\r
throws ResultNotAvailableException {\r
\r
InputStream inStream = null;\r
- Map<String, Set<Score>> results= null; \r
- try {\r
- inStream = new FileInputStream(new File(workDirectory,\r
- getOutput()));\r
- results = SequenceUtil.removeSequences(SequenceUtil.readDisembl(inStream));\r
- inStream.close();\r
- } catch (FileNotFoundException e) {\r
- log.error(e.getMessage(), e.getCause());\r
- throw new ResultNotAvailableException(e);\r
- } catch (IOException e) {\r
- log.error(e.getMessage(), e.getCause());\r
- throw new ResultNotAvailableException(e);\r
- } catch (UnknownFileFormatException e) {\r
- log.error(e.getMessage(), e.getCause());\r
- throw new ResultNotAvailableException(e);\r
- } catch (NullPointerException e) {\r
- log.error(e.getMessage(), e.getCause());\r
- throw new ResultNotAvailableException(e);\r
- }\r
- \r
+ Map<String, Set<Score>> results = null;\r
+ // How about getting ranges?\r
+ try {\r
+ inStream = new FileInputStream(new File(workDirectory, getOutput()));\r
+ results = SequenceUtil.removeSequences(SequenceUtil\r
+ .readDisembl(inStream));\r
+ inStream.close();\r
+ } catch (FileNotFoundException e) {\r
+ log.error(e.getMessage(), e.getCause());\r
+ throw new ResultNotAvailableException(e);\r
+ } catch (IOException e) {\r
+ log.error(e.getMessage(), e.getCause());\r
+ throw new ResultNotAvailableException(e);\r
+ } catch (UnknownFileFormatException e) {\r
+ log.error(e.getMessage(), e.getCause());\r
+ throw new ResultNotAvailableException(e);\r
+ } catch (NullPointerException e) {\r
+ log.error(e.getMessage(), e.getCause());\r
+ throw new ResultNotAvailableException(e);\r
+ }\r
+\r
return results;\r
}\r
\r
+++ /dev/null
-package compbio.runner.disorder;\r
-\r
-/**\r
- * \r
- * ./GlobPipe.py SmoothFrame DOMjoinFrame DOMpeakFrame DISjoinFrame DISpeakFrame\r
- * FASTAfile\r
- * \r
- * Optimised for ELM: ./GlobPlot.py 10 8 75 8 8 sequence_file\r
- * \r
- * Webserver settings: ./GlobPlot.py 10 15 74 4 5 sequence_file\r
- * \r
- * @author pvtroshin\r
- * \r
- */\r
-public class GlobProt {\r
-\r
-}\r
import java.io.ByteArrayInputStream;\r
import java.io.FileNotFoundException;\r
import java.io.IOException;\r
+import java.util.HashSet;\r
import java.util.List;\r
-import java.util.Set;\r
+import java.util.Map;\r
\r
-import compbio.data.msa.Annotation;\r
+import compbio.data.msa.SequenceAnnotation;\r
import compbio.data.sequence.FastaSequence;\r
import compbio.data.sequence.Score;\r
import compbio.data.sequence.SequenceUtil;\r
/*\r
* Annotation interface for AAConWS web service instance\r
*/\r
- Annotation<AACon> client = (Annotation<AACon>) Jws2Client.connect(\r
- "http://www.compbio.dundee.ac.uk/aacon", Services.AAConWS);\r
+ SequenceAnnotation<AACon> client = (SequenceAnnotation<AACon>) Jws2Client\r
+ .connect("http://www.compbio.dundee.ac.uk/aacon",\r
+ Services.AAConWS);\r
\r
/* Get the list of available presets */\r
PresetManager presetman = client.getPresets();\r
String jobId = client.presetAnalize(fastalist, preset);\r
\r
/* This method will block for the duration of the calculation */\r
- Set<Score> result = client.getAnnotation(jobId);\r
+ Map<String, HashSet<Score>> result = client.getAnnotation(jobId);\r
\r
/*\r
* This is a better way of obtaining results, it does not involve\r
// }\r
\r
/* Output the alignment to standard out */\r
- Score.write(result, System.out);\r
+ IOHelper.writeOut(System.out, result);\r
+ // Score.write(result, System.out);\r
\r
/* Alternatively, you can record retrieved alignment into the file */\r
// FileOutputStream out = new FileOutputStream("result.txt");\r
import java.util.ArrayList;\r
import java.util.HashSet;\r
import java.util.List;\r
+import java.util.Map;\r
\r
import org.testng.annotations.BeforeTest;\r
import org.testng.annotations.Test;\r
\r
-import compbio.data.msa.Annotation;\r
import compbio.data.msa.JABAService;\r
+import compbio.data.msa.SequenceAnnotation;\r
import compbio.data.sequence.ConservationMethod;\r
import compbio.data.sequence.FastaSequence;\r
import compbio.data.sequence.Score;\r
\r
public class TestAAConWS {\r
\r
- Annotation<AACon> msaws;\r
+ SequenceAnnotation<AACon> msaws;\r
\r
@BeforeTest\r
void initConnection() {\r
*/\r
JABAService client = Jws2Client.connect("http://localhost:8080/jabaws",\r
Services.AAConWS);\r
- msaws = (Annotation<AACon>) client;\r
+ msaws = (SequenceAnnotation<AACon>) client;\r
}\r
\r
@Test\r
System.out.println("Pres: " + msaws.getPresets().getPresets());\r
String jobId = msaws.analize(fsl);\r
System.out.println("J: " + jobId);\r
- HashSet<Score> result = msaws.getAnnotation(jobId);\r
+ Map<String, HashSet<Score>> result = msaws.getAnnotation(jobId);\r
assertNotNull(result);\r
assertEquals(result.size(), 1);\r
- assertEquals(result.iterator().next().getMethod(),\r
- ConservationMethod.SHENKIN);\r
- List<Float> scores = result.iterator().next().getScores();\r
+ assertEquals(result.values().iterator().next().iterator().next()\r
+ .getMethod(), ConservationMethod.SHENKIN);\r
+ List<Float> scores = result.values().iterator().next().iterator()\r
+ .next().getScores();\r
assertNotNull(scores);\r
assertEquals(scores.size(), 568);\r
\r
PresetManager<AACon> presets = msaws.getPresets();\r
String jobId = msaws.presetAnalize(fsl,\r
presets.getPresetByName("Quick conservation"));\r
- HashSet<Score> result = msaws.getAnnotation(jobId);\r
+ Map<String, HashSet<Score>> result = msaws.getAnnotation(jobId);\r
assertNotNull(result);\r
assertEquals(result.size(), 13);\r
\r
// .setDefaultValue("MAX_SCORE");\r
// options.getArgument("SMERFS Gap Threshhold").setDefaultValue("1");\r
String jobId = msaws.customAnalize(fsl, options.getArguments());\r
- HashSet<Score> result = msaws.getAnnotation(jobId);\r
+ Map<String, HashSet<Score>> result = msaws.getAnnotation(jobId);\r
assertNotNull(result);\r
assertEquals(result.size(), 1);\r
assertEquals(\r
- new ArrayList<Score>(result).get(0).getScores().get(0),\r
- 0.698f);\r
+ new ArrayList<Score>(result.values().iterator().next())\r
+ .get(0).getScores().get(0), 0.698f);\r
\r
options.getArgument("Calculation method").setDefaultValue("SMERFS");\r
options.removeArgument("Normalize");\r
assertNotNull(result);\r
assertEquals(result.size(), 1);\r
assertEquals(\r
- new ArrayList<Score>(result).get(0).getScores().get(0),\r
- 0.401f);\r
+ new ArrayList<Score>(result.values().iterator().next())\r
+ .get(0).getScores().get(0), 0.401f);\r
\r
} catch (WrongParameterException e) {\r
e.printStackTrace();\r
package compbio.data.msa;\r
\r
import java.security.InvalidParameterException;\r
+import java.util.HashMap;\r
import java.util.HashSet;\r
import java.util.List;\r
\r
/**\r
* Interface for tools that results to one or more annotation to sequence(s)\r
* \r
+ * Single, multiple sequences their groups or alignments can be annotated\r
+ * \r
* @author Peter Troshin\r
* \r
* @param <T>\r
* @version 1.0 November 2010\r
*/\r
@WebService(targetNamespace = "http://msa.data.compbio/01/12/2010/")\r
-public interface Annotation<T> extends JABAService, JManagement, Metadata<T> {\r
+public interface SequenceAnnotation<T>\r
+ extends\r
+ JABAService,\r
+ JManagement,\r
+ Metadata<T> {\r
\r
/**\r
* \r
* \r
* @param jobId\r
* a unique job identifier\r
- * @return the HashSet of Score objects\r
+ * @return the Map with the sequence names, sequence group names or the word\r
+ * 'Alignment' in case of alignments and values the represented by a\r
+ * Set of Score objects. The alignment can be represented in as\r
+ * little as one key->value pair in this map, the list of sequences\r
+ * will be represented by multiple key->value mappings. If multiple\r
+ * annotations were calculated, then they are represented as a Set\r
+ * of Scores.\r
* @throws ResultNotAvailableException\r
* this exception is throw if the job execution was not\r
* successful or the result of the execution could not be found.\r
* @throws InvalidParameterException\r
* thrown if jobId is empty or cannot be recognised e.g. in\r
* invalid format\r
+ * \r
*/\r
@WebMethod\r
- HashSet<Score> getAnnotation(@WebParam(name = "jobId") String jobId)\r
+ HashMap<String, HashSet<Score>> getAnnotation(\r
+ @WebParam(name = "jobId") String jobId)\r
throws ResultNotAvailableException;\r
-\r
+ /*\r
+ * The method should really return Map and Set, but unfortunately JAXB\r
+ * cannot serialize interfaces, has a concrete implementation is used Could\r
+ * also specify the generic Set e.g. ? extends Set. But this would require\r
+ * the client cast or operate with generic Set. Keep it simple for now.\r
+ */\r
}\r
\r
package compbio.data.msa.jaxws;\r
\r
+import java.util.HashMap;\r
import java.util.HashSet;\r
import javax.xml.bind.annotation.XmlAccessType;\r
import javax.xml.bind.annotation.XmlAccessorType;\r
public class GetAnnotationResponse {\r
\r
@XmlElement(name = "return", namespace = "")\r
- private HashSet<compbio.data.sequence.Score> _return;\r
+ private HashMap<String, HashSet<compbio.data.sequence.Score>> _return;\r
\r
/**\r
* \r
* @return\r
- * returns HashSet<Score>\r
+ * returns HashMap<String,HashSet<Score>>\r
*/\r
- public HashSet<compbio.data.sequence.Score> getReturn() {\r
+ public HashMap<String, HashSet<compbio.data.sequence.Score>> getReturn() {\r
return this._return;\r
}\r
\r
* @param _return\r
* the value for the _return property\r
*/\r
- public void setReturn(HashSet<compbio.data.sequence.Score> _return) {\r
+ public void setReturn(HashMap<String, HashSet<compbio.data.sequence.Score>> _return) {\r
this._return = _return;\r
}\r
\r
import java.io.OutputStream;\r
import java.net.MalformedURLException;\r
import java.net.URL;\r
+import java.util.HashSet;\r
import java.util.List;\r
+import java.util.Map;\r
import java.util.Set;\r
import java.util.logging.Level;\r
import java.util.logging.Logger;\r
import javax.xml.ws.Service;\r
import javax.xml.ws.WebServiceException;\r
\r
-import compbio.data.msa.Annotation;\r
+import compbio.data.msa.SequenceAnnotation;\r
import compbio.data.sequence.FastaSequence;\r
import compbio.data.sequence.Score;\r
import compbio.data.sequence.SequenceUtil;\r
File parametersFile = IOHelper.getFile(cmd, paramFile, true);\r
String presetName = CmdHelper.getPresetName(cmd);\r
\r
- Annotation<AAConWS> msaws = connect();\r
+ SequenceAnnotation<AAConWS> msaws = connect();\r
Preset<AAConWS> preset = null;\r
if (presetName != null) {\r
preset = MetadataHelper.getPreset(msaws, presetName);\r
customOptions = MetadataHelper.processParameters(prms,\r
msaws.getRunnerOptions());\r
}\r
- Set<Score> result = null;\r
+ Map<String, HashSet<Score>> result = null;\r
if (inputFile != null) {\r
System.out.println("Calculating conservation...");\r
result = analize(inputFile, msaws, preset, customOptions);\r
* @param result\r
* the AACon scores to output\r
*/\r
- static void writeOut(OutputStream outStream, Set<Score> result) {\r
+ static void writeOut(OutputStream outStream,\r
+ Map<String, HashSet<Score>> result) {\r
try {\r
- Score.write(result, outStream);\r
+ for (Map.Entry<String, ? extends Set<Score>> entry : result\r
+ .entrySet()) {\r
+ System.out.println(">" + entry.getKey());\r
+ Score.write(entry.getValue(), outStream);\r
+ }\r
} catch (IOException e) {\r
System.err\r
.println("Problems writing output file! Stack trace is below: ");\r
* Connects to a AACon web service by the host and the service name\r
* \r
* \r
- * @return {@link Annotation}\r
+ * @return {@link AlignmentAnnotation}\r
* @throws WebServiceException\r
* if cannot connect to a web service\r
*/\r
- public static Annotation<AAConWS> connect() throws WebServiceException {\r
+ public static SequenceAnnotation<AAConWS> connect()\r
+ throws WebServiceException {\r
URL url = null;\r
log.log(Level.FINE, "Attempting to connect...");\r
try {\r
QName portName = new QName(QUALIFIED_SERVICE_NAME, "AAConWS" + "Port");\r
\r
@SuppressWarnings("unchecked")\r
- Annotation<AAConWS> serviceIF = serv\r
- .getPort(portName, Annotation.class);\r
+ SequenceAnnotation<AAConWS> serviceIF = serv.getPort(portName,\r
+ SequenceAnnotation.class);\r
\r
log.log(Level.FINE, "Connected successfully!");\r
return serviceIF;\r
* @return Set<Score> the conservation scores\r
* @throws UnknownFileFormatException\r
*/\r
- static Set<Score> analize(File file, Annotation<AAConWS> wsproxy,\r
- Preset<AAConWS> preset, List<Option<AAConWS>> customOptions) {\r
+ static Map<String, HashSet<Score>> analize(File file,\r
+ SequenceAnnotation<AAConWS> wsproxy, Preset<AAConWS> preset,\r
+ List<Option<AAConWS>> customOptions) {\r
\r
List<FastaSequence> fastalist = null;\r
- Set<Score> scores = null;\r
+ Map<String, HashSet<Score>> scores = null;\r
try {\r
fastalist = SequenceUtil.openInputStream(file.getAbsolutePath());\r
\r
import java.io.IOException;\r
import java.io.OutputStream;\r
import java.util.ArrayList;\r
+import java.util.HashSet;\r
import java.util.List;\r
-import java.util.Set;\r
+import java.util.Map;\r
\r
import compbio.data.sequence.Alignment;\r
import compbio.data.sequence.ClustalAlignmentUtil;\r
* @param result\r
* the AACon scores to output\r
*/\r
- static void writeOut(OutputStream outStream, Set<Score> result) {\r
+ static void writeOut(OutputStream outStream,\r
+ Map<String, HashSet<Score>> result) {\r
try {\r
- Score.write(result, outStream);\r
+ for (Map.Entry<String, HashSet<Score>> entry : result.entrySet()) {\r
+ System.out.println(">" + entry.getKey());\r
+ Score.write(entry.getValue(), outStream);\r
+ }\r
} catch (IOException e) {\r
System.err\r
.println("Problems writing output file! Stack trace is below: ");\r
import java.net.MalformedURLException;\r
import java.net.URL;\r
import java.util.Arrays;\r
+import java.util.HashSet;\r
import java.util.List;\r
-import java.util.Set;\r
+import java.util.Map;\r
import java.util.logging.Level;\r
import java.util.logging.Logger;\r
\r
import javax.xml.ws.Service;\r
import javax.xml.ws.WebServiceException;\r
\r
-import compbio.data.msa.Annotation;\r
import compbio.data.msa.JABAService;\r
import compbio.data.msa.Metadata;\r
import compbio.data.msa.MsaWS;\r
+import compbio.data.msa.SequenceAnnotation;\r
import compbio.data.sequence.Alignment;\r
import compbio.data.sequence.FastaSequence;\r
import compbio.data.sequence.Score;\r
outStream = System.out;\r
}\r
if (service == Services.AAConWS) {\r
- Set<Score> result = analize(inputFile, ((Annotation<T>) msaws),\r
- preset, customOptions);\r
+ Map<String, HashSet<Score>> result = analize(inputFile,\r
+ ((SequenceAnnotation<T>) msaws), preset, customOptions);\r
IOHelper.writeOut(outStream, result);\r
} else {\r
alignment = align(inputFile, (MsaWS<T>) msaws, preset,\r
* @return Set<Score> the conservation scores\r
* @throws UnknownFileFormatException\r
*/\r
- <T> Set<Score> analize(File file, Annotation<T> wsproxy, Preset<T> preset,\r
+ <T> Map<String, HashSet<Score>> analize(File file,\r
+ SequenceAnnotation<T> wsproxy, Preset<T> preset,\r
List<Option<T>> customOptions) {\r
\r
List<FastaSequence> fastalist = null;\r
- Set<Score> scores = null;\r
+ Map<String, HashSet<Score>> scores = null;\r
try {\r
fastalist = SequenceUtil.openInputStream(file.getAbsolutePath());\r
\r
import javax.xml.namespace.QName;\r
import javax.xml.ws.Service;\r
\r
-import compbio.data.msa.Annotation;\r
import compbio.data.msa.JABAService;\r
import compbio.data.msa.MsaWS;\r
+import compbio.data.msa.SequenceAnnotation;\r
\r
/**\r
* List of web services currently supported by JABAWS version 2\r
\r
switch (this) {\r
case AAConWS :\r
- return service.getPort(portName, Annotation.class);\r
+ return service.getPort(portName, SequenceAnnotation.class);\r
\r
// deliberate leaking\r
case ClustalWS :\r
\r
import java.io.File;\r
import java.util.Arrays;\r
+import java.util.HashMap;\r
import java.util.HashSet;\r
import java.util.List;\r
\r
\r
import org.apache.log4j.Logger;\r
\r
-import compbio.data.msa.Annotation;\r
+import compbio.data.msa.SequenceAnnotation;\r
import compbio.data.sequence.FastaSequence;\r
import compbio.data.sequence.Score;\r
import compbio.engine.AsyncExecutor;\r
import compbio.runner.Util;\r
import compbio.runner.conservation.AACon;\r
\r
-@WebService(endpointInterface = "compbio.data.msa.Annotation", targetNamespace = "http://msa.data.compbio/01/12/2010/", serviceName = "AAConWS")\r
-public class AAConWS implements Annotation<AACon> {\r
+@WebService(endpointInterface = "compbio.data.msa.SequenceAnnotation", targetNamespace = "http://msa.data.compbio/01/12/2010/", serviceName = "AAConWS")\r
+public class AAConWS implements SequenceAnnotation<AACon> {\r
\r
// Ask for resource injection\r
@Resource\r
}\r
\r
@Override\r
- public HashSet<Score> getAnnotation(String jobId)\r
+ public HashMap<String, HashSet<Score>> getAnnotation(String jobId)\r
throws ResultNotAvailableException {\r
WSUtil.validateJobId(jobId);\r
AsyncExecutor asyncEngine = Configurator.getAsyncEngine(jobId);\r
ConfiguredExecutable<AACon> aacon = (ConfiguredExecutable<AACon>) asyncEngine\r
.getResults(jobId);\r
HashSet<Score> mas = aacon.getResults();\r
+ HashMap<String, HashSet<Score>> result = new HashMap<String, HashSet<Score>>();\r
+ result.put("Alignment", mas);\r
log.trace(jobId + " getConservation : " + mas);\r
- return mas;\r
+ return result;\r
}\r
/*\r
* @SuppressWarnings("unchecked") public JalviewAnnotation\r
--- /dev/null
+package compbio.ws.server;\r
+\r
+import java.util.HashMap;\r
+import java.util.HashSet;\r
+import java.util.List;\r
+\r
+import javax.annotation.Resource;\r
+import javax.jws.WebService;\r
+import javax.xml.ws.WebServiceContext;\r
+\r
+import org.apache.log4j.Logger;\r
+\r
+import compbio.data.msa.SequenceAnnotation;\r
+import compbio.data.sequence.FastaSequence;\r
+import compbio.data.sequence.Score;\r
+import compbio.engine.AsyncExecutor;\r
+import compbio.engine.Configurator;\r
+import compbio.engine.client.ConfiguredExecutable;\r
+import compbio.metadata.ChunkHolder;\r
+import compbio.metadata.JobStatus;\r
+import compbio.metadata.JobSubmissionException;\r
+import compbio.metadata.Limit;\r
+import compbio.metadata.LimitExceededException;\r
+import compbio.metadata.LimitsManager;\r
+import compbio.metadata.Option;\r
+import compbio.metadata.Preset;\r
+import compbio.metadata.PresetManager;\r
+import compbio.metadata.ResultNotAvailableException;\r
+import compbio.metadata.RunnerConfig;\r
+import compbio.metadata.UnsupportedRuntimeException;\r
+import compbio.metadata.WrongParameterException;\r
+import compbio.runner.Util;\r
+import compbio.runner.disorder.Disembl;\r
+\r
+@WebService(endpointInterface = "compbio.data.msa.SequenceAnnotation", targetNamespace = "http://msa.data.compbio/01/12/2010/", serviceName = "DisemblWS")\r
+public class DisemblWS implements SequenceAnnotation<Disembl> {\r
+\r
+ // Ask for resource injection\r
+ @Resource\r
+ WebServiceContext wsContext;\r
+\r
+ private static Logger statLog = Logger.getLogger("DisemblWS-stats");\r
+\r
+ private static Logger log = Logger.getLogger(DisemblWS.class);\r
+\r
+ private static final RunnerConfig<Disembl> disemblOptions = Util\r
+ .getSupportedOptions(Disembl.class);\r
+\r
+ private static final PresetManager<Disembl> disemblPresets = Util\r
+ .getPresets(Disembl.class);\r
+\r
+ ConfiguredExecutable<Disembl> init(List<FastaSequence> sequences)\r
+ throws JobSubmissionException {\r
+ Disembl disembl = new Disembl();\r
+ disembl.setInput("fasta.in").setOutput("disembl.out");\r
+ return Configurator.configureExecutable(disembl, sequences);\r
+ }\r
+\r
+ @Override\r
+ public HashMap<String, HashSet<Score>> getAnnotation(String jobId)\r
+ throws ResultNotAvailableException {\r
+ WSUtil.validateJobId(jobId);\r
+ AsyncExecutor asyncEngine = Configurator.getAsyncEngine(jobId);\r
+ ConfiguredExecutable<Disembl> aacon = (ConfiguredExecutable<Disembl>) asyncEngine\r
+ .getResults(jobId);\r
+ HashMap<String, HashSet<Score>> mas = aacon.getResults();\r
+ log.trace(jobId + " getConservation : " + mas);\r
+ return mas;\r
+ }\r
+\r
+ @Override\r
+ public Limit<Disembl> getLimit(String presetName) {\r
+ return new Disembl().getLimit(presetName);\r
+ }\r
+\r
+ @Override\r
+ public LimitsManager<Disembl> getLimits() {\r
+ return new Disembl().getLimits();\r
+ }\r
+\r
+ @Override\r
+ public ChunkHolder pullExecStatistics(String jobId, long position) {\r
+ // Execution stat is not supported\r
+ return new ChunkHolder("", -1);\r
+ }\r
+\r
+ @Override\r
+ public boolean cancelJob(String jobId) {\r
+ WSUtil.validateJobId(jobId);\r
+ return WSUtil.cancelJob(jobId);\r
+ }\r
+\r
+ @Override\r
+ public JobStatus getJobStatus(String jobId) {\r
+ WSUtil.validateJobId(jobId);\r
+ return WSUtil.getJobStatus(jobId);\r
+ }\r
+\r
+ @Override\r
+ public PresetManager<Disembl> getPresets() {\r
+ return disemblPresets;\r
+ }\r
+\r
+ @Override\r
+ public RunnerConfig<Disembl> getRunnerOptions() {\r
+ return disemblOptions;\r
+ }\r
+\r
+ String analize(List<FastaSequence> sequences,\r
+ ConfiguredExecutable<Disembl> confExec, Logger log, String method,\r
+ Limit<Disembl> limit) throws JobSubmissionException {\r
+ if (limit != null && limit.isExceeded(sequences)) {\r
+ throw LimitExceededException.newLimitExceeded(limit, sequences);\r
+ }\r
+\r
+ compbio.runner.Util.writeInput(sequences, confExec);\r
+ AsyncExecutor engine = Configurator.getAsyncEngine(confExec);\r
+ String jobId = engine.submitJob(confExec);\r
+ return jobId;\r
+ }\r
+\r
+ @Override\r
+ public String analize(List<FastaSequence> sequences)\r
+ throws UnsupportedRuntimeException, LimitExceededException,\r
+ JobSubmissionException {\r
+ WSUtil.validateFastaInput(sequences);\r
+ ConfiguredExecutable<Disembl> confDisembl = init(sequences);\r
+\r
+ return analize(sequences, confDisembl, null, "analize", getLimit(""));\r
+ }\r
+\r
+ /*\r
+ * No options are supported, thus the result of this call will be as simple\r
+ * call to analize without parameters\r
+ */\r
+ @Override\r
+ public String customAnalize(List<FastaSequence> sequences,\r
+ List<Option<Disembl>> options) throws UnsupportedRuntimeException,\r
+ LimitExceededException, JobSubmissionException,\r
+ WrongParameterException {\r
+ return analize(sequences);\r
+ }\r
+\r
+ /*\r
+ * No presets are supported, thus the result of this call will be as simple\r
+ * call to analize without parameters\r
+ */\r
+ @Override\r
+ public String presetAnalize(List<FastaSequence> sequences,\r
+ Preset<Disembl> preset) throws UnsupportedRuntimeException,\r
+ LimitExceededException, JobSubmissionException,\r
+ WrongParameterException {\r
+\r
+ return analize(sequences);\r
+ }\r
+\r
+}\r
package compbio.ws.server;\r
\r
import java.io.File;\r
+import java.util.HashMap;\r
import java.util.HashSet;\r
import java.util.List;\r
\r
\r
import org.apache.log4j.Logger;\r
\r
-import compbio.data.msa.Annotation;\r
+import compbio.data.msa.SequenceAnnotation;\r
import compbio.data.sequence.FastaSequence;\r
import compbio.data.sequence.Score;\r
import compbio.engine.AsyncExecutor;\r
import compbio.runner.conservation.AACon;\r
import compbio.runner.disorder.Jronn;\r
\r
-@WebService(endpointInterface = "compbio.data.msa.Annotation", targetNamespace = "http://msa.data.compbio/01/12/2010/", serviceName = "JronnWS")\r
-public class JronnWS implements Annotation<Jronn> {\r
+@WebService(endpointInterface = "compbio.data.msa.SequenceAnnotation", targetNamespace = "http://msa.data.compbio/01/12/2010/", serviceName = "JronnWS")\r
+public class JronnWS implements SequenceAnnotation<Jronn> {\r
\r
// Ask for resource injection\r
@Resource\r
\r
private static Logger log = Logger.getLogger(JronnWS.class);\r
\r
- private static final RunnerConfig<Jronn> aaconOptions = Util\r
+ private static final RunnerConfig<Jronn> jronnOptions = Util\r
.getSupportedOptions(Jronn.class);\r
\r
- private static final PresetManager<Jronn> aaconPresets = Util\r
+ private static final PresetManager<Jronn> jronnPresets = Util\r
.getPresets(Jronn.class);\r
\r
ConfiguredExecutable<Jronn> init(List<FastaSequence> sequences)\r
throws JobSubmissionException {\r
Jronn jronn = new Jronn();\r
- jronn.setInput("fasta.in").setOutput("aacon.out");\r
+ jronn.setInput("fasta.in").setOutput("jronn.out");\r
return Configurator.configureExecutable(jronn, sequences);\r
}\r
\r
@Override\r
- public HashSet<Score> getAnnotation(String jobId)\r
+ public HashMap<String, HashSet<Score>> getAnnotation(String jobId)\r
throws ResultNotAvailableException {\r
WSUtil.validateJobId(jobId);\r
AsyncExecutor asyncEngine = Configurator.getAsyncEngine(jobId);\r
- ConfiguredExecutable<AACon> aacon = (ConfiguredExecutable<AACon>) asyncEngine\r
+ ConfiguredExecutable<Jronn> jronn = (ConfiguredExecutable<Jronn>) asyncEngine\r
.getResults(jobId);\r
- HashSet<Score> mas = aacon.getResults();\r
+ HashMap<String, HashSet<Score>> mas = jronn.getResults();\r
log.trace(jobId + " getConservation : " + mas);\r
return mas;\r
}\r
\r
@Override\r
public PresetManager<Jronn> getPresets() {\r
- return aaconPresets;\r
+ return jronnPresets;\r
}\r
\r
@Override\r
public RunnerConfig<Jronn> getRunnerOptions() {\r
- return aaconOptions;\r
+ return jronnOptions;\r
}\r
\r
String analize(List<FastaSequence> sequences,\r
throws UnsupportedRuntimeException, LimitExceededException,\r
JobSubmissionException {\r
WSUtil.validateFastaInput(sequences);\r
- ConfiguredExecutable<Jronn> confAAcon = init(sequences);\r
+ ConfiguredExecutable<Jronn> confJronn = init(sequences);\r
\r
- // set default conservation method to fastest - SHENKIN\r
- return analize(sequences, confAAcon, null, "analize", getLimit(""));\r
+ return analize(sequences, confJronn, null, "analize", getLimit(""));\r
}\r
\r
@Override\r
WrongParameterException {\r
WSUtil.validateFastaInput(sequences);\r
ConfiguredExecutable<Jronn> confJronn = init(sequences);\r
- // Could not do that! Space separated values\r
- // will all be treated as keys! thus duplicates removed\r
- // String params = cbuilder.getCommand();\r
+\r
List<String> params = WSUtil.getCommands(options,\r
AACon.KEY_VALUE_SEPARATOR);\r
confJronn.addParameters(params);\r