+ Aaaarghh found stupid bug in the parser (Case statement of "one key - n elements...
authorfabio <fabio@e1793c9e-67f9-0310-80fc-b846ff1f7b36>
Mon, 21 Apr 2008 03:31:59 +0000 (03:31 +0000)
committerfabio <fabio@e1793c9e-67f9-0310-80fc-b846ff1f7b36>
Mon, 21 Apr 2008 03:31:59 +0000 (03:31 +0000)
git-svn-id: http://svn.tuebingen.mpg.de/ag-raetsch/projects/QPalma@8720 e1793c9e-67f9-0310-80fc-b846ff1f7b36

qpalma/parsers.py

index 09f1d49..c84c136 100644 (file)
@@ -373,7 +373,6 @@ def parse_map_vm(filename):
       if parsed_line == '':
          break
 
-
       id,chr,pos,strand,mismatches,length,offset,seq,q1,q2,q3 = parsed_line.split()
 
       id = int(id)
@@ -396,15 +395,16 @@ def parse_map_vm(filename):
       line_d = {'id':id, 'chr':chr, 'pos':pos, 'strand':strand,\
       'mismatches':mismatches, 'length':length, 'offset':offset}
    
-      try:
-         entries[id] = [line_d]
-      except:
+      if entries.has_key(id):
+         pdb.set_trace()
          old_entry = entries[id]
          old_entry.append(line_d)
          entries[id] = old_entry
+      else:
+         entries[id] = [line_d]
 
-   return entries
 
+   return entries
 
 
 def map_file(filename):
@@ -417,6 +417,7 @@ def map_file(filename):
 
    file = open(filename, "r+")
    size = os.path.getsize(filename)
+   #print size
 
    #data = mmap.mmap(file.fileno(), size, mmap.MAP_PRIVATE, mmap.PROT_READ, mmap.ACCESS_READ)
    data = mmap.mmap(file.fileno(), size, mmap.ACCESS_READ)