From 8df5aa6c9324ea3b64daa3746f23f920dcfa2bd9 Mon Sep 17 00:00:00 2001 From: Colin Date: Mon, 31 May 2021 17:38:56 -0400 Subject: [PATCH] Add comment --- plugins/dotplot-view/src/PAFAdapter/PAFAdapter.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/plugins/dotplot-view/src/PAFAdapter/PAFAdapter.ts b/plugins/dotplot-view/src/PAFAdapter/PAFAdapter.ts index 74da9e276b..f09474fb99 100644 --- a/plugins/dotplot-view/src/PAFAdapter/PAFAdapter.ts +++ b/plugins/dotplot-view/src/PAFAdapter/PAFAdapter.ts @@ -110,6 +110,20 @@ export default class PAFAdapter extends BaseFeatureDataAdapter { } as PafRecord }) + // calculate the "weighted mean" (e.g. longer alignments factor in more + // heavily) of all the fragments of a query vs the reference that it mapped + // to + // + // this uses a combined key query+'-'+ref to iteratively map all the + // alignments that match a particular ref from a particular query (so 1d + // array of what could be a 2d map) + // + // the result is a single number that says e.g. chr5 from human mapped to + // chr5 on mouse with 0.8 quality, and that0.8 is then attached to all the + // pieces of chr5 on human that mapped to chr5 on mouse. if chr5 on human + // also more weakly mapped to chr6 on mouse, then it would have another + // value e.g. 0.6. this can show strong and weak levels of synteny, + // especially in polyploidy situations const scoreMap: { [key: string]: { quals: number[]; len: number[] } } = {} for (let i = 0; i < ret.length; i++) { const entry = ret[i]