Aleš Erjavec avatar Aleš Erjavec committed 3ddf83d

Fixed a major error handing the downloaded gene list (all reported gene names were offset by +1).

Comments (0)

Files changed (1)

 
         return et
 
+def bufferkeypipax(command, data):
+    """ Do not save password to the buffer! """
+    command = command + " v6" #add version
+    if data != None:
+        data = data.copy()
+        if pipaparpass in data:
+            data.pop(pipaparpass)
+        return command + " " +  urllib.urlencode(sorted(data.items()))
+    else:
+        return command
 
 class PIPAx(PIPA):
     """`PIPAx <http://pipa.biolab.si/?page_id=23>` api interface.
         """
         data = self.add_auth({"action": "mappings"})
         res, legend = self.sq("", data=data, reload=reload,
-                              bufferkey=bufferkeypipa,
+                              bufferkey=bufferkeypipax,
                               bufver=bufver)
 
         return dict((sa[0], dict(zip(legend[1:], sa[1:]))) for sa in res)
                 "results_templates_id": rtype}
         data = self.add_auth(data)
         res, legend = self.sq("", data=data, reload=reload,
-                              bufferkey=bufferkeypipa,
+                              bufferkey=bufferkeypipax,
                               bufver=bufver)
         # index by unique_id (last column)
         res = splitTableOnColumn(res, -1)
                               "ids": "$MULTI$"}
                                 )
         keynamingfn, _ = self.downloadMulti_bufcommand_replace_multi("",
-                         data=data, chunk=100, bufferkey=bufferkeypipa,
+                         data=data, chunk=100, bufferkey=bufferkeypipax,
                          transformfn=None)
         return keynamingfn
 
         data = {"action": "download", "ids": "$MULTI$"}
         data = self.add_auth(data)
         antss = self.downloadMulti("", result_ids, data=data, chunk=10,
-                                   bufferkey=bufferkeypipa, bufreload=reload,
+                                   bufferkey=bufferkeypipax, bufreload=reload,
                                    bufver=bufver)
         for a, legend in antss:
             yield a
                 legend = self.fromBuffer(bufcommand(buffered[0]))[0]
 
             legend = ["gene_id", "value"]
-            genes = nth(res, 0)[1:]
+            genes = nth(res, 0)
 
             antss = {}
             for i, cid in enumerate(unbuffered):
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.