Integrating react-linear-genome-view in a vue app ( based on Nuxt.js ) #4509
-
Hello the JBrowse team :)
And the second option seems to be the best one because i would need for example that my vue states can refresh the genome viewer states and this would be impossible with a jbrowse instance So in order to do that i've setup my project and added Here is the error i'm facing : You're genome viewer is using Here is my jsx component : import React from 'react';
import { createViewState, JBrowseLinearGenomeView } from '@jbrowse/react-linear-genome-view';
const JBrowseComponent = ({ config }) => {
const state = createViewState(config);
return <JBrowseLinearGenomeView viewState={state} />;
};
export default JBrowseComponent; And here is my vue wrapper component around the react one : <template>
<div>
<JBrowseReactInVueComponent :config="jbrowseConfig" />
</div>
</template>
<script setup>
import { ref } from 'vue'
import { applyReactInVue } from 'veaury'
import JBrowseComponent from '~/components/JBrowseComponent.jsx'
const JBrowseReactInVueComponent = applyReactInVue(JBrowseComponent)
const jbrowseConfig = ref({
assembly: {
name: 'GRCh38',
sequence: {
type: 'ReferenceSequenceTrack',
trackId: 'GRCh38-ReferenceSequenceTrack',
adapter: {
type: 'BgzipFastaAdapter',
fastaLocation: {
uri: 'https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/fasta/GRCh38.fa.gz',
locationType: 'UriLocation',
},
faiLocation: {
uri: 'https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/fasta/GRCh38.fa.gz.fai',
locationType: 'UriLocation',
},
gziLocation: {
uri: 'https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/fasta/GRCh38.fa.gz.gzi',
locationType: 'UriLocation',
},
},
},
aliases: ['hg38'],
refNameAliases: {
adapter: {
type: 'RefNameAliasAdapter',
location: {
uri: 'http://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/GRCh38.aliases.txt',
locationType: 'UriLocation',
},
},
},
},
tracks: [
{
type: 'FeatureTrack',
trackId:
'GCA_000001405.15_GRCh38_full_analysis_set.refseq_annotation.sorted.gff',
name: 'NCBI RefSeq Genes',
category: ['Genes'],
assemblyNames: ['GRCh38'],
adapter: {
type: 'Gff3TabixAdapter',
gffGzLocation: {
uri: 'https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/ncbi_refseq/GCA_000001405.15_GRCh38_full_analysis_set.refseq_annotation.sorted.gff.gz',
locationType: 'UriLocation',
},
index: {
location: {
uri: 'https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/ncbi_refseq/GCA_000001405.15_GRCh38_full_analysis_set.refseq_annotation.sorted.gff.gz.tbi',
locationType: 'UriLocation',
},
indexType: 'TBI',
},
},
renderer: {
type: 'SvgFeatureRenderer',
},
},
{
type: 'AlignmentsTrack',
trackId: 'NA12878.alt_bwamem_GRCh38DH.20150826.CEU.exome',
name: 'NA12878 Exome',
category: ['1000 Genomes', 'Alignments'],
assemblyNames: ['GRCh38'],
adapter: {
type: 'CramAdapter',
cramLocation: {
uri: 'https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/alignments/NA12878/NA12878.alt_bwamem_GRCh38DH.20150826.CEU.exome.cram',
locationType: 'UriLocation',
},
craiLocation: {
uri: 'https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/alignments/NA12878/NA12878.alt_bwamem_GRCh38DH.20150826.CEU.exome.cram.crai',
locationType: 'UriLocation',
},
sequenceAdapter: {
type: 'BgzipFastaAdapter',
fastaLocation: {
uri: 'https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/fasta/GRCh38.fa.gz',
locationType: 'UriLocation',
},
faiLocation: {
uri: 'https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/fasta/GRCh38.fa.gz.fai',
locationType: 'UriLocation',
},
gziLocation: {
uri: 'https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/fasta/GRCh38.fa.gz.gzi',
locationType: 'UriLocation',
},
},
},
},
{
type: 'VariantTrack',
trackId:
'ALL.wgs.shapeit2_integrated_snvindels_v2a.GRCh38.27022019.sites.vcf',
name: '1000 Genomes Variant Calls',
category: ['1000 Genomes', 'Variants'],
assemblyNames: ['GRCh38'],
adapter: {
type: 'VcfTabixAdapter',
vcfGzLocation: {
uri: 'https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/variants/ALL.wgs.shapeit2_integrated_snvindels_v2a.GRCh38.27022019.sites.vcf.gz',
locationType: 'UriLocation',
},
index: {
location: {
uri: 'https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/variants/ALL.wgs.shapeit2_integrated_snvindels_v2a.GRCh38.27022019.sites.vcf.gz.tbi',
locationType: 'UriLocation',
},
indexType: 'TBI',
},
},
},
]
})
</script> The config come from this tutorial (https://jbrowse.org/jb2/docs/tutorials/embed_linear_genome_view/) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
hi there, i tried to see if i could figure out veaury and nuxt myself but ran into the same error ( i removed the ref wrapper and it went away, but then gave a different error) if we do have a good example of using veaury we could try to add it to our docs |
Beta Was this translation helpful? Give feedback.
excellent. the avoidance of ssr is indeed probably needed, in our nextjs examples we have "use client"; statements for example.
it is probably subjective but circular has some interesting visual advantages like letting your eyes wander more freely around the plot versus linear which is very "left vs right" oriented. it's a bit hard to say.
we have @jbrowse/react-circular-genome-view but it is very basic and only draws arcs in the circle and can't draw tracks along the circumference of the circle https://jbrowse.org/storybook/cgv/main/?path=/docs/getting-started--docs