Skip to content

Commit

Permalink
Fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Smoren committed May 15, 2024
1 parent dfd8f6e commit 27e1d98
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/analysis/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ export function convertWeightsToMatrixRow(weights: TotalSummaryWeights, typesCou
createFilledArray(typesCount, weights.LINKS_TYPE_DELETED_MEAN),
weights.COMPOUNDS_PER_ATOM,
createFilledArray(typesCount, weights.COMPOUNDS_PER_ATOM_BY_TYPES),
Object.values(weights.COMPOUND_LENGTH_SUMMARY),
repeatArrayValues(Object.values(weights.COMPOUND_LENGTH_BY_TYPES_SUMMARY), typesCount),
Object.values(weights.COMPOUND_LENGTH_SUMMARY).slice(1),
repeatArrayValues(Object.values(weights.COMPOUND_LENGTH_BY_TYPES_SUMMARY).slice(1), typesCount),
].flat(Infinity) as number[];
}

export function convertSummaryToMatrix(summary: TotalSummary): number[] {
const compoundsPerAtom = summary.COMPOUNDS.size / summary.WORLD.ATOMS_COUNT[0];
const compoundsPerAtomByTypes = summary.COMPOUNDS.sizeByTypes.map((x) => x / summary.WORLD.ATOMS_COUNT[0]);
const compoundLengthSummary = Object.values(summary.COMPOUNDS.itemLengthSummary);
const compoundLengthSummary = Object.values(summary.COMPOUNDS.itemLengthSummary).slice(1);
const compoundLengthByTypesSummary = summary.COMPOUNDS.itemLengthByTypesSummary.map(
(item) => Object.values(item),
(item) => Object.values(item).slice(1),
);

return [
Expand Down

0 comments on commit 27e1d98

Please sign in to comment.