From 1f06518ef7f2eb64e7def0aba1aa0609ce01b8ff Mon Sep 17 00:00:00 2001
From: Martijn Vermaat <martijn@vermaat.name>
Date: Sun, 8 Jan 2012 12:56:33 +0000
Subject: [PATCH] Fix BED track for UCSC Genome Browser

Previously, the 'color' field in the BED track we provide for the Genome
Browser was set to the empty string, but Gerard informed us that this is not
(always) handled correctly:

   Expecting number field 5 line 2 of https://mutalyzer.nl/bed?..., got +

We now explicitely set the 'color' field to '0'.


git-svn-id: https://humgenprojects.lumc.nl/svn/mutalyzer/trunk@439 eb6bd6ab-9ccd-42b9-aceb-e2899b4a52f1
---
 mutalyzer/website.py  | 4 ++--
 tests/test_website.py | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/mutalyzer/website.py b/mutalyzer/website.py
index 74428d63..1d154ca7 100644
--- a/mutalyzer/website.py
+++ b/mutalyzer/website.py
@@ -800,7 +800,7 @@ class Bed:
         raw_variants = output.getIndexedOutput('rawVariantsChromosomal', 0)
         if not raw_variants:
             web.ctx.status = '404 Not Found'
-            return 'Sorry, we have not BED track for this variant.'
+            return 'Sorry, we have no BED track for this variant.'
 
         fields = {'name':        'Mutalyzer',
                   'description': 'Mutalyzer track for ' + variant,
@@ -812,7 +812,7 @@ class Bed:
         for description, positions in raw_variants[2]:
             bed += '\t'.join([raw_variants[0],
                               str(min(positions) - 1), str(max(positions)),
-                              description, '', raw_variants[1]]) + '\n'
+                              description, '0', raw_variants[1]]) + '\n'
         return bed
 #Bed
 
diff --git a/tests/test_website.py b/tests/test_website.py
index 09a30ebb..2537d7a6 100644
--- a/tests/test_website.py
+++ b/tests/test_website.py
@@ -727,7 +727,7 @@ facilisi."""
         """
         r = self.app.get('/bed?variant=NM_003002.2%3Ac.274G%3ET')
         assert_equal(r.content_type, 'text/plain')
-        r.mustcontain('\t'.join(['chr11', '111959694', '111959695', '274G>T', '', '+']))
+        r.mustcontain('\t'.join(['chr11', '111959694', '111959695', '274G>T', '0', '+']))
 
     def test_bed_reverse(self):
         """
@@ -735,5 +735,5 @@ facilisi."""
         """
         r = self.app.get('/bed?variant=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', '', '-']))
-        r.mustcontain('\t'.join(['chrX', '154157683', '154157685', '4380_4381del', '', '-']))
+        r.mustcontain('\t'.join(['chrX', '154157690', '154157691', '4374A>T', '0', '-']))
+        r.mustcontain('\t'.join(['chrX', '154157683', '154157685', '4380_4381del', '0', '-']))
-- 
GitLab