464aa35bb5735dfb8f565621dbde8b3b2ead1581 mmaddren Thu May 10 14:53:09 2012 -0700 fixed ucscGb and some of the more important scripts using it since they broke during the move to the new library structure diff --git python/programs/viewTrack/viewTrack python/programs/viewTrack/viewTrack index ba460ea..111768b 100755 --- python/programs/viewTrack/viewTrack +++ python/programs/viewTrack/viewTrack @@ -1,19 +1,22 @@ #!/usr/bin/env python2.7 import sys, os, shutil, argparse, urllib2, re -from ucscgenomics import ra, soft, track, styles, geo +from ucscGb.gbData.ra import raFile +from ucscGb.encode import track +from ucscGb.encode import styles +from ucscGb.externalData.geo import submission def filesize(val): if val > 1099511627776: return str(round(float(val) / 1099511627776, 2)) + 'TB' if val > 1073741824: return str(round(float(val) / 1073741824, 2)) + 'GB' if val > 1048576: return str(round(float(val) / 1048576, 2)) + 'MB' if val > 1024: return str(round(float(val) / 1024, 2)) + 'KB' else: return str(val) + 'B' def printTrackRefLine(): @@ -66,32 +69,32 @@ datatype = t.alphaMetaDb.dataType.name if t.alphaMetaDb.dataType.type == 'MicroArray': datatype = styles.style(datatype.ljust(16), 'yellow') elif t.alphaMetaDb.dataType.valid: datatype = styles.style(datatype.ljust(16), 'green') else: if t.alphaMetaDb.dataType.shouldSubmit: datatype = styles.style(datatype.ljust(16), 'red') else: datatype = styles.style(datatype.ljust(16), 'blue') #subtext = '' wantSubmit = 0 if datatype == '' and len(t.alphaMetaDb.experiments) == 0: datatype = styles.style('no expIds'.ljust(16), 'red') - if wantSubmit: - nametext = styles.style(nametext, 'green') + #if wantSubmit: + # nametext = styles.style(nametext, 'green') geouptodate = '' if args.geo and t.geo != None: exps = dict() local = 0 offsite = 0 mismatch = 0 matched = 0 for expId in t.alphaMetaDb.experiments.iterkeys(): k = t.alphaMetaDb.experiments[expId].title exps[k] = t.alphaMetaDb.experiments[expId] if k in t.geo.accessions.iterkeys(): happened = 0 for stanza in exps[k]: if 'geoSampleAccession' in stanza and stanza['geoSampleAccession'] != t.geo.accessions[k]: @@ -184,42 +187,42 @@ if len(sys.argv) == 1: parser.print_usage() return args = parser.parse_args(sys.argv[1:]) tracks = track.TrackCollection(args.database) if args.composite == None: if args.geo: for t in tracks.itervalues(): t.geo = None try: if 'geoSeriesAccession' in t.alphaMetaDb.compositeStanza: - t.geo = geo.Submission(t.alphaMetaDb.compositeStanza['geoSeriesAccession']) + t.geo = submission.Submission(t.alphaMetaDb.compositeStanza['geoSeriesAccession']) except KeyError: pass displayAll(args, tracks) else: if args.expIds == None or len(args.expIds) == 0: displayTrack(args, tracks[args.composite]) else: ids = list() for id in args.expIds: if '-' in id: start, end = id.split('-', 1) ids.extend(range(int(start), int(end) + 1)) else: ids.append(int(id)) if args.geo: tracks[args.composite].geo = None if 'geoSeriesAccession' in tracks[args.composite].alphaMetaDb.compositeTrack: - tracks[args.composite].geo = geo.Submission(tracks[args.composite].alphaMetaDb.compositeTrack['geoSeriesAccession']) + tracks[args.composite].geo = submission.Submission(tracks[args.composite].alphaMetaDb.compositeTrack['geoSeriesAccession']) displayTrack(args, tracks[args.composite], ids) if __name__ == '__main__': main() \ No newline at end of file