lib/rbbt/rest/entity.rb in rbbt-rest-1.7.5 vs lib/rbbt/rest/entity.rb in rbbt-rest-1.7.6
- old
+ new
@@ -309,10 +309,10 @@
file = Entity::Map.map_file(entity_type.split(":").first, column, map_id, user)
file = Entity::Map.map_file(entity_type.split(":").first, column, map_id, nil) unless File.exists? file
tsv = TSV.open(file)
tsv.process tsv.fields.first do |value|
value = value.flatten.first if Array === value
- (1 - value.to_f) / value.to_f
+ - Math.log(value.to_f.abs) * (value.to_f >= 0 ? 1 : -1)
end
tsv.fields = [tsv.fields.first + " score"]
tsv.type = :single
tsv.cast = :to_f
new_id = map_id << " [Pvalue score]"