@jbrowse/plugin-linear-genome-view 5.0.0-beta.2 → 5.0.0-beta.20
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/esm/LinearGenomeView/afterAttach.d.ts +22 -5
- package/esm/LinearGenomeView/afterAttach.js +129 -106
- package/esm/LinearGenomeView/axisConfigSchema.d.ts +18 -0
- package/esm/LinearGenomeView/axisConfigSchema.js +22 -0
- package/esm/LinearGenomeView/components/CenterLine.js +10 -5
- package/esm/LinearGenomeView/components/ConnectedHoverHighlight.js +2 -3
- package/esm/LinearGenomeView/components/CrisprGuidePanel.js +3 -5
- package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +9 -4
- package/esm/LinearGenomeView/components/ExportSvgDialog.js +45 -8
- package/esm/LinearGenomeView/components/GetSequenceDialog.js +2 -2
- package/esm/LinearGenomeView/components/Header.js +11 -1
- package/esm/LinearGenomeView/components/HeaderClearHighlightButton.js +2 -2
- package/esm/LinearGenomeView/components/HeaderPanControls.d.ts +3 -3
- package/esm/LinearGenomeView/components/HeaderPanControls.js +6 -3
- package/esm/LinearGenomeView/components/HeaderSearchBoxes.js +4 -1
- package/esm/LinearGenomeView/components/HeaderZoomControls.js +6 -35
- package/esm/LinearGenomeView/components/Highlight.js +27 -11
- package/esm/LinearGenomeView/components/HighlightBand.d.ts +11 -2
- package/esm/LinearGenomeView/components/HighlightBand.js +32 -13
- package/esm/LinearGenomeView/components/HighlightChip.d.ts +3 -3
- package/esm/LinearGenomeView/components/HighlightChip.js +13 -8
- package/esm/LinearGenomeView/components/HighlightLabelDialog.d.ts +6 -0
- package/esm/LinearGenomeView/components/HighlightLabelDialog.js +18 -0
- package/esm/LinearGenomeView/components/HoverPositionHighlight.js +3 -3
- package/esm/LinearGenomeView/components/ImportForm.js +7 -9
- package/esm/LinearGenomeView/components/LinearGenomeView.js +5 -12
- package/esm/LinearGenomeView/components/LinearGenomeViewContainer.js +13 -14
- package/esm/LinearGenomeView/components/MiniControls.js +11 -5
- package/esm/LinearGenomeView/components/OverviewHighlight.js +3 -3
- package/esm/LinearGenomeView/components/OverviewHighlightBand.d.ts +3 -2
- package/esm/LinearGenomeView/components/OverviewHighlightBand.js +6 -5
- package/esm/LinearGenomeView/components/OverviewRubberband.js +25 -48
- package/esm/LinearGenomeView/components/OverviewScalebar.js +4 -5
- package/esm/LinearGenomeView/components/OverviewScalebarPolygon.js +5 -3
- package/esm/LinearGenomeView/components/PaddingBlocks.js +3 -8
- package/esm/LinearGenomeView/components/RangeSelectOverlay.js +5 -6
- package/esm/LinearGenomeView/components/RegionWidthEditorDialog.d.ts +3 -2
- package/esm/LinearGenomeView/components/RegionWidthEditorDialog.js +4 -4
- package/esm/LinearGenomeView/components/ResizeAllTracksHandle.d.ts +5 -0
- package/esm/LinearGenomeView/components/ResizeAllTracksHandle.js +74 -0
- package/esm/LinearGenomeView/components/Rubberband.d.ts +1 -2
- package/esm/LinearGenomeView/components/Rubberband.js +3 -2
- package/esm/LinearGenomeView/components/SVGHighlightBand.d.ts +10 -1
- package/esm/LinearGenomeView/components/SVGHighlightBand.js +16 -5
- package/esm/LinearGenomeView/components/Scalebar.d.ts +2 -6
- package/esm/LinearGenomeView/components/Scalebar.js +8 -5
- package/esm/LinearGenomeView/components/ScalebarRefNameLabels.js +51 -36
- package/esm/LinearGenomeView/components/SearchBox.js +10 -16
- package/esm/LinearGenomeView/components/SearchPanelForm.d.ts +3 -2
- package/esm/LinearGenomeView/components/SearchPanelForm.js +4 -2
- package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +4 -8
- package/esm/LinearGenomeView/components/SearchResultsDialog.js +7 -4
- package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +4 -7
- package/esm/LinearGenomeView/components/SearchResultsTable.js +25 -53
- package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.js +2 -3
- package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +2 -4
- package/esm/LinearGenomeView/components/StrandCheckboxes.d.ts +3 -2
- package/esm/LinearGenomeView/components/StrandCheckboxes.js +4 -2
- package/esm/LinearGenomeView/components/TrackContainer.d.ts +2 -3
- package/esm/LinearGenomeView/components/TrackContainer.js +63 -10
- package/esm/LinearGenomeView/components/TrackLabel.js +14 -4
- package/esm/LinearGenomeView/components/TrackLabelButtons.js +2 -2
- package/esm/LinearGenomeView/components/TrackLabelDragHandle.js +4 -5
- package/esm/LinearGenomeView/components/TrackLabelMenu.js +11 -14
- package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.d.ts +3 -4
- package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.js +23 -10
- package/esm/LinearGenomeView/components/TrackRenderingContainer.d.ts +6 -4
- package/esm/LinearGenomeView/components/TrackRenderingContainer.js +12 -24
- package/esm/LinearGenomeView/components/TracksContainer.js +11 -23
- package/esm/LinearGenomeView/components/VerticalGuide.d.ts +1 -2
- package/esm/LinearGenomeView/components/VerticalGuide.js +3 -16
- package/esm/LinearGenomeView/components/fetchSequence.d.ts +1 -2
- package/esm/LinearGenomeView/components/fetchSequence.js +15 -7
- package/esm/LinearGenomeView/components/recentLocationsMenu.js +10 -0
- package/esm/LinearGenomeView/components/useRangeSelect.d.ts +0 -3
- package/esm/LinearGenomeView/components/useRangeSelect.js +26 -61
- package/esm/LinearGenomeView/components/useSearchBoxPrefs.d.ts +3 -1
- package/esm/LinearGenomeView/components/useSearchBoxPrefs.js +4 -2
- package/esm/LinearGenomeView/components/useSideScroll.d.ts +17 -2
- package/esm/LinearGenomeView/components/useSideScroll.js +156 -102
- package/esm/LinearGenomeView/components/util.d.ts +4 -0
- package/esm/LinearGenomeView/components/util.js +4 -2
- package/esm/LinearGenomeView/consts.d.ts +2 -0
- package/esm/LinearGenomeView/consts.js +3 -1
- package/esm/LinearGenomeView/containingLgv.d.ts +21 -0
- package/esm/LinearGenomeView/containingLgv.js +23 -0
- package/esm/LinearGenomeView/headerFit.d.ts +4 -2
- package/esm/LinearGenomeView/headerFit.js +20 -7
- package/esm/LinearGenomeView/index.d.ts +2 -7
- package/esm/LinearGenomeView/index.js +5 -7
- package/esm/LinearGenomeView/keyboardHandler.d.ts +8 -7
- package/esm/LinearGenomeView/keyboardHandler.js +61 -23
- package/esm/LinearGenomeView/launchKeys.d.ts +1 -1
- package/esm/LinearGenomeView/launchKeys.js +11 -6
- package/esm/LinearGenomeView/lazyDialogs.d.ts +16 -3
- package/esm/LinearGenomeView/lazyDialogs.js +1 -0
- package/esm/LinearGenomeView/linkedViewSync.d.ts +3 -11
- package/esm/LinearGenomeView/linkedViewSync.js +27 -49
- package/esm/LinearGenomeView/menuItems.d.ts +16 -18
- package/esm/LinearGenomeView/menuItems.js +264 -164
- package/esm/LinearGenomeView/model.d.ts +1192 -560
- package/esm/LinearGenomeView/model.js +805 -590
- package/esm/LinearGenomeView/rExport/exportLinearView.d.ts +17 -0
- package/esm/LinearGenomeView/rExport/exportLinearView.js +117 -0
- package/esm/LinearGenomeView/rExport/rScript.d.ts +110 -0
- package/esm/LinearGenomeView/rExport/rScript.js +524 -0
- package/esm/LinearGenomeView/sharedScaleContainer.d.ts +1 -1
- package/esm/LinearGenomeView/sharedScaleContainer.js +2 -12
- package/esm/LinearGenomeView/showFiles.d.ts +2 -0
- package/esm/LinearGenomeView/showFiles.js +19 -0
- package/esm/LinearGenomeView/showRegionsWithUndo.d.ts +1 -1
- package/esm/LinearGenomeView/showRegionsWithUndo.js +13 -5
- package/esm/LinearGenomeView/stickyChrome.d.ts +5 -9
- package/esm/LinearGenomeView/stickyChrome.js +5 -9
- package/esm/LinearGenomeView/svgcomponents/SVGGridlines.js +4 -4
- package/esm/LinearGenomeView/svgcomponents/SVGHeader.d.ts +4 -1
- package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +8 -21
- package/esm/LinearGenomeView/svgcomponents/SVGHighlights.d.ts +3 -1
- package/esm/LinearGenomeView/svgcomponents/SVGHighlights.js +9 -9
- package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.d.ts +3 -1
- package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.js +5 -5
- package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +13 -18
- package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.js +2 -5
- package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.js +5 -6
- package/esm/LinearGenomeView/svgcomponents/SVGRuler.js +9 -10
- package/esm/LinearGenomeView/svgcomponents/SVGScalebar.js +3 -3
- package/esm/LinearGenomeView/svgcomponents/SVGStackedRow.d.ts +26 -0
- package/esm/LinearGenomeView/svgcomponents/SVGStackedRow.js +12 -0
- package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js +21 -13
- package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +4 -5
- package/esm/LinearGenomeView/svgcomponents/SVGTracks.js +7 -6
- package/esm/LinearGenomeView/svgcomponents/SVGView.d.ts +2 -3
- package/esm/LinearGenomeView/svgcomponents/SVGView.js +17 -3
- package/esm/LinearGenomeView/svgcomponents/renderViewTracks.d.ts +24 -20
- package/esm/LinearGenomeView/svgcomponents/renderViewTracks.js +42 -29
- package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.js +74 -77
- package/esm/LinearGenomeView/svgcomponents/util.d.ts +28 -12
- package/esm/LinearGenomeView/svgcomponents/util.js +41 -29
- package/esm/LinearGenomeView/types.d.ts +13 -10
- package/esm/LinearGenomeView/types.js +0 -1
- package/esm/LinearGenomeView/util.d.ts +103 -46
- package/esm/LinearGenomeView/util.js +222 -170
- package/esm/MultiLevelRubberband/MultiLevelRubberband.js +9 -6
- package/esm/MultiLevelRubberband/index.d.ts +2 -0
- package/esm/MultiLevelRubberband/index.js +2 -0
- package/esm/MultiLevelRubberband/menuItems.d.ts +34 -0
- package/esm/MultiLevelRubberband/menuItems.js +52 -0
- package/esm/MultiLevelRubberband/rowLabel.d.ts +22 -0
- package/esm/MultiLevelRubberband/rowLabel.js +27 -0
- package/esm/MultiLevelRubberband/types.d.ts +1 -0
- package/esm/MultiLevelRubberband/useRangeSelect.d.ts +2 -1
- package/esm/MultiLevelRubberband/useRangeSelect.js +45 -59
- package/esm/TrackModifiers/index.d.ts +83 -0
- package/esm/TrackModifiers/index.js +231 -0
- package/esm/displayKitTests/perRegionTestEnv.d.ts +244 -68
- package/esm/displayKitTests/perRegionTestEnv.js +30 -26
- package/esm/index.d.ts +21 -99
- package/esm/index.js +17 -38
- package/esm/searchUtils.d.ts +26 -10
- package/esm/searchUtils.js +137 -137
- package/esm/shared/RubberbandSpan.d.ts +3 -2
- package/esm/shared/RubberbandSpan.js +6 -3
- package/esm/shared/coordLabels.d.ts +11 -4
- package/esm/shared/coordLabels.js +20 -5
- package/esm/shared/useWindowDrag.d.ts +18 -0
- package/esm/shared/useWindowDrag.js +47 -0
- package/package.json +12 -11
- package/esm/FeatureTrack/configSchema.d.ts +0 -124
- package/esm/FeatureTrack/configSchema.js +0 -54
- package/esm/FeatureTrack/index.d.ts +0 -2
- package/esm/FeatureTrack/index.js +0 -13
- package/esm/LinearGenomeView/initKeys.d.ts +0 -12
- package/esm/LinearGenomeView/initKeys.js +0 -68
- package/esm/MultiLevelRubberband/VerticalGuide.d.ts +0 -6
- package/esm/MultiLevelRubberband/VerticalGuide.js +0 -21
- package/esm/lazyPluginExports.d.ts +0 -23
- package/esm/lazyPluginExports.js +0 -36
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { LinearGenomeViewModel } from '../model.ts';
|
|
2
|
+
export declare function recordsDrawnAlone(display: object): {
|
|
3
|
+
height: number;
|
|
4
|
+
fits: boolean;
|
|
5
|
+
} | undefined;
|
|
6
|
+
/** The R script that redraws the tracks open in the view, over its visible regions. */
|
|
7
|
+
export declare function exportLinearViewToR(view: LinearGenomeViewModel, out?: string): {
|
|
8
|
+
drawn: number;
|
|
9
|
+
script: undefined;
|
|
10
|
+
notes: string[];
|
|
11
|
+
} | {
|
|
12
|
+
drawn: number;
|
|
13
|
+
script: string;
|
|
14
|
+
notes: string[];
|
|
15
|
+
};
|
|
16
|
+
/** Downloads the view's R script, telling the user what it leaves out. */
|
|
17
|
+
export declare function downloadRScript(view: LinearGenomeViewModel): Promise<void>;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { fullConfSnapshot, readConfObject } from '@jbrowse/core/configuration';
|
|
2
|
+
import { svgTrackName } from '@jbrowse/core/svg/trackNames';
|
|
3
|
+
import { getSession } from '@jbrowse/core/util';
|
|
4
|
+
import { getSnapshot } from '@jbrowse/mobx-state-tree';
|
|
5
|
+
import { exportTracksToR } from './rScript.js';
|
|
6
|
+
/** The regions on screen, each displayed region cut to what the view shows of it. */
|
|
7
|
+
function viewRegions(view) {
|
|
8
|
+
const blocks = view.dynamicBlocks.contentBlocks;
|
|
9
|
+
if (blocks.length === 0) {
|
|
10
|
+
return view.displayedRegions.map(r => ({
|
|
11
|
+
refName: r.refName,
|
|
12
|
+
start: Math.floor(r.start),
|
|
13
|
+
end: Math.ceil(r.end),
|
|
14
|
+
}));
|
|
15
|
+
}
|
|
16
|
+
const byRegion = new Map();
|
|
17
|
+
for (const block of blocks) {
|
|
18
|
+
const key = block.displayedRegionIndex ?? -1;
|
|
19
|
+
const held = byRegion.get(key);
|
|
20
|
+
if (held?.refName === block.refName) {
|
|
21
|
+
held.start = Math.min(held.start, Math.floor(block.start));
|
|
22
|
+
held.end = Math.max(held.end, Math.ceil(block.end));
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
byRegion.set(key, {
|
|
26
|
+
refName: block.refName,
|
|
27
|
+
start: Math.floor(block.start),
|
|
28
|
+
end: Math.ceil(block.end),
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return [...byRegion.values()];
|
|
33
|
+
}
|
|
34
|
+
/** The view's assembly config as written. */
|
|
35
|
+
function assemblyOf(view) {
|
|
36
|
+
const name = view.assemblyNames[0];
|
|
37
|
+
const configuration = name
|
|
38
|
+
? getSession(view).assemblyManager.get(name)?.configuration
|
|
39
|
+
: undefined;
|
|
40
|
+
return configuration
|
|
41
|
+
? getSnapshot(configuration)
|
|
42
|
+
: undefined;
|
|
43
|
+
}
|
|
44
|
+
// The variant display drawing no genotype rows (none in the file, or hidden)
|
|
45
|
+
// states, as `recordsAlone`, its records as the feature track R reads them
|
|
46
|
+
// as: the height they draw at, and whether they fit into it whatever the
|
|
47
|
+
// track's `heightMode`.
|
|
48
|
+
export function recordsDrawnAlone(display) {
|
|
49
|
+
const alone = 'recordsAlone' in display ? display.recordsAlone : undefined;
|
|
50
|
+
return typeof alone === 'object' &&
|
|
51
|
+
alone !== null &&
|
|
52
|
+
'height' in alone &&
|
|
53
|
+
typeof alone.height === 'number' &&
|
|
54
|
+
'fits' in alone &&
|
|
55
|
+
typeof alone.fits === 'boolean'
|
|
56
|
+
? { height: alone.height, fits: alone.fits }
|
|
57
|
+
: undefined;
|
|
58
|
+
}
|
|
59
|
+
// The tracks the screen draws, in the order it draws them, named as the SVG
|
|
60
|
+
// export names them: pinned first, minimized ones left out.
|
|
61
|
+
function tracksOf(view) {
|
|
62
|
+
const session = getSession(view);
|
|
63
|
+
const tracks = [];
|
|
64
|
+
for (const track of [...view.pinnedTracks, ...view.unpinnedTracks]) {
|
|
65
|
+
const display = track.displays[0];
|
|
66
|
+
if (display && !track.minimized) {
|
|
67
|
+
const { type, displayId, ...written } = getSnapshot(display.configuration);
|
|
68
|
+
const { heightMode, height } = fullConfSnapshot(display.configuration);
|
|
69
|
+
const records = recordsDrawnAlone(display);
|
|
70
|
+
tracks.push({
|
|
71
|
+
trackId: track.configuration.trackId,
|
|
72
|
+
trackName: svgTrackName(track, session),
|
|
73
|
+
displayType: display.type,
|
|
74
|
+
adapter: readConfObject(track.configuration, 'adapter'),
|
|
75
|
+
display: written,
|
|
76
|
+
heightMode: records?.fits ? 'fit' : heightMode,
|
|
77
|
+
height: records ? records.height : height,
|
|
78
|
+
recordsOnly: records !== undefined,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return tracks;
|
|
83
|
+
}
|
|
84
|
+
/** The R script that redraws the tracks open in the view, over its visible regions. */
|
|
85
|
+
export function exportLinearViewToR(view, out) {
|
|
86
|
+
return exportTracksToR({
|
|
87
|
+
tracks: tracksOf(view),
|
|
88
|
+
regions: viewRegions(view),
|
|
89
|
+
assembly: assemblyOf(view),
|
|
90
|
+
bpPerPx: view.bpPerPx,
|
|
91
|
+
colorByFrame: view.colorByFrame,
|
|
92
|
+
showAminoAcids: view.showAminoAcids,
|
|
93
|
+
out,
|
|
94
|
+
notes: view.displayedRegions.some(r => r.reversed)
|
|
95
|
+
? ['view: shown right to left, where the figure runs left to right']
|
|
96
|
+
: [],
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
/** Downloads the view's R script, telling the user what it leaves out. */
|
|
100
|
+
export async function downloadRScript(view) {
|
|
101
|
+
const session = getSession(view);
|
|
102
|
+
try {
|
|
103
|
+
const { saveAs } = await import('@jbrowse/core/util/FileSaver');
|
|
104
|
+
const { script, notes } = exportLinearViewToR(view);
|
|
105
|
+
if (!script) {
|
|
106
|
+
session.notify(`No open track has an R export. ${notes.join('; ')}`, 'warning');
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
saveAs(new Blob([script], { type: 'text/plain;charset=utf-8' }), 'jbrowse_view.R');
|
|
110
|
+
if (notes.length) {
|
|
111
|
+
session.notify(`Exported with ${notes.length} note${notes.length === 1 ? '' : 's'} in the script header`, 'info');
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
catch (e) {
|
|
115
|
+
session.notifyError(`${e}`, e);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/** A view's region, 0-based half-open, on the assembly's canonical contig. */
|
|
2
|
+
export interface Region {
|
|
3
|
+
refName: string;
|
|
4
|
+
start: number;
|
|
5
|
+
end: number;
|
|
6
|
+
}
|
|
7
|
+
export interface RExportTrack {
|
|
8
|
+
trackId: string;
|
|
9
|
+
trackName: string;
|
|
10
|
+
displayType: string;
|
|
11
|
+
adapter: Record<string, unknown>;
|
|
12
|
+
/** The display's config as written, its defaults left out, which the engine fills from the same schema. */
|
|
13
|
+
display: Record<string, unknown>;
|
|
14
|
+
/** The display's resolved sizing, which a feature track exports so the figure drops what the view drops. */
|
|
15
|
+
heightMode?: unknown;
|
|
16
|
+
height?: unknown;
|
|
17
|
+
/** A variant display drawing its records alone, its genotype rows absent or hidden, which reads as a feature track. */
|
|
18
|
+
recordsOnly?: boolean;
|
|
19
|
+
}
|
|
20
|
+
interface ReaderAdapter {
|
|
21
|
+
slot?: string;
|
|
22
|
+
ext?: RegExp;
|
|
23
|
+
index?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Each display ggjbrowse reads, by the reader that reads it, and the adapters
|
|
27
|
+
* it opens: the slot holding the file, the extension the reader knows it by,
|
|
28
|
+
* and the suffix of the index the reader looks for beside it.
|
|
29
|
+
*/
|
|
30
|
+
export declare const READERS: Record<string, {
|
|
31
|
+
call: string;
|
|
32
|
+
/** The reader for the display drawing no sample rows, its records alone. */
|
|
33
|
+
recordsOnlyCall?: string;
|
|
34
|
+
adapters: Record<string, ReaderAdapter>;
|
|
35
|
+
}>;
|
|
36
|
+
/**
|
|
37
|
+
* The ggjbrowse release the script is tested against: its floor, and the tag
|
|
38
|
+
* its install line pins. The R export workflow installs this tag on a push.
|
|
39
|
+
*/
|
|
40
|
+
export declare const GGJBROWSE_VERSION = "0.11.0";
|
|
41
|
+
/**
|
|
42
|
+
* A resolved config writes an unset slot as `''`, `[]` or `{}`, which a reader
|
|
43
|
+
* would take for a setting. Keeps `false` and `0`, which are values.
|
|
44
|
+
*/
|
|
45
|
+
export declare function withoutUnset(value: unknown): unknown;
|
|
46
|
+
export declare function rStr(s: string): string;
|
|
47
|
+
/**
|
|
48
|
+
* A config value as the R literal ggjbrowse hands the engine: a `list` per
|
|
49
|
+
* object, `c()` per vector of scalars, `list()` per vector of objects and per
|
|
50
|
+
* empty vector, which jsonlite would otherwise write as `{}`.
|
|
51
|
+
*/
|
|
52
|
+
export declare function rValue(value: unknown): string;
|
|
53
|
+
/**
|
|
54
|
+
* The path or URL a JBrowse file location points at, as R opens it: a `uri`
|
|
55
|
+
* resolved against its `baseUri` as the browser's fetch resolved it, a
|
|
56
|
+
* `file://` URL as its path, or a `localPath`.
|
|
57
|
+
*/
|
|
58
|
+
export declare function locationPath(location: unknown): string | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Each sequence adapter `jbrowse_assembly()` builds from a path, by the
|
|
61
|
+
* extension ggjbrowse reads it off, and the index each takes beside it.
|
|
62
|
+
*/
|
|
63
|
+
export declare const SEQUENCE_ADAPTERS: Record<string, {
|
|
64
|
+
slot: string;
|
|
65
|
+
ext: RegExp;
|
|
66
|
+
beside: Record<string, string>;
|
|
67
|
+
}>;
|
|
68
|
+
/**
|
|
69
|
+
* The view's assembly as the R value every reader takes: `jbrowse_assembly()`
|
|
70
|
+
* of its sequence and alias files where ggjbrowse builds the same config from
|
|
71
|
+
* their paths, and otherwise the config itself, its locations paths R opens.
|
|
72
|
+
*/
|
|
73
|
+
export declare function assemblyArgument(snapshot: Record<string, unknown>): {
|
|
74
|
+
value: string;
|
|
75
|
+
} | {
|
|
76
|
+
skipped: string;
|
|
77
|
+
};
|
|
78
|
+
/** A region as JBrowse's location box writes it, 1-based and inclusive. */
|
|
79
|
+
export declare function locusOf(refName: string, start: number, end: number): string;
|
|
80
|
+
/**
|
|
81
|
+
* One R script for a view's tracks over its regions: a ggjbrowse reader per
|
|
82
|
+
* track, reading each as its display does, then `jbrowse_stack()` drawing
|
|
83
|
+
* them as the view stacks them. A track ggjbrowse cannot read lands in the
|
|
84
|
+
* header instead of stopping the figure: a script that quietly differs from
|
|
85
|
+
* its view says so.
|
|
86
|
+
*/
|
|
87
|
+
export declare function exportTracksToR({ tracks, regions, assembly: assemblySnapshot, bpPerPx, colorByFrame, showAminoAcids, out, notes: viewNotes, }: {
|
|
88
|
+
tracks: readonly RExportTrack[];
|
|
89
|
+
regions: readonly Region[];
|
|
90
|
+
/** The view's assembly config as written, which names its sequence and its contigs' aliases. */
|
|
91
|
+
assembly?: Record<string, unknown>;
|
|
92
|
+
/** The view's zoom, which decides what a feature or quantitative display shows. */
|
|
93
|
+
bpPerPx: number;
|
|
94
|
+
/** The view's "CDS reading frame colors", which a feature track takes. */
|
|
95
|
+
colorByFrame?: boolean;
|
|
96
|
+
/** The view's "Amino acids when zoomed in", which a feature track takes. */
|
|
97
|
+
showAminoAcids?: boolean;
|
|
98
|
+
out?: string;
|
|
99
|
+
/** What the caller knows of the view that the figure does not show. */
|
|
100
|
+
notes?: readonly string[];
|
|
101
|
+
}): {
|
|
102
|
+
drawn: number;
|
|
103
|
+
script: undefined;
|
|
104
|
+
notes: string[];
|
|
105
|
+
} | {
|
|
106
|
+
drawn: number;
|
|
107
|
+
script: string;
|
|
108
|
+
notes: string[];
|
|
109
|
+
};
|
|
110
|
+
export {};
|