Skip to content

Commit

Permalink
Add text searching
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Dec 16, 2022
1 parent df39d9c commit 20da5a8
Show file tree
Hide file tree
Showing 15 changed files with 127 additions and 131 deletions.
22 changes: 22 additions & 0 deletions embedded_demos/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# JBrowse 2 embedded demos

## Linear genome view demo

This demo shows a variety of tracks on hg38

The text searching index created by running `jbrowse text-index` on the specific
gene track file. This uses the --fileId to say what the trackId is of the file
we are indexing with --file

```bash
## create index
jbrowse text-index --file https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/ncbi_refseq/GCA_000001405.15_GRCh38_full_analysis_set.refseq_annotation.sorted.gff.gz --fileId genes

## upload to aws
aws s3 sync trix s3://jbrowse.org/genomes/GRCh38/ncbi_refseq/trix --delete

```

## Circular genome view demo

This demo shows translocations SVs
10 changes: 0 additions & 10 deletions embedded_demos/base/linear/assembly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ const assembly = {
uri: 'https://jbrowse.org/genomes/GRCh38/fasta/hg38.prefix.fa.gz.gzi',
},
},
displays: [
{
type: 'LinearReferenceSequenceDisplay',
displayId:
'GRCh38-ReferenceSequenceTrack-LinearReferenceSequenceDisplay',
renderer: {
type: 'DivSequenceRenderer',
},
},
],
},
refNameAliases: {
adapter: {
Expand Down
19 changes: 17 additions & 2 deletions embedded_demos/base/linear/tracks.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
const tracks = [
{
type: 'FeatureTrack',
trackId:
'GCA_000001405.15_GRCh38_full_analysis_set.refseq_annotation.sorted.gff',
trackId: 'genes',
name: 'NCBI RefSeq Genes',
assemblyNames: ['GRCh38'],
category: ['Genes'],
Expand All @@ -17,6 +16,22 @@ const tracks = [
},
},
},
textSearching: {
textSearchAdapter: {
type: 'TrixTextSearchAdapter',
textSearchAdapterId: 'gff3tabix_genes-index',
ixFilePath: {
uri: 'https://jbrowse.org/genomes/GRCh38/ncbi_refseq/trix/GCA_000001405.15_GRCh38_full_analysis_set.refseq_annotation.sorted.gff.gz.ix',
},
ixxFilePath: {
uri: 'https://jbrowse.org/genomes/GRCh38/ncbi_refseq/trix/GCA_000001405.15_GRCh38_full_analysis_set.refseq_annotation.sorted.gff.gz.ixx',
},
metaFilePath: {
uri: 'https://jbrowse.org/genomes/GRCh38/ncbi_refseq/trix/GCA_000001405.15_GRCh38_full_analysis_set.refseq_annotation.sorted.gff.gz_meta.json',
},
assemblyNames: ['GRCh38'],
},
},
},
{
type: 'FeatureTrack',
Expand Down
2 changes: 2 additions & 0 deletions embedded_demos/build_demos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
for i in jbrowse*; do cd $i; yarn; yarn build; cd -; done;
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ const assembly = {
uri: 'https://jbrowse.org/genomes/GRCh38/fasta/hg38.prefix.fa.gz.gzi',
},
},
displays: [
{
type: 'LinearReferenceSequenceDisplay',
displayId:
'GRCh38-ReferenceSequenceTrack-LinearReferenceSequenceDisplay',
renderer: {
type: 'DivSequenceRenderer',
},
},
],
},
refNameAliases: {
adapter: {
Expand Down
18 changes: 16 additions & 2 deletions embedded_demos/jbrowse-react-linear-genome-view-cra5/src/tracks.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
const tracks = [
{
type: 'FeatureTrack',
trackId:
'GCA_000001405.15_GRCh38_full_analysis_set.refseq_annotation.sorted.gff',
trackId: 'genes',
name: 'NCBI RefSeq Genes',
assemblyNames: ['GRCh38'],
category: ['Genes'],
Expand All @@ -17,6 +16,21 @@ const tracks = [
},
},
},
textSearching: {
textSearchAdapter: {
type: 'TrixTextSearchAdapter',
textSearchAdapterId: 'gff3tabix_genes-index',
ixFilePath: {
uri: 'https://jbrowse.org/genomes/GRCh38/ncbi_refseq/trix/GCA_000001405.15_GRCh38_full_analysis_set.refseq_annotation.sorted.gff.gz.ix',
},
ixxFilePath: {
uri: 'https://jbrowse.org/genomes/GRCh38/ncbi_refseq/trix/GCA_000001405.15_GRCh38_full_analysis_set.refseq_annotation.sorted.gff.gz.ixx',
},
metaFilePath: {
uri: 'https://jbrowse.org/genomes/GRCh38/ncbi_refseq/trix/GCA_000001405.15_GRCh38_full_analysis_set.refseq_annotation.sorted.gff.gz_meta.json',
},
},
},
},
{
type: 'FeatureTrack',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ const assembly = {
uri: 'https://jbrowse.org/genomes/GRCh38/fasta/hg38.prefix.fa.gz.gzi',
},
},
displays: [
{
type: 'LinearReferenceSequenceDisplay',
displayId:
'GRCh38-ReferenceSequenceTrack-LinearReferenceSequenceDisplay',
renderer: {
type: 'DivSequenceRenderer',
},
},
],
},
refNameAliases: {
adapter: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
const tracks = [
{
type: 'FeatureTrack',
trackId:
'GCA_000001405.15_GRCh38_full_analysis_set.refseq_annotation.sorted.gff',
trackId: 'genes',
name: 'NCBI RefSeq Genes',
assemblyNames: ['GRCh38'],
category: ['Genes'],
Expand All @@ -17,6 +16,21 @@ const tracks = [
},
},
},
textSearching: {
textSearchAdapter: {
type: 'TrixTextSearchAdapter',
textSearchAdapterId: 'gff3tabix_genes-index',
ixFilePath: {
uri: 'https://jbrowse.org/genomes/GRCh38/ncbi_refseq/trix/GCA_000001405.15_GRCh38_full_analysis_set.refseq_annotation.sorted.gff.gz.ix',
},
ixxFilePath: {
uri: 'https://jbrowse.org/genomes/GRCh38/ncbi_refseq/trix/GCA_000001405.15_GRCh38_full_analysis_set.refseq_annotation.sorted.gff.gz.ixx',
},
metaFilePath: {
uri: 'https://jbrowse.org/genomes/GRCh38/ncbi_refseq/trix/GCA_000001405.15_GRCh38_full_analysis_set.refseq_annotation.sorted.gff.gz_meta.json',
},
},
},
},
{
type: 'FeatureTrack',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ const assembly = {
uri: 'https://jbrowse.org/genomes/GRCh38/fasta/hg38.prefix.fa.gz.gzi',
},
},
displays: [
{
type: 'LinearReferenceSequenceDisplay',
displayId:
'GRCh38-ReferenceSequenceTrack-LinearReferenceSequenceDisplay',
renderer: {
type: 'DivSequenceRenderer',
},
},
],
},
refNameAliases: {
adapter: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
const tracks = [
{
type: 'FeatureTrack',
trackId:
'GCA_000001405.15_GRCh38_full_analysis_set.refseq_annotation.sorted.gff',
trackId: 'genes',
name: 'NCBI RefSeq Genes',
assemblyNames: ['GRCh38'],
category: ['Genes'],
Expand All @@ -17,6 +16,21 @@ const tracks = [
},
},
},
textSearching: {
textSearchAdapter: {
type: 'TrixTextSearchAdapter',
textSearchAdapterId: 'gff3tabix_genes-index',
ixFilePath: {
uri: 'https://jbrowse.org/genomes/GRCh38/ncbi_refseq/trix/GCA_000001405.15_GRCh38_full_analysis_set.refseq_annotation.sorted.gff.gz.ix',
},
ixxFilePath: {
uri: 'https://jbrowse.org/genomes/GRCh38/ncbi_refseq/trix/GCA_000001405.15_GRCh38_full_analysis_set.refseq_annotation.sorted.gff.gz.ixx',
},
metaFilePath: {
uri: 'https://jbrowse.org/genomes/GRCh38/ncbi_refseq/trix/GCA_000001405.15_GRCh38_full_analysis_set.refseq_annotation.sorted.gff.gz_meta.json',
},
},
},
},
{
type: 'FeatureTrack',
Expand Down
64 changes: 5 additions & 59 deletions embedded_demos/jbrowse-react-linear-genome-view-vite/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,64 +8,6 @@ import {
import assembly from './assembly'
import tracks from './tracks'

const defaultSession = {
name: 'this session',
view: {
id: 'linearGenomeView',
type: 'LinearGenomeView',
tracks: [
{
id: '7PWx6ki1_',
type: 'ReferenceSequenceTrack',
configuration: 'GRCh38-ReferenceSequenceTrack',
displays: [
{
id: 'pa_7lx6FDh',
type: 'LinearReferenceSequenceDisplay',
height: 210,
configuration:
'GRCh38-ReferenceSequenceTrack-LinearReferenceSequenceDisplay',
},
],
},
{
id: 'KHwe41KXk',
type: 'AlignmentsTrack',
configuration: 'NA12878.alt_bwamem_GRCh38DH.20150826.CEU.exome',
displays: [
{
id: '_-kwYVczT8',
type: 'LinearAlignmentsDisplay',
PileupDisplay: {
id: '1HTk32IDZJ',
type: 'LinearPileupDisplay',
height: 100,
configuration: {
type: 'LinearPileupDisplay',
displayId:
'NA12878.alt_bwamem_GRCh38DH.20150826.CEU.exome-LinearAlignmentsDisplay_pileup_xyz',
},
},
SNPCoverageDisplay: {
id: 'ZBXRXmuDrc',
type: 'LinearSNPCoverageDisplay',
height: 45,
configuration: {
type: 'LinearSNPCoverageDisplay',
displayId:
'NA12878.alt_bwamem_GRCh38DH.20150826.CEU.exome-LinearAlignmentsDisplay_snpcoverage_xyz',
},
},
configuration:
'NA12878.alt_bwamem_GRCh38DH.20150826.CEU.exome-LinearAlignmentsDisplay',
height: 250,
},
],
},
],
},
}

function View() {
const [viewState, setViewState] =
useState<ReturnType<typeof createViewState>>()
Expand All @@ -80,8 +22,12 @@ function View() {
onChange: patch => {
setPatches(previous => previous + JSON.stringify(patch) + '\n')
},
defaultSession,
})
state.session.view.showTrack('GRCh38-ReferenceSequenceTrack')
state.session.view.showTrack('genes')
state.session.view.showTrack(
'NA12878.alt_bwamem_GRCh38DH.20150826.CEU.exome',
)
setViewState(state)
}, [])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ const assembly = {
uri: 'https://jbrowse.org/genomes/GRCh38/fasta/hg38.prefix.fa.gz.gzi',
},
},
displays: [
{
type: 'LinearReferenceSequenceDisplay',
displayId:
'GRCh38-ReferenceSequenceTrack-LinearReferenceSequenceDisplay',
renderer: {
type: 'DivSequenceRenderer',
},
},
],
},
refNameAliases: {
adapter: {
Expand Down
19 changes: 17 additions & 2 deletions embedded_demos/jbrowse-react-linear-genome-view-vite/src/tracks.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
const tracks = [
{
type: 'FeatureTrack',
trackId:
'GCA_000001405.15_GRCh38_full_analysis_set.refseq_annotation.sorted.gff',
trackId: 'genes',
name: 'NCBI RefSeq Genes',
assemblyNames: ['GRCh38'],
category: ['Genes'],
Expand All @@ -17,6 +16,22 @@ const tracks = [
},
},
},
textSearching: {
textSearchAdapter: {
type: 'TrixTextSearchAdapter',
textSearchAdapterId: 'gff3tabix_genes-index',
ixFilePath: {
uri: 'https://jbrowse.org/genomes/GRCh38/ncbi_refseq/trix/GCA_000001405.15_GRCh38_full_analysis_set.refseq_annotation.sorted.gff.gz.ix',
},
ixxFilePath: {
uri: 'https://jbrowse.org/genomes/GRCh38/ncbi_refseq/trix/GCA_000001405.15_GRCh38_full_analysis_set.refseq_annotation.sorted.gff.gz.ixx',
},
metaFilePath: {
uri: 'https://jbrowse.org/genomes/GRCh38/ncbi_refseq/trix/GCA_000001405.15_GRCh38_full_analysis_set.refseq_annotation.sorted.gff.gz_meta.json',
},
assemblyNames: ['GRCh38'],
},
},
},
{
type: 'FeatureTrack',
Expand Down
10 changes: 0 additions & 10 deletions embedded_demos/jbrowse-react-linear-genome-view/src/assembly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ const assembly = {
uri: 'https://jbrowse.org/genomes/GRCh38/fasta/hg38.prefix.fa.gz.gzi',
},
},
displays: [
{
type: 'LinearReferenceSequenceDisplay',
displayId:
'GRCh38-ReferenceSequenceTrack-LinearReferenceSequenceDisplay',
renderer: {
type: 'DivSequenceRenderer',
},
},
],
},
refNameAliases: {
adapter: {
Expand Down
Loading

0 comments on commit 20da5a8

Please sign in to comment.