Skip to content
Snippets Groups Projects
Commit 46b9c88b authored by Vermaat's avatar Vermaat
Browse files

Quick hack as proof of concept implementation

parent 692f4b15
No related branches found
No related tags found
No related merge requests found
......@@ -454,6 +454,8 @@ class GBparser():
record.seq = biorecord.seq
record.version = biorecord.id.split('.')[1]
# Todo: also set organism in the LRG parser
record.organism = biorecord.annotations['organism']
exonList = []
geneDict = {}
......
......@@ -264,6 +264,8 @@
<a tal:content = "reference"
tal:attributes = "href string:Reference/${reference}"></a>
<br>
<a tal:condition = "browserLink" tal:attributes = "href browserLink">UCSC Genome Browser</a>
<br>
<br>
</div> <!-- interactive -->
</div> <!-- reference -->
......
......@@ -1496,6 +1496,8 @@ def check_variant(description, config, output):
# Add recordType to output for output formatting.
output.addOutput('recordType', filetype)
output.addOutput('organism', retrieved_record.organism)
output.addOutput('reference', record_id)
# Note: geneSymbol[0] is used as a filter for batch runs.
......
......@@ -725,6 +725,24 @@ class Check:
link = urllib.quote(description)
return description, link
# Create a link to the UCSC Genome Browser
# This is an ugly proof of concept.
browser_link = None
if output.getIndexedOutput('organism', 0) == 'Homo sapiens':
converter = Converter('hg19', config, output)
variant = converter.c2chrom(str(name))
if variant:
import re
match = re.match('NC_(\d+)\.\d+:g.(\d+)_?(\d*)[^_\d]', variant)
if match:
# Todo: convert NC_0000XX to chr1...chrY
chromosome, start, stop = match.groups()
if stop:
position = 'chr%i:%i-%i' % (int(chromosome), int(start), int(stop))
else:
position = 'chr%i:%i' % (int(chromosome), int(start))
browser_link = 'http://genome.ucsc.edu/cgi-bin/hgTracks?db=hg19&position=%s' % position
# Todo: Generate the fancy HTML views for the proteins here instead
# of in mutalyzer/variantchecker.py.
args = {
......@@ -752,7 +770,8 @@ class Check:
'cdsStop_c' : output.getIndexedOutput('cdsStop_c', 0),
'restrictionSites' : output.getOutput('restrictionSites'),
'legends' : output.getOutput('legends'),
'reference' : reference
'reference' : reference,
'browserLink' : browser_link
}
return render.check(args, standalone=not interactive)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment