X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=erange.git;a=blobdiff_plain;f=ReadDataset.py;fp=ReadDataset.py;h=5ff60e2e6954c862888c5807495ef49142e14fa3;hp=ef80d657c721c837cbbc6c64d2a007d0fc6aa6e5;hb=0d3e3112fd04c2e6b44a25cacef1d591658ad181;hpb=5e4ae21098dba3d1edcf11e7279da0d84c3422e4 diff --git a/ReadDataset.py b/ReadDataset.py index ef80d65..5ff60e2 100644 --- a/ReadDataset.py +++ b/ReadDataset.py @@ -1,25 +1,12 @@ -""" -Created on Jul 1, 2010 - -@author: sau -""" - import sqlite3 as sqlite import string import tempfile import shutil import os -from os import environ from array import array -from commoncode import getReverseComplement - -if environ.get("CISTEMATIC_TEMP"): - cisTemp = environ.get("CISTEMATIC_TEMP") -else: - cisTemp = "/tmp" +from commoncode import getReverseComplement, getConfigParser, getConfigOption -tempfile.tempdir = cisTemp -currentRDSVersion = "1.1" +currentRDSVersion = "2.0" class ReadDatasetError(Exception): @@ -140,6 +127,9 @@ class ReadDataset(): def cacheDB(self, filename): """ copy geneinfoDB to a local cache. """ + configParser = getConfigParser() + cisTemp = getConfigOption(configParser, "general", "cistematic_temp", default="/tmp") + tempfile.tempdir = cisTemp self.cachedDBFile = "%s.db" % tempfile.mktemp() shutil.copyfile(filename, self.cachedDBFile) @@ -385,6 +375,8 @@ class ReadDataset(): and which can be restricted by chromosome or custom-flag. Returns unique reads by default, but can return multireads with doMulti set to True. + + Need to rethink original design 1: Cannot have pairID without exporting as a readIDDict """ whereClause = [] resultsDict = {}