Beispiel #1
0
 public float[] weight(Collection<String> features) {
   float[] scores = new float[index.size()];
   for (String feature : features) {
     if (!data.containsKey(feature)) {
       continue;
     }
     if (isAveraged || data.get(feature).used > opts.minupdate) {
       data.get(feature).sumScoresForAllTransitions(scores);
     }
   }
   return scores;
 }
Beispiel #2
0
 /**
  * Return all Genbank IDs associated to this probeset.
  *
  * @param probesetID
  * @return Genbank IDs associated to this probeset.
  */
 public String[] getGenbankList(final String probesetID) {
   final String gbList = (String) probesetId2GenbankList.get(probesetID);
   if (gbList == null) {
     return ArrayUtils.EMPTY_STRING_ARRAY;
   } else {
     return gbList.split("[ ]");
   }
 }
Beispiel #3
0
 private void increment(List<String> features, int transition, float delta) {
   for (String feat : features) {
     if (!data.containsKey(feat)) {
       data.put(feat, new FeatureWeights());
     }
     data.get(feat).increment(transition, delta, i);
   }
 }
Beispiel #4
0
 public float weight(Collection<String> features, int trans) {
   float score = 0.0f;
   for (String feature : features) {
     if (data.containsKey(feature)) {
       score += data.get(feature).scoreForTransition(trans);
     }
   }
   return score;
 }
Beispiel #5
0
 public Weights<T> average() {
   System.err.print("averaging (this may take a while)... ");
   Weights<T> result = new Weights<T>(opts, true);
   result.data = new Object2ObjectOpenHashMap<>();
   result.index = index;
   result.gram = gram;
   int cnt = 0;
   for (String feat : data.keySet()) {
     FeatureWeights dw = data.get(feat);
     if (dw.used > opts.minupdate) {
       cnt++;
       FeatureWeights fw = new FeatureWeights();
       for (int trans : index.indices()) {
         float averaged = dw.getAveraged(trans, i);
         if (!Float.isNaN(averaged)) {
           fw.increment(trans, averaged, 0);
         }
       }
       result.data.put(feat, fw);
     }
   }
   System.err.println("done, averaged " + cnt + " features.");
   return result;
 }
 /**
  * Utility method to pull up the version number at which an annotation was deprecated and the
  * suggested replacement, if any
  *
  * @param annotationName the annotation class name (not the full package) to check
  */
 public static String getAnnotationDeprecationInfo(final String annotationName) {
   return deprecatedGATKAnnotations.get(annotationName).toString();
 }
 /**
  * Utility method to pull up the version number at which a walker was deprecated and the suggested
  * replacement, if any
  *
  * @param walkerName the walker class name (not the full package) to check
  */
 public static String getWalkerDeprecationInfo(final String walkerName) {
   return deprecatedGATKWalkers.get(walkerName).toString();
 }