Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- possibleStats = {
- 'chromosome':args.chromosome,
- 'type':args.type,
- 'flag':args.flag,
- 'tlen':args.tlen,
- 'gc':args.gc
- }
- CHROMOSOME,TYPE,FLAG,TLEN,GC = False,False,False,False,False # create the variables which are set PER ROW of the file.
- columns = []
- for key,value in possibleStats.items(): # create a list of the variables used. we do this outside
- if value: columns.append(key.upper()) # of the main loop so it only needs to happen once per file.
- for line in file:
- [... code that sets CHROMOSOME,TYPE,FLAG,TLEN and GC to some kind of value ]
- try:
- data[eval(columns)] += 1
- #data[(CHROMOSOME,TYPE,FLAGS,TLEN,GC)] += 1
- except KeyError:
- data[eval(columns)] = 1
- #data[(CHROMOSOME,TYPE,FLAGS,TLEN)] = 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement