Difference between revisions of "JBrowse"

From www.wiki.chlamdb.ch
Jump to navigation Jump to search
(Created page with " == folder structure == - folder raw data: /var/www/html/jbrowse/sample_data/raw/ - folder configuration files: /var/www/html/jbrowse/sample_data/json/ We have to create a...")
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
  
 +
==folder structure==
 +
<br />
  
−
== folder structure ==
+
#folder raw data: /var/www/html/jbrowse/sample_data/raw/
 +
#folder configuration files: /var/www/html/jbrowse/sample_data/json/
  
−
- folder raw data: /var/www/html/jbrowse/sample_data/raw/
 
−
- folder configuration files: /var/www/html/jbrowse/sample_data/json/
 
  
 +
We have to create a new folder for each dataset:
 +
 +
<syntaxhighlight lang="bash">
 +
mkdir /var/www/html/jbrowse/sample_data/raw/MTB
 +
mkdir /var/www/html/jbrowse/sample_data/json/MTB
 +
</syntaxhighlight>
 +
 +
==Add reference from fasta==
 +
 +
<syntaxhighlight>
 +
cd /var/www/html/jbrowse/sample_data/json/MTB
 +
prepare-refseqs.pl --fasta NC_000962.fna
 +
</syntaxhighlight><br />
 +
 +
*This will create
 +
**/var/www/html/jbrowse/sample_data/json/MTB/tracks.conf
 +
**/var/www/html/jbrowse/sample_data/json/MTB/trackList.json
 +
**/var/www/html/jbrowse/sample_data/json/MTB/seq
 +
 +
==Add bam track files==
 +
 +
*Add sorted bam file in "/var/www/html/jbrowse/sample_data/raw/MTB"
 +
*Index bam file
 +
<syntaxhighlight>
 +
cd /var/www/html/jbrowse/sample_data/raw/MTB
 +
samtools index 538048.bam
 +
 +
</syntaxhighlight>
 +
 +
*Add bam track to <u>tracks.conf</u>
 +
<syntaxhighlight>
 +
emacs -nw /var/www/html/jbrowse/sample_data/json/MTB/tracks.conf
 +
</syntaxhighlight>Content:<syntaxhighlight lang="json">
 +
# make a section for the new track called tracks.(unique name)
 +
[ tracks.my-bam-track ]
 +
 +
# settings for what data is shown in the track
 +
storeClass    = JBrowse/Store/SeqFeature/BAM
 +
urlTemplate    = ../../raw/MTB/538048.bam
 +
baiUrlTemplate = ../../raw/MTB/538048.bam.bai
 +
 +
type = JBrowse/View/Track/Alignments2
 +
key  = BAM alignments from sample XYZ
 +
renderPrettyAlignments = true
 +
 +
[ tracks.bam-coverage ]
 +
 +
storeClass    = JBrowse/Store/SeqFeature/BAM
 +
urlTemplate    = ../../raw/MTB/538048.bam
 +
baiUrlTemplate = ../../raw/MTB/538048.bam.bai
 +
 +
type = JBrowse/View/Track/SNPCoverage
 +
</syntaxhighlight>
 +
 +
==Add gene track==
 +
<syntaxhighlight lang="bash">
 +
# convert gbk to gff
 +
gbk2gff.py -i genome_gbwithparts.gbk -o genome_gbwithparts.gff
 +
 +
# add track
 +
flatfile-to-json.pl --gff genome_gbwithparts.gff --type CDS --trackLabel ORFs --out /var/www/html/jbrowse/sample_data/json/MTB --nameAttributes locus_tag
 +
</syntaxhighlight>
  
−
We have to create a new folder for each dataset:
+
==Add locus tags index==
 +
<br /><syntaxhighlight lang="bash">
 +
cd /var/www/html/jbrowse/sample_data/raw/MTB
 +
generate-names.pl --verbose --out /var/www/html/jbrowse/sample_data/json/MTB
 +
</syntaxhighlight>
 +
 
 +
 
 +
This will create  
 +
 
 +
*/var/www/html/jbrowse/sample_data/json/MTB/names
  
 +
== Access browser ==
  
  
−
== Add reference from fasta ==
+
[http://127.0.0.1/jbrowse/index.html?data=sample_data%2Fjson%2FMTB http://127.0.0.1/jbrowse/index.html?data=sample_data/json/MTB]
 +
<br />

Latest revision as of 13:26, 6 September 2019

folder structure


  1. folder raw data: /var/www/html/jbrowse/sample_data/raw/
  2. folder configuration files: /var/www/html/jbrowse/sample_data/json/


We have to create a new folder for each dataset:

mkdir /var/www/html/jbrowse/sample_data/raw/MTB
mkdir /var/www/html/jbrowse/sample_data/json/MTB

Add reference from fasta

cd /var/www/html/jbrowse/sample_data/json/MTB
prepare-refseqs.pl --fasta NC_000962.fna


  • This will create
    • /var/www/html/jbrowse/sample_data/json/MTB/tracks.conf
    • /var/www/html/jbrowse/sample_data/json/MTB/trackList.json
    • /var/www/html/jbrowse/sample_data/json/MTB/seq

Add bam track files

  • Add sorted bam file in "/var/www/html/jbrowse/sample_data/raw/MTB"
  • Index bam file
cd /var/www/html/jbrowse/sample_data/raw/MTB
samtools index 538048.bam
  • Add bam track to tracks.conf
emacs -nw /var/www/html/jbrowse/sample_data/json/MTB/tracks.conf

Content:

# make a section for the new track called tracks.(unique name)
[ tracks.my-bam-track ]

# settings for what data is shown in the track
storeClass     = JBrowse/Store/SeqFeature/BAM
urlTemplate    = ../../raw/MTB/538048.bam
baiUrlTemplate = ../../raw/MTB/538048.bam.bai

type = JBrowse/View/Track/Alignments2
key  = BAM alignments from sample XYZ
renderPrettyAlignments = true

[ tracks.bam-coverage ]

storeClass     = JBrowse/Store/SeqFeature/BAM
urlTemplate    = ../../raw/MTB/538048.bam
baiUrlTemplate = ../../raw/MTB/538048.bam.bai

type = JBrowse/View/Track/SNPCoverage

Add gene track

# convert gbk to gff
gbk2gff.py -i genome_gbwithparts.gbk -o genome_gbwithparts.gff

# add track
flatfile-to-json.pl --gff genome_gbwithparts.gff --type CDS --trackLabel ORFs --out /var/www/html/jbrowse/sample_data/json/MTB --nameAttributes locus_tag

Add locus tags index


cd /var/www/html/jbrowse/sample_data/raw/MTB
generate-names.pl --verbose --out /var/www/html/jbrowse/sample_data/json/MTB


This will create

  • /var/www/html/jbrowse/sample_data/json/MTB/names

Access browser

http://127.0.0.1/jbrowse/index.html?data=sample_data/json/MTB