jbrowse-plugin-tview 2.2.3 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +317 -105
- package/dist/AddHighlightModel/index.js +2 -13
- package/dist/AddHighlightModel/index.js.map +1 -1
- package/dist/LaunchTView/TviewGetPlanRpc/TviewGetPlan.d.ts +44 -64
- package/dist/LaunchTView/TviewGetPlanRpc/TviewGetPlan.js +57 -81
- package/dist/LaunchTView/TviewGetPlanRpc/TviewGetPlan.js.map +1 -1
- package/dist/LaunchTView/TviewGetPlanRpc/index.d.ts +1 -1
- package/dist/LaunchTView/align.d.ts +11 -17
- package/dist/LaunchTView/align.js +190 -150
- package/dist/LaunchTView/align.js.map +1 -1
- package/dist/LaunchTView/alleles.d.ts +14 -0
- package/dist/LaunchTView/alleles.js +47 -0
- package/dist/LaunchTView/alleles.js.map +1 -1
- package/dist/LaunchTView/fetchTviewPlan.d.ts +5 -37
- package/dist/LaunchTView/fetchTviewPlan.js +7 -28
- package/dist/LaunchTView/fetchTviewPlan.js.map +1 -1
- package/dist/LaunchTView/index.js +45 -16
- package/dist/LaunchTView/index.js.map +1 -1
- package/dist/LaunchTView/launch.d.ts +50 -0
- package/dist/LaunchTView/launch.js +48 -0
- package/dist/LaunchTView/launch.js.map +1 -0
- package/dist/LaunchTView/launchView.d.ts +3 -8
- package/dist/LaunchTView/launchView.js +18 -12
- package/dist/LaunchTView/launchView.js.map +1 -1
- package/dist/LaunchTView/modifications.d.ts +64 -0
- package/dist/LaunchTView/modifications.js +131 -0
- package/dist/LaunchTView/modifications.js.map +1 -0
- package/dist/LaunchTView/readLayout.d.ts +35 -39
- package/dist/LaunchTView/readLayout.js +44 -24
- package/dist/LaunchTView/readLayout.js.map +1 -1
- package/dist/LaunchTView/repeatStats.d.ts +1 -1
- package/dist/LaunchTView/repeatStats.js +6 -21
- package/dist/LaunchTView/repeatStats.js.map +1 -1
- package/dist/LaunchTView/tview.d.ts +34 -23
- package/dist/LaunchTView/tview.js +127 -78
- package/dist/LaunchTView/tview.js.map +1 -1
- package/dist/TViewPanel/components/TViewPanel.js +9 -4
- package/dist/TViewPanel/components/TViewPanel.js.map +1 -1
- package/dist/TViewPanel/genome.d.ts +11 -0
- package/dist/TViewPanel/genome.js +32 -0
- package/dist/TViewPanel/genome.js.map +1 -0
- package/dist/TViewPanel/init.d.ts +38 -19
- package/dist/TViewPanel/init.js +66 -39
- package/dist/TViewPanel/init.js.map +1 -1
- package/dist/TViewPanel/initMenu.d.ts +28 -0
- package/dist/TViewPanel/initMenu.js +79 -0
- package/dist/TViewPanel/initMenu.js.map +1 -0
- package/dist/TViewPanel/model.d.ts +1057 -334
- package/dist/TViewPanel/model.js +298 -87
- package/dist/TViewPanel/model.js.map +1 -1
- package/dist/TViewPanel/modifications.d.ts +25 -0
- package/dist/TViewPanel/modifications.js +89 -0
- package/dist/TViewPanel/modifications.js.map +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/jbrowse-plugin-tview.umd.production.min.js +125 -88
- package/dist/jbrowse-plugin-tview.umd.production.min.js.map +4 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +8 -8
- package/src/AddHighlightModel/index.tsx +8 -14
- package/src/LaunchTView/TviewGetPlanRpc/TviewGetPlan.ts +119 -157
- package/src/LaunchTView/TviewGetPlanRpc/index.ts +0 -1
- package/src/LaunchTView/align.ts +225 -176
- package/src/LaunchTView/alleles.ts +66 -0
- package/src/LaunchTView/fetchTviewPlan.ts +11 -54
- package/src/LaunchTView/index.ts +74 -16
- package/src/LaunchTView/launch.ts +98 -0
- package/src/LaunchTView/launchView.ts +28 -20
- package/src/LaunchTView/modifications.ts +200 -0
- package/src/LaunchTView/readLayout.ts +65 -41
- package/src/LaunchTView/repeatStats.ts +7 -23
- package/src/LaunchTView/tview.ts +158 -91
- package/src/TViewPanel/components/TViewPanel.tsx +33 -4
- package/src/TViewPanel/genome.ts +41 -0
- package/src/TViewPanel/init.ts +104 -51
- package/src/TViewPanel/initMenu.ts +126 -0
- package/src/TViewPanel/model.ts +350 -97
- package/src/TViewPanel/modifications.ts +127 -0
- package/src/index.ts +0 -2
- package/src/version.ts +1 -1
- package/dist/AddHighlightModel/GenomeMouseoverHighlight.d.ts +0 -6
- package/dist/AddHighlightModel/GenomeMouseoverHighlight.js +0 -23
- package/dist/AddHighlightModel/GenomeMouseoverHighlight.js.map +0 -1
- package/dist/AddHighlightModel/HighlightComponents.d.ts +0 -7
- package/dist/AddHighlightModel/HighlightComponents.js +0 -11
- package/dist/AddHighlightModel/HighlightComponents.js.map +0 -1
- package/dist/LaunchTView/components/ArrayReport.d.ts +0 -10
- package/dist/LaunchTView/components/ArrayReport.js +0 -59
- package/dist/LaunchTView/components/ArrayReport.js.map +0 -1
- package/dist/LaunchTView/components/LaunchTViewDialog.d.ts +0 -6
- package/dist/LaunchTView/components/LaunchTViewDialog.js +0 -124
- package/dist/LaunchTView/components/LaunchTViewDialog.js.map +0 -1
- package/dist/LaunchTView/sampleTree.d.ts +0 -37
- package/dist/LaunchTView/sampleTree.js +0 -65
- package/dist/LaunchTView/sampleTree.js.map +0 -1
- package/dist/LaunchTView/useTviewMsa.d.ts +0 -18
- package/dist/LaunchTView/useTviewMsa.js +0 -24
- package/dist/LaunchTView/useTviewMsa.js.map +0 -1
- package/dist/TViewPanel/coords.d.ts +0 -25
- package/dist/TViewPanel/coords.js +0 -56
- package/dist/TViewPanel/coords.js.map +0 -1
- package/src/AddHighlightModel/GenomeMouseoverHighlight.tsx +0 -46
- package/src/AddHighlightModel/HighlightComponents.tsx +0 -25
- package/src/LaunchTView/components/ArrayReport.tsx +0 -64
- package/src/LaunchTView/components/LaunchTViewDialog.tsx +0 -212
- package/src/LaunchTView/sampleTree.ts +0 -73
- package/src/LaunchTView/useTviewMsa.ts +0 -39
- package/src/TViewPanel/coords.ts +0 -65
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { RpcMethodType } from '@jbrowse/core/pluggableElementTypes';
|
|
2
|
+
import type { TviewModifications } from '../modifications';
|
|
3
|
+
import type { RpcCallContext, RpcExecuteArgs } from '@jbrowse/core/rpc/RpcRegistry';
|
|
2
4
|
import type { Region } from '@jbrowse/core/util';
|
|
5
|
+
import type { Highlight, RowDataInput } from 'react-msaview';
|
|
3
6
|
/** one BAM/CRAM to draw rows from, and the name its rows are grouped under */
|
|
4
7
|
export interface TviewSourceArgs {
|
|
5
8
|
adapterConfig: Record<string, unknown>;
|
|
6
|
-
sample
|
|
9
|
+
sample: string;
|
|
7
10
|
/**
|
|
8
11
|
* what this file calls the region's sequence. Filled in on the client, where
|
|
9
12
|
* the assembly's aliases live: two files over one assembly routinely spell it
|
|
@@ -12,47 +15,43 @@ export interface TviewSourceArgs {
|
|
|
12
15
|
refName?: string;
|
|
13
16
|
}
|
|
14
17
|
export interface TviewGetPlanArgs {
|
|
15
|
-
sessionId: string;
|
|
16
18
|
sources: TviewSourceArgs[];
|
|
17
|
-
/** the
|
|
18
|
-
|
|
19
|
+
/** names the genome, so the call layer attaches its sequence adapter */
|
|
20
|
+
assemblyName: string;
|
|
19
21
|
/** the sequence adapter's own spelling of the region */
|
|
20
|
-
sequenceRefName
|
|
22
|
+
sequenceRefName: string;
|
|
21
23
|
region: Region;
|
|
22
24
|
/** stop before rendering an alignment bigger than this many cells */
|
|
23
25
|
maxCells: number;
|
|
24
26
|
}
|
|
25
|
-
/** what crosses back: the alignment, and the numbers the dialog reports */
|
|
26
|
-
export interface TviewArrayReport {
|
|
27
|
-
start: number;
|
|
28
|
-
end: number;
|
|
29
|
-
period: number;
|
|
30
|
-
unit: string;
|
|
31
|
-
width: number;
|
|
32
|
-
/** per row: copies carried, and allele length in bp */
|
|
33
|
-
copies: [string, number][];
|
|
34
|
-
lengths: [string, number][];
|
|
35
|
-
}
|
|
36
27
|
export interface TviewPlanResult {
|
|
37
28
|
msa: string;
|
|
38
|
-
/**
|
|
39
|
-
|
|
40
|
-
|
|
29
|
+
/** per row name: its sample, and its copies and allele length at the subject */
|
|
30
|
+
rowData: RowDataInput;
|
|
31
|
+
/** a bracket over each insertion site and each array block */
|
|
32
|
+
highlights: Highlight[];
|
|
41
33
|
columnCount: number;
|
|
42
34
|
cellCount: number;
|
|
43
|
-
insertionWidths: [number, number][];
|
|
44
|
-
arraySpans: [number, number, number][];
|
|
45
35
|
region: {
|
|
46
36
|
refName: string;
|
|
47
37
|
start: number;
|
|
48
38
|
end: number;
|
|
49
39
|
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
referenceName?: string;
|
|
40
|
+
/** whether rows carry a copy count at a subject array */
|
|
41
|
+
hasSubject: boolean;
|
|
53
42
|
samples: string[];
|
|
54
43
|
/** set when the alignment was over maxCells and `msa` is empty */
|
|
55
44
|
tooLarge?: boolean;
|
|
45
|
+
/** set when some read in the window has an MM tag */
|
|
46
|
+
modifications?: TviewModifications;
|
|
47
|
+
}
|
|
48
|
+
declare module '@jbrowse/core/rpc/RpcRegistry' {
|
|
49
|
+
interface RpcRegistry {
|
|
50
|
+
TviewGetPlan: {
|
|
51
|
+
args: TviewGetPlanArgs;
|
|
52
|
+
return: TviewPlanResult;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
56
55
|
}
|
|
57
56
|
/**
|
|
58
57
|
* Builds the whole alignment in the worker and sends back the FASTA.
|
|
@@ -69,64 +68,45 @@ export interface TviewPlanResult {
|
|
|
69
68
|
* against the same reference interval, so an array's copies are counted once,
|
|
70
69
|
* over rows from all of them.
|
|
71
70
|
*/
|
|
72
|
-
export default class TviewGetPlan extends RpcMethodType {
|
|
73
|
-
name:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
71
|
+
export default class TviewGetPlan extends RpcMethodType<'TviewGetPlan'> {
|
|
72
|
+
name: "TviewGetPlan";
|
|
73
|
+
serializeArguments(args: TviewGetPlanArgs & RpcCallContext): Promise<Record<string, unknown>>;
|
|
74
|
+
execute(args: RpcExecuteArgs<'TviewGetPlan'>): Promise<{
|
|
75
|
+
modifications?: {
|
|
76
|
+
rows: string[];
|
|
77
|
+
types: string[];
|
|
78
|
+
row: Uint32Array<ArrayBuffer>;
|
|
79
|
+
residue: Uint32Array<ArrayBuffer>;
|
|
80
|
+
type: Uint8Array<ArrayBuffer>;
|
|
81
|
+
prob: Uint8Array<ArrayBuffer>;
|
|
82
|
+
dropped: number;
|
|
83
|
+
unplaced: number;
|
|
84
|
+
} | undefined;
|
|
82
85
|
msa: string;
|
|
83
|
-
tooLarge: boolean;
|
|
84
|
-
rowCount: number;
|
|
85
86
|
columnCount: number;
|
|
86
87
|
cellCount: number;
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
rowData: RowDataInput;
|
|
89
|
+
highlights: Highlight[];
|
|
89
90
|
region: {
|
|
90
91
|
refName: string;
|
|
91
92
|
start: number;
|
|
92
93
|
end: number;
|
|
93
94
|
};
|
|
94
|
-
|
|
95
|
-
start: number;
|
|
96
|
-
end: number;
|
|
97
|
-
period: number;
|
|
98
|
-
unit: string;
|
|
99
|
-
width: number;
|
|
100
|
-
copies: [string, number][];
|
|
101
|
-
lengths: [string, number][];
|
|
102
|
-
}[];
|
|
103
|
-
subjectIndex: number | undefined;
|
|
104
|
-
referenceName: string | undefined;
|
|
95
|
+
hasSubject: boolean;
|
|
105
96
|
samples: string[];
|
|
106
97
|
} | {
|
|
107
98
|
msa: string;
|
|
108
|
-
|
|
109
|
-
rowCount: number;
|
|
99
|
+
tooLarge: boolean;
|
|
110
100
|
columnCount: number;
|
|
111
101
|
cellCount: number;
|
|
112
|
-
|
|
113
|
-
|
|
102
|
+
rowData: RowDataInput;
|
|
103
|
+
highlights: Highlight[];
|
|
114
104
|
region: {
|
|
115
105
|
refName: string;
|
|
116
106
|
start: number;
|
|
117
107
|
end: number;
|
|
118
108
|
};
|
|
119
|
-
|
|
120
|
-
start: number;
|
|
121
|
-
end: number;
|
|
122
|
-
period: number;
|
|
123
|
-
unit: string;
|
|
124
|
-
width: number;
|
|
125
|
-
copies: [string, number][];
|
|
126
|
-
lengths: [string, number][];
|
|
127
|
-
}[];
|
|
128
|
-
subjectIndex: number | undefined;
|
|
129
|
-
referenceName: string | undefined;
|
|
109
|
+
hasSubject: boolean;
|
|
130
110
|
samples: string[];
|
|
131
111
|
}>;
|
|
132
112
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
+
import { isSequenceAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
1
2
|
import { getAdapter } from '@jbrowse/core/data_adapters/dataAdapterCache';
|
|
3
|
+
import { getFeatureAdapterOrThrow } from '@jbrowse/core/data_adapters/getFeatureAdapter';
|
|
2
4
|
import { RpcMethodType } from '@jbrowse/core/pluggableElementTypes';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { planTviewMsa,
|
|
6
|
-
function isFeatureSource(adapter) {
|
|
7
|
-
return 'getFeatures' in adapter && typeof adapter.getFeatures === 'function';
|
|
8
|
-
}
|
|
5
|
+
import { assembleLocString } from '@jbrowse/core/util';
|
|
6
|
+
import { planModifications } from '../modifications';
|
|
7
|
+
import { planHighlights, planRowData, planTviewMsa, renderRows, toFasta, } from '../tview';
|
|
9
8
|
/**
|
|
10
9
|
* Drains an adapter's feature observable into an array.
|
|
11
10
|
*
|
|
@@ -13,14 +12,11 @@ function isFeatureSource(adapter) {
|
|
|
13
12
|
* not a dependency here and `@jbrowse/core/util/rxjs` publishes only
|
|
14
13
|
* `ObservableCreate`. Subscribing directly needs neither.
|
|
15
14
|
*/
|
|
16
|
-
async function fetchAll(
|
|
17
|
-
const
|
|
18
|
-
if (!isFeatureSource(dataAdapter)) {
|
|
19
|
-
throw new Error(`${adapterConfig.type} has no getFeatures`);
|
|
20
|
-
}
|
|
15
|
+
async function fetchAll(args, region) {
|
|
16
|
+
const dataAdapter = await getFeatureAdapterOrThrow(args);
|
|
21
17
|
return new Promise((resolve, reject) => {
|
|
22
18
|
const ret = [];
|
|
23
|
-
dataAdapter.getFeatures(region).subscribe({
|
|
19
|
+
dataAdapter.getFeatures(region, { signal: args.signal }).subscribe({
|
|
24
20
|
next: feature => ret.push(feature),
|
|
25
21
|
error: reject,
|
|
26
22
|
complete: () => {
|
|
@@ -29,6 +25,26 @@ async function fetchAll(pluginManager, sessionId, adapterConfig, region) {
|
|
|
29
25
|
});
|
|
30
26
|
});
|
|
31
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* The reference over exactly `region`, which becomes the alignment's first row
|
|
30
|
+
* and is what makes an array an interval rather than an insertion. The region
|
|
31
|
+
* arrives clamped to its contig, so a short answer means the sequence could not
|
|
32
|
+
* be read, and a row that stops early would misplace every column after it.
|
|
33
|
+
*/
|
|
34
|
+
async function fetchReference(pluginManager, { sessionId, sequenceAdapter, sequenceRefName, region, signal, }) {
|
|
35
|
+
const dataAdapter = sequenceAdapter
|
|
36
|
+
? (await getAdapter(pluginManager, sessionId, sequenceAdapter)).dataAdapter
|
|
37
|
+
: undefined;
|
|
38
|
+
const sequence = dataAdapter && isSequenceAdapter(dataAdapter)
|
|
39
|
+
? await dataAdapter.getSequence({ ...region, refName: sequenceRefName }, { signal })
|
|
40
|
+
: undefined;
|
|
41
|
+
const want = region.end - region.start;
|
|
42
|
+
if (sequence?.length !== want) {
|
|
43
|
+
const n = (x) => x.toLocaleString('en-US');
|
|
44
|
+
throw new Error(`Could not read the reference sequence over ${assembleLocString(region)}: got ${n(sequence?.length ?? 0)}bp of ${n(want)}bp`);
|
|
45
|
+
}
|
|
46
|
+
return sequence;
|
|
47
|
+
}
|
|
32
48
|
/**
|
|
33
49
|
* Builds the whole alignment in the worker and sends back the FASTA.
|
|
34
50
|
*
|
|
@@ -49,41 +65,24 @@ export default class TviewGetPlan extends RpcMethodType {
|
|
|
49
65
|
super(...arguments);
|
|
50
66
|
this.name = 'TviewGetPlan';
|
|
51
67
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
async serializeArguments(args, rpcDriverClassName) {
|
|
59
|
-
const typed = args;
|
|
60
|
-
const assemblyManager = this.pluginManager.rootModel?.session?.assemblyManager;
|
|
61
|
-
if (!assemblyManager) {
|
|
62
|
-
throw new Error('no assembly manager');
|
|
63
|
-
}
|
|
64
|
-
const refNameFor = async (adapterConfig) => {
|
|
65
|
-
const { regions } = await renameRegionsIfNeeded(assemblyManager, {
|
|
66
|
-
sessionId: typed.sessionId,
|
|
67
|
-
adapterConfig,
|
|
68
|
-
regions: [typed.region],
|
|
68
|
+
async serializeArguments(args) {
|
|
69
|
+
const sources = await Promise.all(args.sources.map(async (source) => {
|
|
70
|
+
const { regions } = await this.renameRegions({
|
|
71
|
+
sessionId: args.sessionId,
|
|
72
|
+
adapterConfig: source.adapterConfig,
|
|
73
|
+
regions: [args.region],
|
|
69
74
|
});
|
|
70
|
-
return regions[0].refName;
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
...source,
|
|
74
|
-
refName: await refNameFor(source.adapterConfig),
|
|
75
|
-
})));
|
|
76
|
-
const sequenceRefName = typed.sequenceAdapterConfig
|
|
77
|
-
? await refNameFor(typed.sequenceAdapterConfig)
|
|
78
|
-
: undefined;
|
|
79
|
-
return super.serializeArguments({ ...args, sources, sequenceRefName }, rpcDriverClassName);
|
|
75
|
+
return { ...source, refName: regions[0].refName };
|
|
76
|
+
}));
|
|
77
|
+
return super.serializeArguments({ ...args, sources });
|
|
80
78
|
}
|
|
81
|
-
async execute(args
|
|
82
|
-
const {
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
refName: source.refName ?? region.refName,
|
|
86
|
-
|
|
79
|
+
async execute(args) {
|
|
80
|
+
const { pluginManager } = this;
|
|
81
|
+
const { sources, region, maxCells } = args;
|
|
82
|
+
const [perSource, sequence] = await Promise.all([
|
|
83
|
+
Promise.all(sources.map(source => fetchAll({ ...args, pluginManager, adapterConfig: source.adapterConfig }, { ...region, refName: source.refName ?? region.refName }))),
|
|
84
|
+
fetchReference(pluginManager, args),
|
|
85
|
+
]);
|
|
87
86
|
const features = [];
|
|
88
87
|
const sampleByIndex = [];
|
|
89
88
|
for (const [i, feats] of perSource.entries()) {
|
|
@@ -94,20 +93,6 @@ export default class TviewGetPlan extends RpcMethodType {
|
|
|
94
93
|
}
|
|
95
94
|
}
|
|
96
95
|
}
|
|
97
|
-
let sequence;
|
|
98
|
-
if (sequenceAdapterConfig) {
|
|
99
|
-
const seqFeats = await fetchAll(this.pluginManager, sessionId, sequenceAdapterConfig, { ...region, refName: sequenceRefName ?? region.refName });
|
|
100
|
-
const seq = seqFeats[0]?.get('seq');
|
|
101
|
-
const seqStart = seqFeats[0]?.get('start');
|
|
102
|
-
// the adapter may answer with a wider block than it was asked for
|
|
103
|
-
const sliced = seq !== undefined && seqStart !== undefined
|
|
104
|
-
? seq.slice(region.start - seqStart, region.end - seqStart)
|
|
105
|
-
: undefined;
|
|
106
|
-
// a short answer means the region runs off the end of the contig, and a
|
|
107
|
-
// reference row that stops early would misplace every column after it
|
|
108
|
-
sequence =
|
|
109
|
-
sliced?.length === region.end - region.start ? sliced : undefined;
|
|
110
|
-
}
|
|
111
96
|
const plan = planTviewMsa({
|
|
112
97
|
features,
|
|
113
98
|
refName: region.refName,
|
|
@@ -117,36 +102,27 @@ export default class TviewGetPlan extends RpcMethodType {
|
|
|
117
102
|
sampleOf: i => sampleByIndex[i],
|
|
118
103
|
});
|
|
119
104
|
const shared = {
|
|
120
|
-
rowCount: plan.reads.length,
|
|
121
105
|
columnCount: plan.layout.totalColumns,
|
|
122
106
|
cellCount: plan.cellCount,
|
|
123
|
-
|
|
124
|
-
|
|
107
|
+
rowData: planRowData(plan),
|
|
108
|
+
highlights: planHighlights(plan),
|
|
125
109
|
region: plan.region,
|
|
126
|
-
|
|
127
|
-
start: a.start,
|
|
128
|
-
end: a.end,
|
|
129
|
-
period: a.period,
|
|
130
|
-
unit: a.unit,
|
|
131
|
-
width: a.width,
|
|
132
|
-
copies: [...a.copiesByName.entries()],
|
|
133
|
-
lengths: [...a.lengthByName.entries()],
|
|
134
|
-
})),
|
|
135
|
-
subjectIndex: plan.subject
|
|
136
|
-
? plan.arrays.indexOf(plan.subject)
|
|
137
|
-
: undefined,
|
|
138
|
-
referenceName: plan.referenceName,
|
|
110
|
+
hasSubject: plan.subject !== undefined,
|
|
139
111
|
samples: plan.samples,
|
|
140
112
|
};
|
|
141
113
|
// the render is the expensive half and the only part bounded by rows x
|
|
142
114
|
// columns, so the size check happens before it rather than after
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
115
|
+
const rows = plan.cellCount > maxCells ? undefined : renderRows(plan);
|
|
116
|
+
const modifications = rows
|
|
117
|
+
? planModifications({ features, plan, rows })
|
|
118
|
+
: undefined;
|
|
119
|
+
return rows
|
|
120
|
+
? {
|
|
146
121
|
...shared,
|
|
147
|
-
msa:
|
|
148
|
-
|
|
149
|
-
}
|
|
122
|
+
msa: toFasta(plan, rows),
|
|
123
|
+
...(modifications ? { modifications } : {}),
|
|
124
|
+
}
|
|
125
|
+
: { ...shared, msa: '', tooLarge: true };
|
|
150
126
|
}
|
|
151
127
|
}
|
|
152
128
|
//# sourceMappingURL=TviewGetPlan.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TviewGetPlan.js","sourceRoot":"","sources":["../../../src/LaunchTView/TviewGetPlanRpc/TviewGetPlan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAA;AACzE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"TviewGetPlan.js","sourceRoot":"","sources":["../../../src/LaunchTView/TviewGetPlanRpc/TviewGetPlan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAA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AG;YACf,QAAQ;YACR,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;SAChC,CAAC,CAAA;QAEF,MAAM,MAAM,GAAG;YACb,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,YAAY;YACrC,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,OAAO,EAAE,WAAW,CAAC,IAAI,CAAC;YAC1B,UAAU,EAAE,cAAc,CAAC,IAAI,CAAC;YAChC,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,UAAU,EAAE,IAAI,CAAC,OAAO,KAAK,SAAS;YACtC,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAA;QAED,uEAAuE;QACvE,iEAAiE;QACjE,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;QACrE,MAAM,aAAa,GAAG,IAAI;YACxB,CAAC,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;YAC7C,CAAC,CAAC,SAAS,CAAA;QACb,OAAO,IAAI;YACT,CAAC,CAAC;gBACE,GAAG,MAAM;gBACT,GAAG,EAAE,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC;gBACxB,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC5C;YACH,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAA;IAC5C,CAAC;CACF"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function TviewGetPlanRpcF(pluginManager: PluginManager): void;
|
|
3
|
-
export type {
|
|
3
|
+
export type { TviewGetPlanArgs, TviewPlanResult, TviewSourceArgs, } from './TviewGetPlan';
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* There are two ways to do it, and which one applies is a property of the
|
|
9
9
|
* inserted sequence rather than a setting:
|
|
10
10
|
*
|
|
11
|
-
* - **Aperiodic** (`
|
|
12
|
-
* inserted sequence. Right for a novel insertion, a mobile element, anything
|
|
11
|
+
* - **Aperiodic** (`alignInsertionSite`): one center-star alignment over the
|
|
12
|
+
* whole inserted sequence. Right for a novel insertion, a mobile element, anything
|
|
13
13
|
* whose bases only make sense read straight through.
|
|
14
14
|
* - **Periodic** (`alignPeriodicInsertions`): a tandem array, where the whole
|
|
15
15
|
* inserted sequence is n copies of one unit. Aligning those base-to-base is
|
|
@@ -74,7 +74,7 @@ export interface PeriodicAlignment {
|
|
|
74
74
|
* as wide as the widest version of that copy across the site, so a sequence with
|
|
75
75
|
* fewer copies runs out of blocks rather than drifting out of register. Returns
|
|
76
76
|
* undefined when the site is not a tandem array, or is too big to lay out this
|
|
77
|
-
* way; the caller falls back to
|
|
77
|
+
* way; the caller falls back to the center-star alignment.
|
|
78
78
|
*
|
|
79
79
|
* **Blocks are array order, not homology.** Copies are anchored at the left edge
|
|
80
80
|
* of the insertion and counted rightward, so block k is "the kth copy along",
|
|
@@ -110,20 +110,14 @@ export interface InsertionAlignment {
|
|
|
110
110
|
periodic?: PeriodicAlignment;
|
|
111
111
|
}
|
|
112
112
|
/**
|
|
113
|
-
* Lay out the sequences inserted at one reference position,
|
|
114
|
-
* two alignments the sequence itself calls for. The
|
|
115
|
-
* is made, so a caller reading the period cannot
|
|
116
|
-
* gets.
|
|
113
|
+
* Lay out the sequences inserted at one reference position, one entry per
|
|
114
|
+
* read, by whichever of the two alignments the sequence itself calls for. The
|
|
115
|
+
* single place that decision is made, so a caller reading the period cannot
|
|
116
|
+
* disagree with the layout it gets.
|
|
117
117
|
*
|
|
118
|
-
* A tandem array goes unit-per-block, which is
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
* from a single distinct sequence, or the site is too large to be worth it.
|
|
118
|
+
* A tandem array goes unit-per-block, which is the readable answer however many
|
|
119
|
+
* copies it has. Everything else gets the center-star alignment, or is left
|
|
120
|
+
* alone (`gapped` empty) when there is nothing to gain from a single distinct
|
|
121
|
+
* sequence, or the alignments would cost more than the site's budget.
|
|
123
122
|
*/
|
|
124
123
|
export declare function alignInsertionSite(seqs: string[]): InsertionAlignment;
|
|
125
|
-
/**
|
|
126
|
-
* The gapped sequences alone, for callers with no use for the period. Every
|
|
127
|
-
* decision lives in `alignInsertionSite`.
|
|
128
|
-
*/
|
|
129
|
-
export declare function alignInsertions(seqs: string[]): Map<string, string>;
|