From b19ba854e94aba9f321cddbc83cc1c0d677150f3 Mon Sep 17 00:00:00 2001 From: Hashem Ali Shihab Date: Wed, 12 Dec 2012 16:23:15 +0000 Subject: [PATCH] v2.1 Changes --- README.md | 21 +- cgi-bin/fathmm.py | 78 +--- cgi-bin/results.cgi | 407 +++++++++++++++++-- index.html | 2 +- tmp/d8104d9d-c490-4b14-863c-d180a5c2492f.out | 10 - 5 files changed, 373 insertions(+), 145 deletions(-) delete mode 100644 tmp/d8104d9d-c490-4b14-863c-d180a5c2492f.out diff --git a/README.md b/README.md index 3859ce0..792de72 100644 --- a/README.md +++ b/README.md @@ -15,19 +15,9 @@ You will need the following packages installed on your system: * Our pre-computed database, including instructions on how to create/upload the database, can be found at ftp://supfam2.cs.bris.ac.uk/FATHMM/database -* Create a configuration file named "config.ini" and enter the following (substituting -the required information with your credentials): - -``` -[DATABASE] -HOST = [MySQL Host] -PORT = [MySQL Port] -USER = [MySQL Username] -PASSWD = [MySQL Password] -DB = fathmm -``` - -* Download "fathmm.py" from ./cgi-bin +* Download "fathmm.py" and "config.ini" from the ./cgi-bin folder +* Amend "config.ini", substituting the required information with your MySQL +credentials: ## Running our Software @@ -55,6 +45,8 @@ P43026 L441P P35555 N548I,E1073K,C2307S ``` +## Optional Parameters + The --help parameter can be used to view additional program parameters. In brief, there are two optional parameters: @@ -88,7 +80,4 @@ KW : UniProtKB KeyWords ## Known Issues: -* Our predictions appear to be derived/written slower than previous version(s) of our -software - we are looking into this issue and will provide an update as soon as possible. - We welcome any comments and/or suggestions that you may have regarding our software and server - please send an email directly to fathmm@biocompute.org.uk diff --git a/cgi-bin/fathmm.py b/cgi-bin/fathmm.py index 3c12e23..5ba1d36 100755 --- a/cgi-bin/fathmm.py +++ b/cgi-bin/fathmm.py @@ -167,7 +167,7 @@ def process_record(dbSNP, protein, substitution): Tag = "DAMAGING" else: # "Cancer-Associated" predictions ... - Tag = "NON-CANCER/PASSENGER" + Tag = "PASSENGER/OTHER" if float(Score) < -0.50: Tag = "CANCER" @@ -217,13 +217,6 @@ def process_record(dbSNP, protein, substitution): metavar = "", default = "DO" ) - parser.add_option( - "--HTML", - dest = "HTML", - help = SUPPRESS_HELP, - action = "store_true", - default = False - ) # web-based parameter used to write HTML predictions - hidden from program user(s) (options, args) = parser.parse_args() @@ -321,72 +314,3 @@ def process_record(dbSNP, protein, substitution): # move predictions to the requested location os.system("mv /tmp/" + os.path.basename(os.path.splitext(options.input)[0]) + ".tmp " + options.output) - - # - # WRITE WEB-BASED PREDICTIONS (IF REQUESTED) - # - - if options.HTML: - HTM = open(os.path.splitext(options.output)[0] + ".htm", "w") - HTM.write( -""" - - - - - - - - - - - - - -""" - ) - - for record in open(options.output, "r"): - if record and not record.startswith("#"): - record = record.split("\t") - - # prediction formatting - if record[4] in [ "DAMAGING", "CANCER" ]: - record[4] = "

%s

"% record[4] - else: - record[4] = "

%s

"% record[4] - - # warning/phenotypes formatting - if record[7].strip(): - record[6] = record[7] - else: - if record[6].strip(): - record[6] = "" - - HTM.write( -""" - - - - - - - - - -""" - ) - - HTM.write( -""" - -
#dbSNP IDProtein IDSubstitutionPredictionScoreFurther Information
""" + record[0] + """""" + record[1] + """""" + record[2] + """""" + record[3] + """""" + record[4] + """""" + record[5] + """""" + record[6] + """
- - -""" - ) diff --git a/cgi-bin/results.cgi b/cgi-bin/results.cgi index 0b2cd7b..da4ffec 100755 --- a/cgi-bin/results.cgi +++ b/cgi-bin/results.cgi @@ -6,16 +6,17 @@ import time import uuid import shlex import subprocess +import traceback import cgi import cgitb; cgitb.enable() # if __name__ == '__main__': + print "Content-Type: text/html" + print + try: - print "Content-Type: text/html" - print - # if new submission, perform our analysis/predictions in the background ... HTMLForm = cgi.FieldStorage() HTMLTime = time.gmtime() @@ -23,7 +24,7 @@ if __name__ == '__main__': if not HTMLForm.has_key('session'): while True: - # assert a unique session is generated + # assert a unique session is generated ... HTMLSession = str(uuid.uuid4()) if not os.path.exists("../tmp/" + HTMLSession + ".txt"): @@ -44,25 +45,25 @@ if __name__ == '__main__': '-i', '../tmp/' + HTMLSession + '.txt', '-o', '../tmp/' + HTMLSession + '.tab', '-w', str(HTMLForm['weighted'].value), - '-p', str(HTMLForm['phenotypes'].value), - '--HTML' + '-p', str(HTMLForm['phenotypes'].value) ], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE) # else: - # fetch predictions from previous session + # ...otherwise, fetch predictions from a previous session HTMLSession = str(HTMLForm['session'].value).strip() - - + # assert the submission exists ... if os.path.exists("../tmp/" + HTMLSession + ".txt"): - print """ + # assert results/predictions have been written + if os.path.exists("../tmp/" + HTMLSession + ".tab"): + print """ - - + + - fathmm - Inherited Mutation Analysis + fathmm - fathmm Predictions @@ -88,24 +89,6 @@ if __name__ == '__main__': - - - @@ -143,21 +126,66 @@ if __name__ == '__main__':

fathmm Predictions

- Your request is now being processed and our predictions will be written to your screen once completed - if you submitted a large batch; - please be patient as this may take a while.  Alternatively, please note your Job/Session ID below to retrieve your results at - a later time. + Your request has now been processed and our predictions have been written onto your screen - a "tab-delimited" report of our predictions + has been made available below.  In addition, you can retrieve your results at any time using the below Job/Session Identifier.

Job/Session ID: """ + HTMLSession + """

- Processing Request ... + Download »

-
+ + + + + + + + + + + + + + """ + + for record in open("../tmp/" + HTMLSession + ".tab", "r"): + if record and not record.startswith("#"): + record = record.split("\t") + + # prediction formatting + if record[4] in [ "DAMAGING", "CANCER" ]: + record[4] = "

%s

"% record[4] + else: + record[4] = "

%s

"% record[4] + + # warning/phenotypes formatting + if record[7].strip(): + record[6] = record[7] + else: + if record[6].strip(): + record[6] = "
    " + "".join([ "
  • " + x + "
  • " for x in record[6].split("|") ]) + "
" + + print """ + + + + + + + + + + """ + + print """ + +
#dbSNP IDProtein IDSubstitutionPredictionScoreFurther Information
""" + record[0] + """""" + record[1] + """""" + record[2] + """""" + record[3] + """""" + record[4] + """""" + record[5] + """""" + record[6] + """
@@ -173,14 +201,311 @@ if __name__ == '__main__': - """ + """ + # + else: + print """ + + + + + + + fathmm - Processing Submission + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

fathmm Predictions

+

+ Your request is now being processed and our predictions will be written onto your screen once completed - if you submitted a large batch, + please be patient as this may take a while.  Alternatively, you can retrieve your results at any time using the below Job/Session + Identifier. +
+
+ Job/Session ID: """ + HTMLSession + """ +

+

+ Processing Request ... +

+
+ +
+
+

+ We welcome any comments and/or suggestions that you may have regarding our software and server - please send an email directly to fathmm@biocompute.org.uk +

+
+
+ + + + + + """ + # else: + # ... either there is no submission or the previous submission + # has been deleted + print """ + + + + + + + fathmm - Unknown Job/Session Identifier + + + + + + + + + + + + + + + + + + + + + + + + +
- print "Unknown Session" + + +
+

Unknown Job/Session Identifier

+

+ You have entered an invalid or unknown Job/Session Identifier - please note, predictions are typically stored on our server for one week before being deleted. +

+
+
+
+

+ We welcome any comments and/or suggestions that you may have regarding our software and server - please send an email directly to fathmm@biocompute.org.uk +

+
+
+ + + + + """ # except Exception, e: - print "Content-Type: text/html" - print - print e + print """ + + + + + + + fathmm - Server Error + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

Server Error

+

+ It appears there is a problem with our server - please try again and/or report the problem to the system administrator + using the following address: fathmm.biocompute.org.uk +

+
+ +
+
+
+

Stack Trace:

+ +
+
+ +
+
+
+ """ + + print traceback.format_exc() + + print """ +
+
+
+
+
+
+
+
+ +
+
+

+ We welcome any comments and/or suggestions that you may have regarding our software and server - please send an email directly to fathmm@biocompute.org.uk +

+
+ +
+ + + + + """ diff --git a/index.html b/index.html index bba407a..14986ad 100755 --- a/index.html +++ b/index.html @@ -65,7 +65,7 @@
-

Functional Analysis through Hidden Markov Models (v2.0)

+

Functional Analysis through Hidden Markov Models (v2.1)


A high-throughput web-server capable of predicting the functional, molecular and phenotypic consequences of diff --git a/tmp/d8104d9d-c490-4b14-863c-d180a5c2492f.out b/tmp/d8104d9d-c490-4b14-863c-d180a5c2492f.out deleted file mode 100644 index 1f5b0d5..0000000 --- a/tmp/d8104d9d-c490-4b14-863c-d180a5c2492f.out +++ /dev/null @@ -1,10 +0,0 @@ -# dbSNP ID Protein ID Substitution Prediction Score Domain-Phenotype Association Warning -1 rs137854462 ENSP00000325527 N548I DAMAGING -9.49 Osteoarthritis|Dilatation Of The Ascending Aorta|Abnormality Of The Aorta -2 rs28936683 ENSP00000363489 L441P DAMAGING -5.06 Multifactorial Inheritance|Aplasia/Hypoplasia Of The Middle Phalanges Of The Toes|Abnormality Of The Middle Phalanges Of The Toes|Aplasia/Hypoplasia Of The Phalanges Of The Toes -3 rs121908258 ENSP00000307297 Y293C DAMAGING -8.15 -4 rs17132395 ENSP00000258711 R109S TOLERATED -2.08 -5 rs121912297 ENSP00000358563 T66A TOLERATED -1.81 -6 - P43026 L441P DAMAGING -5.06 Multifactorial Inheritance|Aplasia/Hypoplasia Of The Middle Phalanges Of The Toes|Abnormality Of The Middle Phalanges Of The Toes|Aplasia/Hypoplasia Of The Phalanges Of The Toes -7 - P35555 N548I DAMAGING -9.49 Osteoarthritis|Dilatation Of The Ascending Aorta|Abnormality Of The Aorta -8 - P35555 E1073K DAMAGING -7.69 Osteoarthritis|Dilatation Of The Ascending Aorta|Abnormality Of The Aorta -9 - P35555 C2307S DAMAGING -8.94 Osteoarthritis|Dilatation Of The Ascending Aorta|Abnormality Of The Aorta