X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=server%2Fcompbio%2Fstatistic%2FCassandraRequester.java;fp=server%2Fcompbio%2Fstatistic%2FCassandraRequester.java;h=1e2d00b1bebd83a3a968ab755b24a5915e06f396;hb=58c9b97523e2273a316a947d977ca7ddd8b1356a;hp=1791c0fb9288764885047b678dbd5abd1b559d15;hpb=e42a6142f6baa1854037e2e869b8f4c1ab6ba000;p=proteocache.git diff --git a/server/compbio/statistic/CassandraRequester.java b/server/compbio/statistic/CassandraRequester.java index 1791c0f..1e2d00b 100755 --- a/server/compbio/statistic/CassandraRequester.java +++ b/server/compbio/statistic/CassandraRequester.java @@ -201,17 +201,17 @@ public class CassandraRequester { /* * query: protein feature */ + public Map readProteinsPrediction(String feature, int percent) { - Map result = db.ReadProtein(); - ; - if (result == null) + Map results = db.ReadProtein(); + if (results == null) return null; Map query = new HashMap(); - for (Map.Entry entry : result.entrySet()) { - String pred = entry.getValue(); - if (pred.replaceAll("[^" + feature + "]", "").length() > pred.length() * percent / 100 && (!entry.getKey().equals(""))) { - // if (!entry.getKey().equals("")) - query.put(entry.getKey(), pred); + for (Map.Entry entry : results.entrySet()) { + String prediction = entry.getValue(); + String protein = entry.getKey(); + if (prediction.replaceAll("[^" + feature + "]", "").length() > prediction.length() * percent / 100 && !protein.equals("")) { + query.put(protein, prediction); } } return query;