Skip to content
This repository was archived by the owner on Aug 26, 2019. It is now read-only.

Commit

Permalink
Incorporated Reviewer Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
HAShihab committed Mar 21, 2013
1 parent 8168a19 commit 911fc4b
Show file tree
Hide file tree
Showing 10 changed files with 3,303 additions and 209 deletions.
437 changes: 326 additions & 111 deletions cancer.html

Large diffs are not rendered by default.

72 changes: 46 additions & 26 deletions cgi-bin/fathmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ def process_record(dbSNP, protein, substitution):
"""

# throw warning if prediction threshold is invalid
if not isinstance(options.threshold, float):
Predictions.write(
"\t".join([ str(idx), dbSNP, protein, substitution, "", "", "", "Invalid Prediction Threshold (" + str(options.threshold) + ")" ]) + "\n"
); return False


# fetch pre-computed sequence record
dbCursor.execute("select a.* from Clusters a, Protein b where a.id=b.cluster and b.name='" + protein + "'")
SeqRecord = dbCursor.fetchone()
Expand Down Expand Up @@ -184,24 +191,17 @@ def process_record(dbSNP, protein, substitution):
"\t".join([ str(idx), dbSNP, protein, substitution, "", "", "", "No Prediction Available" ]) + "\n"
); return False

if not options.weights.upper() == "UNWEIGHTED":
if options.weights.upper() == "INHERITED":
# "Inherited Disease" predictions ...
Tag = "TOLERATED"

if float(Score) < -1.50:
Tag = "DAMAGING"
else:
# "Cancer-Associated" predictions ...
Tag = "PASSENGER/OTHER"

if float(Score) < -1.00:
Tag = "CANCER"
else:
Tag = "TOLERATED"

if float(Score) < -3.00:
if options.weights.upper() in [ "UNWEIGHTED", "INHERITED" ]:
# "Inherited Disease" predictions ...
Tag = "TOLERATED"
if float(Score) < options.threshold:
Tag = "DAMAGING"
else:
# "Cancer-Associated" predictions ...
Tag = "PASSENGER/OTHER"
if float(Score) < options.threshold:
Tag = "CANCER"


Predictions.write(
"\t".join([ str(idx), dbSNP, protein, substitution, Tag, Score, "|".join([ x['description'] for x in Phenotypes ]), "" ]) + "\n"
Expand All @@ -211,14 +211,14 @@ def process_record(dbSNP, protein, substitution):
if __name__ == '__main__':

#
# PARSE PROGRAM ARGUMENTS
# OPTION PARSER
#

parser = OptionParser()
parser.add_option(
"-i",
dest = "input",
help = "process dbSNP rs IDs/protein missense mutations from <INPUT>",
help = "process mutation data from <INPUT>",
metavar = "<INPUT>",
default = None
)
Expand All @@ -234,30 +234,50 @@ def process_record(dbSNP, protein, substitution):
dest = "weights",
help = "return weighted predictions using pathogenicity weights <WEIGHTS>",
metavar = "<WEIGHTS>",
default = "Inherited"
default = "INHERITED"
)
parser.add_option(
"-t",
dest = "threshold",
help = "return predictions using <THRESHOLD> as a prediction threshold",
metavar = "<THRESHOLD>",
default = None
)
parser.add_option(
"-p",
dest = "phenotypes",
help = "append domain-phenotype associations for mutations using phenotype ontology <PHENO>",
metavar = "<PHENO>",
default = "DO"
default = ""
)

(options, args) = parser.parse_args()

#
# AUTHENTICATE PROGRAM PARAMETERS
# PARSE/AUTHENTICATE PROGRAM PARAMETERS
#

if not options.input:
parser.error("No Input File Given (-i parameter)")

parser.error("Warning: No Input File Specified ")
if not options.output:
parser.error("No Output File Given (-o parameter)")
parser.error("Warning: No Output File Specified ")

if not options.weights:
parser.error("Warning: No Pathogenicity Weights Specified ")

if not options.weights.upper() in [ "UNWEIGHTED", "INHERITED", "CANCER" ]:
parser.error("Invalid Weighting Scheme")
parser.error("Warning: Invalid Pathogenicity Weights ")

if options.threshold:
try:
options.threshold = float(options.threshold)
except:
pass
else:
if options.weights.upper() == "UNWEIGHTED": options.threshold = -3.00
if options.weights.upper() == "INHERITED": options.threshold = -1.50
if options.weights.upper() == "CANCER": options.threshold = -0.75

#
# INITIALIZE DATABASE CONNECTION/CURSOR
Expand Down
17 changes: 11 additions & 6 deletions cgi-bin/results.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ if __name__ == '__main__':
"# Time: " + time.strftime("%H:%M:%S", HTMLTime) + "\n",
"# Weights: " + str(HTMLForm['weighted'].value).upper() + "\n",
"# Phenotypes: " + str(HTMLForm['phenotypes'].value).upper() + "\n",
"# Threshold: " + str(HTMLForm['threshold'].value) + "\n",
str(HTMLForm['batch'].value)
]:
open("../tmp/" + HTMLSession + ".txt", "a").write(x)
Expand All @@ -45,7 +46,8 @@ if __name__ == '__main__':
'-i', '../tmp/' + HTMLSession + '.txt',
'-o', '../tmp/' + HTMLSession + '.tab',
'-w', str(HTMLForm['weighted'].value),
'-p', str(HTMLForm['phenotypes'].value)
'-p', str(HTMLForm['phenotypes'].value),
'-t', str(HTMLForm['threshold'].value)
], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
#
else:
Expand All @@ -58,10 +60,6 @@ if __name__ == '__main__':
if os.path.exists("../tmp/" + HTMLSession + ".tab"):
print """
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class=""> <!--<![endif]-->
<head>
<title>fathmm - fathmm Predictions</title>
Expand Down Expand Up @@ -144,6 +142,7 @@ if __name__ == '__main__':
<div class="hero-unit">
<h2>fathmm Predictions</h2>
<br />
<p>
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.&nbsp;&nbsp;In addition, you can retrieve your results at any time using the below Job/Session Identifier.
Expand Down Expand Up @@ -308,6 +307,7 @@ if __name__ == '__main__':
<div class="hero-unit">
<h2>fathmm Predictions</h2>
<br />
<p>
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.&nbsp;&nbsp;Alternatively, you can retrieve your results at any time using the below Job/Session
Expand Down Expand Up @@ -416,6 +416,7 @@ if __name__ == '__main__':
<div class="hero-unit">
<h2>Unknown Job/Session Identifier</h2>
<br />
<p>
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.
</p>
Expand Down Expand Up @@ -514,6 +515,7 @@ if __name__ == '__main__':
<div class="hero-unit">
<h2>Server Error</h2>
<br />
<p>
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
Expand Down Expand Up @@ -551,8 +553,11 @@ if __name__ == '__main__':
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
</p>
</footer>
</div>
<script type="text/javascript" src="../js/bootstrap.min.js"></script>
<script type="text/javascript" src="../js/jquery.min.js"></script>
</body>
</html>
"""
2 changes: 2 additions & 0 deletions css/fathmm.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ a:hover {
.modal, .btn-large {
outline: none;
}

.tab-content {overflow-x: hidden;}
8 changes: 4 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
</div>

<div class="hero-unit">
<h2>Functional Analysis through Hidden Markov Models (v2.1)</h2>
<h2>Functional Analysis through Hidden Markov Models</h2>
<br />
<p>
A high-throughput web-server capable of predicting the functional, molecular and phenotypic consequences of
Expand All @@ -96,7 +96,7 @@ <h3 id="head">About our Software and Server:</h3>
<div class="modal-body">
<p>
<br />
The Functional Analysis through Hidden Markov Models (FATHMM) software and server is a <b>sequence-based algorithm</b> capable of predicting the
The Functional Analysis through Hidden Markov Models (fathmm) software and server is a <b>sequence-based algorithm</b> capable of predicting the
<b>functional and phenotypic consequences of protein missense variants</b> via the amalgamation of sequence conservation within hidden Markov
models (HMMs), representing the alignment of homologous sequences and conserved protein domains, with <b>'pathogenicity weights'</b>, representing
the tolerance of the corresponding model to mutations.
Expand All @@ -119,15 +119,15 @@ <h3 id="head">About our Software and Server:</h3>
<div class="well well-large" style="height: 150px;">
<h4>Analyze dbSNP/Protein Missense Variants</h4>
<br />
<p>Obtain instant predictions for the <b>functional, molecular and phenotypic consequences</b> of protein missense variants.</p>
<p>Obtain instant predictions describing the <b>functional, molecular and phenotypic consequences</b> of protein missense variants.</p>
<p><a href="./inherited.html" class="btn pull-right">go &raquo;</a></p>
</div>
</div>
<div class="span6">
<div class="well well-large" style="height: 150px; background-image:url('./img/new.png'); background-repeat:no-repeat; background-position:top right; ">
<h4>Analyze Cancer-Associated Variants</h4>
<br />
<p>Obtain instant <b>disease-specific</b> predictions capable of distinguishing between <b>cancer-promoting/driver</b> and <b>neutral/passsenger mutations</b>.</p>
<p>Obtain instant predictions capable of distinguishing between <b>cancer-promoting/driver mutations</b>, <b>passsenger mutations</b> and <b>other germline polymorphisms</b>.</p>
<p><a href="./cancer.html" class="btn pull-right">go &raquo;</a></p>
</div>
</div>
Expand Down
Loading

0 comments on commit 911fc4b

Please sign in to comment.