diff --git a/mutalyzer/templates/base/js/generator.js b/mutalyzer/templates/base/js/generator.js index 41612ede8f4d5fd6b0f814c97552f223a1c81dc0..ceeecdd6071a9bd07f22d61ed2c12ab1fa773cee 100644 --- a/mutalyzer/templates/base/js/generator.js +++ b/mutalyzer/templates/base/js/generator.js @@ -10,7 +10,7 @@ function isNumber(x){ return re.test(x); } -function isTranscript(x){ +function isTranscript(x){ return isNumber(x); } @@ -65,7 +65,7 @@ function isGeneSymbol(s){ /* Reference Object * ---------------- - * Holds the information of five fields. + * Holds the information of five fields. * Reference * Seqeuente Type * Gene Symbol @@ -121,7 +121,7 @@ var reference = { 'errStr' : "must be a postive integer"}, 'tlc' : 1, 'number': "", - + getType : function(){ var translate = {'c':'cod', 'g':'gen','n':'non','r':'rna', 'm':'mit', 'e':'est','p1':'pr1','p3':'pr3'}; @@ -158,7 +158,7 @@ var reference = { /* seqTypes Object * --------------- - * Holds the references to the different field checks depending on + * Holds the references to the different field checks depending on * the type of sequence that is selected. * * Each key has three members @@ -186,7 +186,7 @@ var seqTypes = { 'non' : { 'pCheck' : isPosition, 'sCheck' : isDNASequence, 'errorStr' : "must consist of nucleotides [ACTG]"}, - + 'est' : { 'pCheck' : isPosition, 'sCheck' : isDNASequence, 'errorStr' : "must consist of nucleotides [ACTG]"}, @@ -202,7 +202,7 @@ var seqTypes = { /* mutTypes Object * --------------- - * Holds the information needed to display and check + * Holds the information needed to display and check * the fields of selected mutation. * * Each key has three members: @@ -212,7 +212,7 @@ var seqTypes = { * P1 = Position 1 * P2 = Position 2 * - * The usage of the 0, 1, + and * is identical to + * The usage of the 0, 1, + and * is identical to * that of the reference object * S1 - The partial name to display for the selected mutation * in front of the first sequence field @@ -263,16 +263,16 @@ var variants = new Array(); //global storage of the variants /* VariantField Object * ------------------- - * Holds the boilerplate for setting up a new variant and storing the + * Holds the boilerplate for setting up a new variant and storing the * values associated with that variant. The five fields that are stored * include Position 1 & 2, Sequence 1 & 2 and the mutation type. * * Each key has four members: * value - The form value * ok - boolean to store if check & len are both met - * check - placeholder to make this object checkable by the + * check - placeholder to make this object checkable by the * main CheckElement function - * index - int to fetch the correct len setings of a field, + * index - int to fetch the correct len setings of a field, * which depends on the type of mutation that is set * * This is a dynamic object, which means that the values of the members @@ -350,7 +350,7 @@ var VariantField = { function clone(obj){ if(obj == null || typeof(obj) != 'object') return obj; - var temp = new obj.constructor(); + var temp = new obj.constructor(); for(var tkey in obj) temp[tkey] = clone(obj[tkey]); return temp; @@ -382,7 +382,7 @@ function checkElement(elem){ //check if obj is checkable if (obj.check==undefined) continue; - + //Get the value from the form var IDt = elem["number"]; if(IDt === "") @@ -396,7 +396,7 @@ function checkElement(elem){ var name = elem.getName(key)+optional; var check = elem.getCheck(key); var errStr = elem.getErr(key); - + //check if the value is ok obj.ok = check(obj.value); @@ -447,9 +447,9 @@ function update(){ var hgvs = generateHGVS(); var ref = hgvs[0]; var vari = hgvs[1]; - + var encVar = encodeURIComponent(vari); - var url = "checkForward?mutationName="+ref+encVar; + var url = "check?name="+ref+encVar; var link = ref+vari; var Output = "<a href=\""+url+"\">"+link+"</a>"; @@ -488,7 +488,7 @@ function updateVariant(variant){ "Interbase positions must be consecutive positions. <br />"; } } - } + } } function updateReference(){ @@ -502,7 +502,7 @@ function updateReference(){ hide("tVar"); else show("tVar"); - + if(reference.seqT.value == "g"){ hide("gSym"); reference.gSym.value = ""; @@ -648,5 +648,3 @@ function removeVariant(nmbr){ variants[nmbr].removed = true; update(); } - - diff --git a/mutalyzer/templates/check.html b/mutalyzer/templates/check.html index 0adef757e7d1b3d90f63f78c91a78a5312693207..758a9a4d50afd275de45b058b6b892fea95d2721 100644 --- a/mutalyzer/templates/check.html +++ b/mutalyzer/templates/check.html @@ -23,16 +23,16 @@ </div><br> Example: AB026906.1:c.274G>T<br> <br> - <form action = "" method = "post"> + <form action = "" method = "get"> <input type = "text" - name = "mutationName" - tal:attributes = "value lastpost" + name = "name" + tal:attributes = "value name" style = "width:100%" ><br> <input type="submit" value="Submit"> <input type="button" value="Clear field" - onClick = "clearForm(this.form, 'mutationName');"> + onClick = "clearForm(this.form, 'name');"> </form> </div> <div tal:condition = "visualisation"> @@ -52,7 +52,7 @@ <a tal:condition = "browserLink" tal:attributes = "href browserLink">View original variant in UCSC Genome Browser</a> </div> <!-- form area --> <br> - <div tal:condition = "lastpost"> + <div tal:condition = "name"> <h3>Name checker results:</h3> <div class="messages"> <p tal:repeat = "m messages" tal:content = "m/description" @@ -80,7 +80,7 @@ <tt> <a tal:content = "genomicDescription/0" tal:attributes = "href - string:checkForward?mutationName=${genomicDescription/1}"> + string:check?name=${genomicDescription/1}"> </a><br> </tt> <br> @@ -99,7 +99,7 @@ <tt tal:repeat = "i descriptions"> <a tal:condition = "i/1" tal:content = "i/0" tal:attributes = - "href string:checkForward?mutationName=${i/1}"></a><tal + "href string:check?name=${i/1}"></a><tal tal:condition = "not:i/1" tal:replace = "i/0"></tal><br> </tt> <br> @@ -269,7 +269,7 @@ <br> </div> <!-- interactive --> </div> <!-- reference --> - </div> <!-- lastpost --> + </div> <!-- name --> </div> </body> </html> diff --git a/mutalyzer/website.py b/mutalyzer/website.py index 4ba7962503c7133dbe2c427c1146da0c7a13ad0c..d44480a97a7ee0149c6691fd1656edbfb39aa3e9 100644 --- a/mutalyzer/website.py +++ b/mutalyzer/website.py @@ -65,11 +65,11 @@ urls = ( '/positionConverter', 'PositionConverter', '/Variant_info', 'VariantInfo', '/getGS', 'GetGS', + '/checkForward', 'CheckForward', '/check', 'Check', '/descriptionExtract', 'DescriptionExtractor', '/bed', 'Bed', '/syntaxCheck', 'SyntaxCheck', - '/checkForward', 'CheckForward', '/batch([a-zA-Z]+)?', 'BatchChecker', '/progress', 'BatchProgress', '/Results_(\d+)\.txt', 'BatchResult', @@ -80,7 +80,7 @@ urls = ( ) -class render_tal : +class render_tal: """ Render interface to TAL templates. @@ -89,28 +89,26 @@ class render_tal : >>> render = render_tal('templates') >>> render.hello('alice') """ - - def __init__(self, path, globals = {}) : + def __init__(self, path, globals={}): """ @arg path: Path to templates directory. @kwarg globals: Dictionary of global template variables. """ - self.path = path self.globals = globals #__init__ - def __getattr__(self, name) : + def __getattr__(self, name): """ Returns a template. Call the template to get a render. @arg name: Template name (usually a HTML filename without '.html'). @return: Template render function. """ - filename = name - def template(args = {}, scheme = 'html', standalone = False) : + def template(args={}, scheme='html', standalone=False, + prevent_caching=False): """ Template render function. @@ -127,20 +125,19 @@ class render_tal : argument for template. @return: Render of template. """ - file = filename - if scheme == 'html' : + if scheme == 'html': file += '.html' path = os.path.join(self.path, file) context = simpleTALES.Context() - context.addGlobal("interactive", not standalone) + context.addGlobal('interactive', not standalone) - for name, value in self.globals.items() : + for name, value in self.globals.items(): context.addGlobal(name, value) - for name, value in args.items() : + for name, value in args.items(): context.addGlobal(name, value) templateFile = open(path, 'r') @@ -148,16 +145,19 @@ class render_tal : templateFile.close() # Wrap in site layout with menu - if scheme == 'html' and not standalone : + if scheme == 'html' and not standalone: context.addGlobal('sitemacros', template) templateFile = open(os.path.join(self.path, 'menu.html'), 'r') template = simpleTAL.compileHTMLTemplate(templateFile) templateFile.close() - #if - if scheme == 'html' : + if scheme == 'html': web.header('Content-Type', 'text/html') + if prevent_caching: + web.header('Cache-Control', 'no-cache') + web.header('Expires', '-1') + io = StringIO() template.expand(context, io) @@ -396,7 +396,7 @@ class GetGS : if i.forward : p, a = i.mutationName.split(':') - return Check.check(p+'('+l[0]+'):'+a, interactive = False) + return Check.check(p+'('+l[0]+'):'+a, standalone=True) #if else : web.header('Content-Type', 'text/plain') @@ -749,57 +749,59 @@ class VariantInfo : #GET #VariantInfo -class Check : + +class CheckForward: """ - The variant checker. + Old entrypoint to the namechecker. We keep it to not break existing + bookmarks (but this could also be done with an Apache rewrite rule). """ - - def GET(self) : + def GET(self): """ - Render the variant checker HTML form. - - There are two modes of invoking the checker with a GET request: - 1. Provide the 'mutationName' parameter. In this case, the checker is - called non-interactively, meaning the result is rendered without - the HTML form, site layout, and menu. - 2. By having a 'variant' value in the cookie. The value is removed. + Permanently redirect to the name checker. Parameters: - mutationName: Variant to check. """ - - interactive = True - i = web.input(mutationName = None) - - if i.mutationName : - # Run checker non-interactively - interactive = False - variant = i.mutationName - #if - else : - # Run checker if cookie variant is not None - variant = web.cookies().get('variant') - web.setcookie('variant', '', 60) - #else - - return self.check(variant, interactive = interactive) + i = web.input(mutationName=None) + raise web.redirect('/check?name=' + urllib.quote(i.mutationName)) #GET +#CheckForward - def POST(self) : + +class Check: + """ + The variant checker. + """ + def GET(self): """ - Run the name checker and render the variant checker HTML form. + Render the variant checker HTML form. + + For backwards compatibility with older LOVD versions, we support the + 'mutationName' argument. If present, we redirect and add standalone=1. Parameters: - - mutationName: Variant to check. + - name: Variant to check. """ + i = web.input(name=None, mutationName=None, standalone=False) - i = web.input(mutationName = None) + if i.mutationName: + raise web.redirect('/check?name=%s&standalone=1' + % urllib.quote(i.mutationName)) + + return self.check(i.name, standalone=bool(i.standalone)) + #GET - return self.check(i.mutationName) + def POST(self): + """ + For now we also accept POST requests with a permanent redirect. + """ + i = web.input(name=None, mutationName=None, standalone=False) + raise web.redirect('/check?name=%s' + % urllib.quote(i.name or i.mutationName)) #POST @staticmethod - def check(name = None, interactive = True) : + def check(name=None, standalone=False): """ Render the variant checker HTML form. If the name argument is given, run the name checker. @@ -808,19 +810,12 @@ class Check : @kwarg interactive: Run interactively, meaning we wrap the result in the site layout and include the HTML form. """ + if not name: + return render.check(dict(name=None), standalone=standalone) output = Output(__file__) - IP = web.ctx["ip"] - - args = { - 'lastpost' : name - } - - if not name : - return render.check(args, standalone = not interactive) - - output.addMessage(__file__, -1, 'INFO', - 'Received variant %s from %s' % (name, IP)) + output.addMessage(__file__, -1, 'INFO', 'Received variant %s from %s' + % (name, web.ctx['ip'])) # Todo: The following is probably a problem elsewhere too. # We stringify the variant, because a unicode string crashes @@ -831,73 +826,60 @@ class Check : record_type = output.getIndexedOutput('recordType', 0, '') reference = output.getIndexedOutput('reference', 0, '') - if reference : - if record_type == 'LRG' : + if reference: + if record_type == 'LRG': reference = reference + '.xml' else : reference = reference + '.gb' - #if - # This is a tuple (variant, position) + # This is a tuple (variant, position) if we have a parse error parse_error = output.getOutput('parseError') - if parse_error : + if parse_error: parse_error[0] = parse_error[0].replace('<', '<') genomic_dna = output.getIndexedOutput('molType', 0) != 'n' - - genomic_description = output.getIndexedOutput('genomicDescription', 0, - '') + genomic_description = output.getIndexedOutput('genomicDescription', 0, '') # Create a tuple (description, link) from a description - def description_to_link(description) : + def description_to_link(description): link = None - - if description[-1] != '?' : + if description[-1] != '?': link = urllib.quote(description) - return description, link - #description_to_link # Create a link to the UCSC Genome Browser browser_link = None raw_variants = output.getIndexedOutput('rawVariantsChromosomal', 0) - if raw_variants : + if raw_variants: positions = [pos for descr, (first, last) in raw_variants[2] for pos in (first, last)] bed_url = web.ctx.homedomain + web.ctx.homepath + \ - '/bed?variant=' + urllib.quote(name) + '/bed?name=' + urllib.quote(name) browser_link = GENOME_BROWSER_URL.format( - chromosome = raw_variants[0], start = min(positions) - 10, - stop = max(positions) + 10, bed_file = urllib.quote(bed_url)) - #if + chromosome=raw_variants[0], start=min(positions) - 10, + stop=max(positions) + 10, bed_file=urllib.quote(bed_url)) # Todo: Generate the fancy HTML views for the proteins here instead # of in mutalyzer/variantchecker.py. args = { - 'lastpost' : name, - 'messages' : map(util.message_info, - output.getMessages()), + 'name' : name, + 'messages' : map(util.message_info, output.getMessages()), 'summary' : summary, 'parseError' : parse_error, 'errors' : errors, - 'genomicDescription' : (genomic_description, - urllib.quote(genomic_description)), - 'chromDescription' : output.getIndexedOutput( - 'genomicChromDescription', 0), + 'genomicDescription' : (genomic_description, urllib.quote(genomic_description)), + 'chromDescription' : output.getIndexedOutput('genomicChromDescription', 0), 'genomicDNA' : genomic_dna, 'visualisation' : output.getOutput('visualisation'), - 'descriptions' : map(description_to_link, - output.getOutput('descriptions')), + 'descriptions' : map(description_to_link, output.getOutput('descriptions')), 'protDescriptions' : output.getOutput('protDescriptions'), 'oldProtein' : output.getOutput('oldProteinFancy'), 'altStart' : output.getIndexedOutput('altStart', 0), 'altProtein' : output.getOutput('altProteinFancy'), 'newProtein' : output.getOutput('newProteinFancy'), - 'transcriptInfo' : output.getIndexedOutput('hasTranscriptInfo', - 0, False), - 'transcriptCoding' : output.getIndexedOutput('transcriptCoding', - 0, False), + 'transcriptInfo' : output.getIndexedOutput('hasTranscriptInfo', 0, False), + 'transcriptCoding' : output.getIndexedOutput('transcriptCoding', 0, False), 'exonInfo' : output.getOutput('exonInfo'), 'cdsStart_g' : output.getIndexedOutput('cdsStart_g', 0), 'cdsStart_c' : output.getIndexedOutput('cdsStart_c', 0), @@ -911,7 +893,7 @@ class Check : output.addMessage(__file__, -1, 'INFO', 'Finished variant %s' % name) - return render.check(args, standalone = not interactive) + return render.check(args, standalone=standalone, prevent_caching=True) #check #Check @@ -1006,58 +988,52 @@ class DescriptionExtractor : #DescriptionExtract -class Bed : +class Bed: """ Create BED track. """ - - def GET(self) : + def GET(self): """ Create a BED track for the given variant, listing the positioning of its raw variants. E.g. for use in the UCSC Genome Browser. Parameters: - - mutationName: Variant to create BED track for. + - name: Variant to create BED track for. This basically just runs the variant checker and extracts the raw variants with positions. """ - web.header('Content-Type', 'text/plain') - i = web.input(variant = None) - variant = i.variant + i = web.input(name=None) + name = i.name - if not variant : + if not name: web.ctx.status = '404 Not Found' - return 'Sorry, we have not BED track for this variant.' - #if output = Output(__file__) - variantchecker.check_variant(str(variant), output) + variantchecker.check_variant(str(name), output) raw_variants = output.getIndexedOutput('rawVariantsChromosomal', 0) - if not raw_variants : + if not raw_variants: web.ctx.status = '404 Not Found' - return 'Sorry, we have no BED track for this variant.' - #if fields = { 'name' : 'Mutalyzer', - 'description': 'Mutalyzer track for ' + variant, + 'description': 'Mutalyzer track for ' + name, 'visibility' : 'pack', 'db' : 'hg19', 'url' : web.ctx.homedomain + web.ctx.homepath + - '/checkForward?mutationName=' + urllib.quote(variant), + '/check?name=' + urllib.quote(name), 'color': '255,0,0'} bed = ' '.join(['track'] + [ '%s="%s"' % field for field in fields.items()]) + '\n' - for description, positions in raw_variants[2] : + for description, positions in raw_variants[2]: bed += '\t'.join([raw_variants[0], str(min(positions) - 1), str(max(positions)), description, '0', raw_variants[1]]) + '\n' @@ -1066,30 +1042,6 @@ class Bed : #Bed -class CheckForward : - """ - Set the given variant in the cookie and redirect to the name checker. - - @todo: Cleaner solution (one without using a cookie). - """ - - def GET(self) : - """ - Set the 'variant' cookie value to the given variant and redirect - to the name checker (where we will arrive by a GET request). - - Parameters: - - mutationName: Variant to set in the cookie. - """ - - i = web.input(mutationName = None) - web.setcookie('variant', i.mutationName, 5 * 60) # Five minutes - - raise web.seeother('check') - #GET -#CheckForward - - class BatchProgress : """ Batch jobs progress viewer. diff --git a/tests/test_mapping.py b/tests/test_mapping.py index 71c2e458c0b0eec35dc30af6c069b7f17170a749..12e5608431ff913e8e4f6a2a35e29678bbf07a04 100644 --- a/tests/test_mapping.py +++ b/tests/test_mapping.py @@ -67,6 +67,10 @@ class TestConverter(): is exactly on the border of an exon. Bug reported February 24, 2012 by S Venkata Suresh Kumar. + + Note: You need the full hg18 and hg19 databases for these tests to + pass (i.e. the one used on the production server, possibly + updated with newer mappings from the NCBI). """ converter = self._converter('hg19') coding = converter.chrom2c('NC_000001.10:g.115259837_115259837delT', 'list') diff --git a/tests/test_website.py b/tests/test_website.py index 77ffac5dbafccb50fb41b1a1fd9b3fd57d77ff67..898074d01698008ebd9e99b9e5be28d1f0a342c4 100644 --- a/tests/test_website.py +++ b/tests/test_website.py @@ -156,32 +156,61 @@ class TestWSGI(): """ r = self.app.get('/check') form = r.forms[0] - form['mutationName'] = 'NM_002001.2:g.1del' + form['name'] = 'NM_002001.2:g.1del' r = form.submit() r.mustcontain('0 Errors', '0 Warnings', 'Raw variant 1: deletion of 1', '<a href="#bottom" class="hornav">go to bottom</a>', - '<input value="NM_002001.2:g.1del" type="text" name="mutationName" style="width:100%">') + '<input value="NM_002001.2:g.1del" type="text" name="name" style="width:100%">') def test_check_more_valid(self): """ Test the name checker for some more variants. """ def check_name(name): - r = self.app.post('/check', {'mutationName': name}) + r = self.app.get('/check?name=%s' % name) r.mustcontain('0 Errors') names = ['NG_012337.1:g.7055C>T'] for name in names: check_name(name) + def test_check_post(self): + """ + Test the name checker for a POST request. + + We accept POST requests for backwards compatibility. + """ + def check_name(name): + r = self.app.post('/check', {'name': name}) + assert_equal(r.status, '301 Moved Permanently') + assert r.location.endswith('/check?name=%s' % urllib.quote(name)) + names = ['NG_012337.1:g.7055C>T'] + for name in names: + check_name(name) + + def test_check_post_old(self): + """ + Test the name checker for a POST request with the old parameter + name. + + We accept POST requests for backwards compatibility. + """ + def check_name(name): + r = self.app.post('/check', {'mutationName': name}) + assert_equal(r.status, '301 Moved Permanently') + assert r.location.endswith('/check?name=%s' % urllib.quote(name)) + names = ['NG_012337.1:g.7055C>T'] + for name in names: + check_name(name) + def test_check_invalid(self): """ Submit the name checker form with an invalid variant. """ r = self.app.get('/check') form = r.forms[0] - form['mutationName'] = 'NM_002001.2' + form['name'] = 'NM_002001.2' r = form.submit() r.mustcontain('1 Error', '0 Warnings', @@ -194,7 +223,7 @@ class TestWSGI(): """ r = self.app.get('/check') form = r.forms[0] - form['mutationName'] = 'BAA81889.1:c.274G>T' + form['name'] = 'BAA81889.1:c.274G>T' r = form.submit() r.mustcontain('1 Error', '0 Warnings', @@ -205,15 +234,24 @@ class TestWSGI(): Submit the name checker form non-interactively. Should not include form and main layout HTML. """ - r = self.app.get('/check?mutationName=NM_002001.2:g.1del') + r = self.app.get('/check?name=NM_002001.2:g.1del&standalone=1') assert_false('<a href="#bottom" class="hornav">go to bottom</a>' in r) - assert_false('<input value="NM_002001.2:g.1del" type="text" name="mutationName" style="width:100%">' in r) + assert_false('<input value="NM_002001.2:g.1del" type="text" name="name" style="width:100%">' in r) r.mustcontain('0 Errors', '0 Warnings', 'Raw variant 1: deletion of 1', '<html>', '</html>') + def test_check_noninteractive_old(self): + """ + Submit the name checker form non-interactively in the old style. + Should redirect to new style. + """ + r = self.app.get('/check?mutationName=NM_002001.2:g.1del') + assert_equal(r.status, '301 Moved Permanently') + assert r.location.endswith('/check?name=%s&standalone=1' % urllib.quote('NM_002001.2:g.1del')) + def test_check_browser_link(self): """ Submit the name checker form with a coding variant on a transcript. @@ -221,25 +259,27 @@ class TestWSGI(): """ r = self.app.get('/check') form = r.forms[0] - form['mutationName'] = 'NM_003002.2:c.274G>T' + form['name'] = 'NM_003002.2:c.274G>T' r = form.submit() - bed_track = urllib.quote(r.environ['wsgi.url_scheme'] + '://' + r.environ['HTTP_HOST'] + '/bed?variant=' + urllib.quote('NM_003002.2:c.274G>T')) + # Note: the r.environ does not work in versions higher than webob 1.1.1 + bed_track = urllib.quote(r.environ['wsgi.url_scheme'] + '://' + r.environ['HTTP_HOST'] + '/bed?name=' + urllib.quote('NM_003002.2:c.274G>T')) r.mustcontain('<a href="http://genome.ucsc.edu/cgi-bin/hgTracks?db=hg19&position=chr11:111959685-111959705&hgt.customText=%s">View original variant in UCSC Genome Browser</a>' % bed_track) def test_checkforward(self): """ - A checkForward request should set the given variant in the session and - redirect to the name checker. + A checkForward request should redirect to the name checker. + + This is for backwards compatibility with old bookmarks. """ - r = self.app.get('/checkForward?mutationName=NM_002001.2:g.1del') - assert_equal(r.status, '303 See Other') - assert r.location.endswith('/check') + r = self.app.get('/checkForward?mutationName=%s' % urllib.quote('NM_002001.2:g.1del')) + assert_equal(r.status, '301 Moved Permanently') + assert r.location.endswith('/check?name=%s' % urllib.quote('NM_002001.2:g.1del')) r = r.follow() r.mustcontain('0 Errors', '0 Warnings', 'Raw variant 1: deletion of 1', '<a href="#bottom" class="hornav">go to bottom</a>', - '<input value="NM_002001.2:g.1del" type="text" name="mutationName" style="width:100%">') + '<input value="NM_002001.2:g.1del" type="text" name="name" style="width:100%">') def test_snp_converter_valid(self): """ @@ -695,13 +735,13 @@ facilisi.""" """ r = self.app.get('/check') form = r.forms[0] - form['mutationName'] = 'AB026906.1:c.274G>T' + form['name'] = 'AB026906.1:c.274G>T' r = form.submit() r.mustcontain('0 Errors', '1 Warning', 'Raw variant 1: substitution at 7872', '<a href="#bottom" class="hornav">go to bottom</a>', - '<input value="AB026906.1:c.274G>T" type="text" name="mutationName" style="width:100%">') + '<input value="AB026906.1:c.274G>T" type="text" name="name" style="width:100%">') r = self.app.get('/Reference/AB026906.1.gb') assert_equal(r.content_type, 'text/plain') assert_equal(r.content_length, 26427) @@ -716,13 +756,13 @@ facilisi.""" """ r = self.app.get('/check') form = r.forms[0] - form['mutationName'] = 'AB026906.1:c.274G>T' + form['name'] = 'AB026906.1:c.274G>T' r = form.submit() r.mustcontain('0 Errors', '1 Warning', 'Raw variant 1: substitution at 7872', '<a href="#bottom" class="hornav">go to bottom</a>', - '<input value="AB026906.1:c.274G>T" type="text" name="mutationName" style="width:100%">') + '<input value="AB026906.1:c.274G>T" type="text" name="name" style="width:100%">') r = self.app.head('/Reference/AB026906.1.gb') assert_equal(r.content_type, 'text/plain') @@ -736,7 +776,7 @@ facilisi.""" """ BED track for variant. """ - r = self.app.get('/bed?variant=NM_003002.2%3Ac.274G%3ET') + r = self.app.get('/bed?name=NM_003002.2%3Ac.274G%3ET') assert_equal(r.content_type, 'text/plain') r.mustcontain('\t'.join(['chr11', '111959694', '111959695', '274G>T', '0', '+'])) @@ -744,7 +784,7 @@ facilisi.""" """ BED track for variant on reverse strand. """ - r = self.app.get('/bed?variant=NM_000132.3%3Ac.%5B4374A%3ET%3B4380_4381del%5D') + r = self.app.get('/bed?name=NM_000132.3%3Ac.%5B4374A%3ET%3B4380_4381del%5D') assert_equal(r.content_type, 'text/plain') r.mustcontain('\t'.join(['chrX', '154157690', '154157691', '4374A>T', '0', '-'])) r.mustcontain('\t'.join(['chrX', '154157683', '154157685', '4380_4381del', '0', '-']))