9339bb8491ce829a93ddaae0d970a4aef28be5bf wong Mon Oct 17 10:45:25 2011 -0700 added supplemental file support diff --git python/lib/ucscgenomics/track.py python/lib/ucscgenomics/track.py index 778244e..bf793d6 100644 --- python/lib/ucscgenomics/track.py +++ python/lib/ucscgenomics/track.py @@ -160,35 +160,38 @@ @property def releases(self): """A list of all files in the release directory of this composite""" try: return self._releaseFiles except AttributeError: self._releaseFiles = list() count = 1 while os.path.exists(self.downloadsDirectory + 'release' + str(count)): releasepath = self.downloadsDirectory + 'release' + str(count) + '/' md5s = readMd5sums(releasepath + 'md5sum.txt') releasefiles = dict() for file in os.listdir(releasepath): - if file != 'md5sum.txt' and md5s != None and file in md5s: + if file != 'md5sum.txt' and md5s != None and file in md5s and not os.path.isdir(releasepath + file): releasefiles[file] = TrackFile(releasepath + file, md5s[file]) - else: + elif not os.path.isdir(releasepath + file): releasefiles[file] = TrackFile(releasepath + file, None) - + elif os.path.isdir(releasepath + file): + for innerfile in os.listdir(releasepath + file): + pathfile = file + "/" + innerfile + releasefiles[pathfile] = TrackFile(releasepath + pathfile, None) #releasefiles.sort() self._releaseFiles.append(releasefiles) count = count + 1 return self._releaseFiles @property def alphaMetaDb(self): """The Ra file in the metaDb for this composite""" try: return self._alphaMetaDb except AttributeError: if not os.path.isfile(self._alphaMdbPath): raise KeyError(self._alphaMdbPath + ' does not exist') self._alphaMetaDb = ra.RaFile(self._alphaMdbPath)