def process_general_file(score, namefile):
    res = list(sorted(score, key=score.__getitem__, reverse=True))
    l = 0
    values = []
    for s in res:
        if s not in args.skip:
            values.append(s)
            l += 1
        if l >= limit:
            break
    with open("{}.csv".format(namefile), 'w') as f:
        f.write("id,value\n")
        for v in values:
            val = bubble_annotation(field, field_string, v, potiron_path, None)
            f.write("{}{},\n".format(v, val))
            f.write("{}{},{}\n".format(v, val, int(score[v])))
    return values
示例#2
0
def process_general_file(score, namefile, field, field_string, skip, limit):
    res = list(sorted(score, key=score.__getitem__, reverse=True))
    l = 0
    values = []
    for s in res:
        if s not in skip:
            values.append(s)
            l+=1
        if l >= limit:
            break
    with open("{}.csv".format(namefile), 'w') as f:
        f.write("id,value\n")
        for v in values :
            val = bubble_annotation(field,field_string,v,potiron_path,None)
            f.write("{}{},\n".format(v,val))
            f.write("{}{},{}\n".format(v,val,int(score[v])))
    return values
示例#3
0
def process_file(score, name, prot, skip, limit):
    # Sort the complete list of values for the month by score
    res = list(sorted(score, key=score.__getitem__, reverse=True))
    l = 0
    values = []
    for s in res:
        # If the current value is not one that should be skipped, increment the number of values to include in the chart
        if s not in skip:
            values.append(s)
            l += 1
        # When the limit value is reached, we don't need to increment anymore, we break the loop
        if l >= limit:
            break
     # Write all the values and their scores into the csv datafile
    with open("{}.csv".format(name),'w') as f:
        f.write("id,value\n")
        for v in values :
            val = bubble_annotation(field,field_string,v,potiron_path,prot)
            f.write("{}{},\n".format(v,val))
            f.write("{}{},{}\n".format(v,val,int(score[v])))
    return values
示例#4
0
def process_file(red, redisKey, name, field, protocol, field_string, skip, limit):
    l = 0
    values = []
    # For each value ranged in decreasing order
    for v in red.zrevrangebyscore(redisKey,MAXVAL,0):
        val = v.decode()
        # If the current value is not one that should be skipped, increment the number of values to include in the chart
        if val not in skip :
            values.append(val)
            l += 1
        # When the limit value is reached, we don't need to increment anymore, we break the loop
        if l >= limit:
            break
    # Write all the values and their scores into the csv datafile
    with open("{}.csv".format(name),'w') as f:
        f.write("id,value\n")
        for v in values:
            val = bubble_annotation(field,field_string,v,potiron_path,protocol)
            f.write("{}{},\n".format(v,val))
            f.write("{}{},{}\n".format(v,val,red.zscore(redisKey,v)))
    return values
示例#5
0
 def process_file(self, redisKey, name, protocol, field_string):
     l = 0
     values = []
     # For each value ranged in decreasing order
     for v in self.red.zrevrangebyscore(redisKey,self.MAXVAL,0):
         val = v.decode()
         # If the current value is not one that should be skipped, increment the number of values to include in the chart
         if val not in self.skip :
             values.append(val)
             l += 1
         # When the limit value is reached, we don't need to increment anymore, we break the loop
         if l >= self.limit:
             break
     # Write all the values and their scores into the csv datafile
     with open("{}.csv".format(name),'w') as f:
         f.write("id,value\n")
         for v in values:
             val = bubble_annotation(self.field,field_string,v,potiron.potiron_path,protocol)
             f.write("{}{},\n".format(v,val))
             f.write("{}{},{}\n".format(v,val,self.red.zscore(redisKey,v)))
     return values