About tracks
What is a track?
A track is the place to display your data files in JBrowse Linear Genome View. For this tutorial we're going to add a gene track, an alignments track, and a variants track. We're just going to use basic configuration, but check the links for the track types to see what kinds of things you can configure in them.
Adding tracks
Gathering data
For genes, we'll use a GFF3 file of the NCBI RefSeq human genes. The link is https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/ncbi_refseq/GCA_000001405.15_GRCh38_full_analysis_set.refseq_annotation.sorted.gff.gz
For alignments, we're going to use on the 1000 Genomes sample NA12878. We'll use a CRAM file (BAM is also supported), and the link is https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/alignments/NA12878/NA12878.alt_bwamem_GRCh38DH.20150826.CEU.exome.cram
For variants, we'll use a VCF of the 1000 Genomes variant calls (note that this VCF contains all samples, not just NA12878). The link is https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/variants/ALL.wgs.shapeit2_integrated_snvindels_v2a.GRCh38.27022019.sites.vcf.gz
Creating track configurations with the CLI
Here are the commands to run to generate the track configurations:
jbrowse add-track https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/ncbi_refseq/GCA_000001405.15_GRCh38_full_analysis_set.refseq_annotation.sorted.gff.gz --name "NCBI RefSeq Genes" --category "Genes" --config '{"renderer": {"type": "SvgFeatureRenderer"}}' --skipCheck
jbrowse add-track https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/alignments/NA12878/NA12878.alt_bwamem_GRCh38DH.20150826.CEU.exome.cram --name "NA12878 Exome" --category "1000 Genomes, Alignments" --skipCheck
jbrowse add-track https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/variants/ALL.wgs.shapeit2_integrated_snvindels_v2a.GRCh38.27022019.sites.vcf.gz --name "1000 Genomes Variant Calls" --category "1000 Genomes, Variants" --skipCheck
Open "config.json" again and look at the tracks that were generated. You can see that again, it has guessed index locations for you, which you can change if needed. Create a new file called "tracks.js" and copy the tracks array into it and have it be exported, like this:
export default [
{
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',
},
},
},
]
You can delete "config.json" at this point, as you won't need it any more. Now update "index.html" to import this file.
<html>
<head>
<script
src="//unpkg.com/react@16/umd/react.development.js"
crossorigin
></script>
<script
src="//unpkg.com/react-dom@16/umd/react-dom.development.js"
crossorigin
></script>
<script
src="//unpkg.com/@jbrowse/react-linear-genome-view/dist/react-linear-genome-view.umd.development.js"
crossorigin
></script>
</head>
<body>
<h1>We're using JBrowse Linear Genome View!</h1>
<div id="jbrowse_linear_genome_view"></div>
<script type="module">
import assembly from './assembly.js'
import tracks from './tracks.js'
</script>
</body>
</html>