Skip to content

Commit

Permalink
ref: reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
tzok committed Jul 18, 2024
1 parent d1f3955 commit 65f013a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
1 change: 0 additions & 1 deletion mcq-cli/src/main/java/pl/poznan/put/mcq/cli/Lcs.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import org.apache.commons.cli.ParseException;
import org.apache.commons.math3.util.FastMath;
import pl.poznan.put.circular.ImmutableAngle;
import pl.poznan.put.comparison.LCS;
import pl.poznan.put.comparison.LCSv2;
import pl.poznan.put.comparison.exception.IncomparableStructuresException;
import pl.poznan.put.comparison.global.LCSGlobalResult;
Expand Down
30 changes: 16 additions & 14 deletions mcq-core/src/main/java/pl/poznan/put/comparison/LCSv2.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,27 +106,29 @@ public final GlobalResult compareGlobally(
return createResult(r1, r2, bestDeltas, bestBegin, bestLength);
}

private GlobalResult createResult(List<PdbResidue> target, List<PdbResidue> model, AngleSample deltas, int begin, int length) {
private GlobalResult createResult(
List<PdbResidue> target, List<PdbResidue> model, AngleSample deltas, int begin, int length) {
final var targetFragment =
ImmutablePdbCompactFragment.of(target.subList(begin, begin + length));
final var modelFragment =
ImmutablePdbCompactFragment.of(model.subList(begin, begin + length));
ImmutablePdbCompactFragment.of(target.subList(begin, begin + length));
final var modelFragment = ImmutablePdbCompactFragment.of(model.subList(begin, begin + length));
final var selectionModel = new StructureSelection("", Collections.singletonList(modelFragment));
final var selectionTarget =
new StructureSelection("", Collections.singletonList(targetFragment));
new StructureSelection("", Collections.singletonList(targetFragment));
final List<ResidueComparison> residueComparisons =
IntStream.range(begin, begin + length)
.mapToObj(
i -> ImmutableResidueComparison.of(target.get(i), model.get(i), Collections.emptyList()))
.collect(Collectors.toList());
IntStream.range(begin, begin + length)
.mapToObj(
i ->
ImmutableResidueComparison.of(
target.get(i), model.get(i), Collections.emptyList()))
.collect(Collectors.toList());
final var fragmentComparison =
FragmentComparison.fromResidueComparisons(
residueComparisons, moleculeType.mainAngleTypes());
FragmentComparison.fromResidueComparisons(
residueComparisons, moleculeType.mainAngleTypes());
final var fragmentMatch =
new FragmentMatch(targetFragment, modelFragment, false, 0, fragmentComparison);
new FragmentMatch(targetFragment, modelFragment, false, 0, fragmentComparison);
final var selectionMatch =
new SelectionMatch(
selectionTarget, selectionModel, Collections.singletonList(fragmentMatch));
new SelectionMatch(
selectionTarget, selectionModel, Collections.singletonList(fragmentMatch));
return ImmutableLCSGlobalResult.of(selectionMatch, deltas, selectionModel, selectionTarget);
}

Expand Down

0 comments on commit 65f013a

Please sign in to comment.