Sets scoring system used for building alignments

@param scoring scoring system
@return parameters object
325061
public KAlignerParameters setScoring(LinearGapAlignmentScoring scoring) {
        if (scoring != null && !scoring.uniformBasicMatchScore())
            throw new IllegalArgumentException("Use scoring with common match score.");
        this.scoring = scoring;
        return this;
    }
497468
public static void updateSymmetryScores(MultipleAlignment symm)
			throws StructureException {

		// Multiply by the order of symmetry to normalize score
		double tmScore = MultipleAlignmentScorer.getAvgTMScore(symm)
				* symm.size();
		double rmsd = MultipleAlignmentScorer.getRMSD(symm);

		symm.putScore(MultipleAlignmentScorer.AVGTM_SCORE, tmScore);
		symm.putScore(MultipleAlignmentScorer.RMSD, rmsd);
	}
618869
public static <S extends Sequence<S>> int calculateScore(S seq1, Range seq1Range, Mutations<S> mutations,
                                                             AlignmentScoring<S> scoring) {
        if (scoring instanceof LinearGapAlignmentScoring)
            return calculateScore(seq1, seq1Range, mutations, (LinearGapAlignmentScoring<S>) scoring);
        else if (scoring instanceof AffineGapAlignmentScoring)
            return calculateScore(seq1, seq1Range, mutations, (AffineGapAlignmentScoring<S>) scoring);
        else
            throw new IllegalArgumentException("Unknown scoring type");
    }
234490
public final void generateDashboardScoreSettings() {
    ScoreCriteriaSettings dashboardScoreCriteriaSettings = new ScoreCriteriaSettings();
    dashboardScoreCriteriaSettings.setMaxScore(
      this.scoreSettings.getMaxScore()
    );
    dashboardScoreCriteriaSettings.setType(ScoreValueType.DASHBOARD);
    dashboardScoreCriteriaSettings.setComponentAlert(
      ComponentAlert.cloneComponentAlert(this.scoreSettings.getComponentAlert())
    );
    dashboardScoreCriteriaSettings.setBuild(
      BuildScoreSettings.cloneBuildScoreSettings(this.scoreSettings.getBuildWidget())
    );
    dashboardScoreCriteriaSettings.setDeploy(
      DeployScoreSettings.cloneDeployScoreSettings(this.scoreSettings.getDeployWidget())
    );
    dashboardScoreCriteriaSettings.setQuality(
      QualityScoreSettings.cloneQualityScoreSettings(this.scoreSettings.getQualityWidget())
    );
    dashboardScoreCriteriaSettings.setScm(
      ScmScoreSettings.cloneScmScoreSettings(this.scoreSettings.getScmWidget())
    );

    LOGGER.debug("Generate Score Dashboard Settings dashboardScoreCriteriaSettings {}", dashboardScoreCriteriaSettings);

    this.dashboardScoreCriteriaSettings = dashboardScoreCriteriaSettings;
  }
858948
private List<String> findMatchesWithLowestScore(final List<ScoredHost> scored) {
    final int minScore = scored.get(0).score;
    final ImmutableList.Builder<String> minScoreHosts = ImmutableList.builder();
    for (final ScoredHost score : scored) {
      if (score.score == minScore) {
        minScoreHosts.add(score.host);
      }
    }
    return minScoreHosts.build();
  }
523515
@Override
   protected Scorer createScorer(IndexReader reader, boolean scoreDocsInOrder, boolean topScorer) throws IOException {
        return new MatchAllScorer(reader, field);
    }
866627
public static <T extends V, V> ScoredValue<V> just(double score, T value) {

        LettuceAssert.notNull(value, "Value must not be null");

        return new ScoredValue<V>(score, value);
    }
473671
@Override
    public final double[] score0(double[] row, double offset, double[] preds) {
        super.scoreAllTrees(row, preds);
        return unifyPreds(row, offset, preds);
    }
881720
public static ScoreKeeper[] scoreKeepers(ScoringInfo[] scoring_history) {
    ScoreKeeper[] sk = new ScoreKeeper[scoring_history.length];
    for (int i=0;i<sk.length;++i) {
      sk[i] = scoring_history[i].cross_validation ? scoring_history[i].scored_xval
              : scoring_history[i].validation ? scoring_history[i].scored_valid
              : scoring_history[i].scored_train;
    }
    return sk;
  }
572969
public static void calculateScores(MultipleAlignment alignment)
			throws StructureException {

		// Put RMSD
		List<Atom[]> trans = MultipleAlignmentTools.transformAtoms(alignment);
		alignment.putScore(RMSD, getRMSD(trans));

		// Put AvgTM-Score
		List<Integer> lengths = new ArrayList<Integer>(alignment.size());
		for (Atom[] atoms : alignment.getAtomArrays()) {
			lengths.add(atoms.length);
		}
		alignment.putScore(AVGTM_SCORE, getAvgTMScore(trans, lengths));
	}
85435
public static <S extends Sequence<S>> int calculateScore(S seq1, Range seq1Range, Mutations<S> mutations,
                                                             LinearGapAlignmentScoring<S> scoring) {
        if (!mutations.isEmpty() && mutations.getPositionByIndex(0) < seq1Range.getFrom() - 1)
            throw new IllegalArgumentException();

        final AlignmentIteratorForward<S> iterator = new AlignmentIteratorForward<>(mutations, seq1Range);

        int score = 0;

        while (iterator.advance()) {
            final int mut = iterator.getCurrentMutation();
            switch (Mutation.getRawTypeCode(mut)) {
                case RAW_MUTATION_TYPE_SUBSTITUTION:
                    score += scoring.getScore(Mutation.getFrom(mut), Mutation.getTo(mut));
                    break;

                case RAW_MUTATION_TYPE_DELETION:
                case RAW_MUTATION_TYPE_INSERTION:
                    score += scoring.getGapPenalty();
                    break;

                default:
                    byte c = seq1.codeAt(iterator.getSeq1Position());
                    score += scoring.getScore(c, c);
                    break;
            }
        }

        return score;
    }
519147
public static <S extends Sequence<S>> Alignment<S> alignLocal(AlignmentScoring<S> alignmentScoring,
                                                                  S seq1, S seq2) {
        if (alignmentScoring instanceof AffineGapAlignmentScoring)
            return alignLocalAffine((AffineGapAlignmentScoring<S>) alignmentScoring, seq1, seq2);
        if (alignmentScoring instanceof LinearGapAlignmentScoring)
            return alignLocalLinear((LinearGapAlignmentScoring<S>) alignmentScoring, seq1, seq2);
        throw new RuntimeException("Unknown scoring type.");
    }
912735
private void initQualityScoreSettings() {
    QualityScoreSettings qualityScoreSettings = this.scoreSettings.getQualityWidget();
    if (null != qualityScoreSettings) {
      qualityScoreSettings.setCriteria(
        Utils.mergeCriteria(this.scoreSettings.getCriteria(), qualityScoreSettings.getCriteria())
      );

      initQualityScoreChildrenSettings(qualityScoreSettings);
    }
  }
1066330
private static Map<Integer, Double> initializeScores(Map<Integer, Integer> alignment,
			Map<Integer, Double> scores, int k) {
		if(scores == null) {
			scores = new HashMap<Integer, Double>(alignment.size());
		} else {
			scores.clear();
		}
		Map<Integer,Integer> alignK = AlignmentTools.applyAlignment(alignment, k);

		// calculate input range
		int maxPre = Integer.MIN_VALUE;
		int minPre = Integer.MAX_VALUE;
		for(Integer pre : alignment.keySet()) {
			if(pre>maxPre) maxPre = pre;
			if(pre<minPre) minPre = pre;
		}

		for(Integer pre : alignment.keySet()) {
			Integer image = alignK.get(pre);

			// Use the absolute error score, |x - f^k(x)|
			double score = scoreAbsError(pre,image,minPre,maxPre);
			scores.put(pre, score);
		}
		return scores;
	}
632343
public void setScore(Double score) {
    if(score == null) {
      score = Constants.DEFAULT_SCORE;
    }
    this.score = score;
  }
1312891
public static ScoringInfo[] prependScoringInfo(ScoringInfo scoringInfo, ScoringInfo[] scoringInfos) {
    if (scoringInfos == null) {
      return new ScoringInfo[]{ scoringInfo };
    } else {
      ScoringInfo[] bigger = new ScoringInfo[scoringInfos.length + 1];
      System.arraycopy(scoringInfos, 0, bigger, 0, scoringInfos.length);
      bigger[bigger.length - 1] = scoringInfo;
      return bigger;
    }
  }
1239655
public Optional<FMeasureInfo> score(final Iterable<? extends Iterable<?>> predicted,
      final Iterable<? extends Iterable<?>> gold) {
    final List<Set<Object>> predictedAsSets = CorefScorerUtils.toSets(predicted);
    final List<Set<Object>> goldAsSets = CorefScorerUtils.toSets(gold);

    final Map<Object, Set<Object>> predictedItemToGroup =
        CollectionUtils.makeElementsToContainersMap(predictedAsSets);
    final Map<Object, Set<Object>> goldItemToGroup =
        CollectionUtils.makeElementsToContainersMap(goldAsSets);

    CorefScorerUtils.checkPartitionsOverSameElements(predictedItemToGroup.keySet(),
        goldItemToGroup.keySet());

    final Optional<Float> recall =
        mucScoreComponent(goldAsSets, predictedAsSets, predictedItemToGroup);
    final Optional<Float> precision =
        mucScoreComponent(predictedAsSets, goldAsSets, goldItemToGroup);

    if (recall.isPresent() && precision.isPresent()) {
      // why are these floats?
      return Optional.<FMeasureInfo>of(new PrecisionRecallPair(precision.get(), recall.get()));
    } else {
      return Optional.absent();
    }
  }