Anonymous avatar Anonymous committed a6c579e

more entries with same ID

Comments (0)

Files changed (1)

                 chrom.append((int(d['start']), int(d['stop']), int(d['chromosome']), geneID))
                 id2desc[int(d['chromosome'])] = len(chrom)-1
             else: ## loading genes positions
-                self.geneCoordinates[geneID] = (int(d['start']), int(d['stop']), id2desc[int(d['chromosome'])] )
+                tmpl = self.geneCoordinates.get(geneID, [])
+                tmpl.append( (int(d['start']), int(d['stop']), id2desc[int(d['chromosome'])] ) )
+                self.geneCoordinates[geneID] = tmpl
+#                self.geneCoordinates[geneID] = (int(d['start']), int(d['stop']), id2desc[int(d['chromosome'])] )
             geneIDs.append( geneID)
         self.genesInGenomeMapFile[filename] = geneIDs ## update with new data (in case file has changed)
         self.GenomeMapLoaded = 1
         for (i,d) in enumerate(self.parent.data):
             if not int(d[mid]):
                 continue # position not known for this gene
-            coord = self.parent.coord[i]
-            if not(coord[0]>self.bpR or coord[1]<self.bpL):  # is gene in the visible area of the chromosome?
-                l, r = max(coord[0], self.bpL),  min(coord[1], self.bpR)
-                lp, rp = self.bp2x(l), self.bp2x(r)
-                if rp-lp < self.parent.MinGeneWidth:
-                    diff = int((self.parent.MinGeneWidth - (rp-lp)) / 2)
-                    lp, rp = max(lp-diff, lborder), min(rp+diff, rborder)
-                y = yoffset + coord[2]*(ychrom+yspace)
-                r = QCanvasRectangle(lp, y, max(self.parent.MinGeneWidth, rp-lp), ychrom+1, self)
-                if colorclass:
-                    color = colors[int(d.getclass())]
-                else:
-                    color = geneColor
-                r.instance = d
-                r.setBrush(QBrush(color)); r.setPen(QPen(color))
-                r.setZ(zgenes)
-                r.show()
+            coords = self.parent.coord[i]
+            for coord in coords:
+                if not(coord[0]>self.bpR or coord[1]<self.bpL):  # is gene in the visible area of the chromosome?
+                    l, r = max(coord[0], self.bpL),  min(coord[1], self.bpR)
+                    lp, rp = self.bp2x(l), self.bp2x(r)
+                    if rp-lp < self.parent.MinGeneWidth:
+                        diff = int((self.parent.MinGeneWidth - (rp-lp)) / 2)
+                        lp, rp = max(lp-diff, lborder), min(rp+diff, rborder)
+                    y = yoffset + coord[2]*(ychrom+yspace)
+                    r = QCanvasRectangle(lp, y, max(self.parent.MinGeneWidth, rp-lp), ychrom+1, self)
+                    if colorclass:
+                        color = colors[int(d.getclass())]
+                    else:
+                        color = geneColor
+                    r.instance = d
+                    r.setBrush(QBrush(color)); r.setPen(QPen(color))
+                    r.setZ(zgenes)
+                    r.show()
 
     def repaintGenes(self):
         for i in filter(lambda i,z=zgenes: i.z()==z, self.allItems()):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.