Skip to content

Content Changes

Benjamin Capodanno edited this page Jun 6, 2022 · 9 revisions

This page describes how to make updates to track content on the browser. Throughout this guide, I will use the BBQS859 strain as an example, but replace that strain name with others for generalized commands.

Raw Data and Script Location

Adding Raw Data

Raw data for each track is stored in the raw/ directory of each organism. For consistency, any additional raw data that we use to build tracks should go in this folder of the appropriate organism.

Running Track Setup Scripts

To improve security on the server, track setup scripts are located in my home directory, /home/bencap/jbrowse_track_building. Navigate to this directory to run setup scripts, then copy data to the appropriate web directory for tracks to display correctly.

Track Updates

Updating Gene Tracks

  1. Navigate to /home/bencap/jbrowse_track_building and add any new raw data to the appropriate raw/ directory in the web documents.

  2. Build the gene tracks from the appropriate .gff file using a command similar to the one below:

perl bin/flatfile-to-json.pl --gff /web/docs/bbqs_master/raw/ --trackType CanvasFeatures --trackLabel BBQS859
  1. This command will output a set of files to data/tracks/BBQS859. With regard to burkholderia genomes, you should see two directories - one for each chromosome.

  2. We can then copy the new data to that same directory in the /web/docs tree - overwriting the old data

cp ./data/tracks/BBQS859/NZ_QPEQ01000001.1/hist-* /web/docs/bbqs_master/data/tracks/BBQS859/NZ_QPEQ01000001.1
cp ./data/tracks/BBQS859/NZ_QPEQ01000001.1/lf-* /web/docs/bbqs_master/data/tracks/BBQS859/NZ_QPEQ01000001.1
cp ./data/tracks/BBQS859/NZ_QPEQ01000001.1/names.txt /web/docs/bbqs_master/data/tracks/BBQS859/NZ_QPEQ01000001.1
cp ./data/tracks/BBQS859/NZ_QPEQ01000001.1/trackData.txt /web/docs/bbqs_master/data/tracks/BBQS859/NZ_QPEQ01000001.1
  1. Reload the browser to ensure the files copied successfully.

Updating Psuedogene Tracks

  1. Navigate to /home/bencap/jbrowse_track_building and add any new raw data to the appropriate raw/ directory in the web documents.

  2. Build the pseudogene tracks from the appropriate .bed file using a command similar to the one below

python3 bin/bed_to_json.py --in /web/docs/bbqs_master/raw/bbqs859_chr1.pseudo_for_browser.bed --out trackData_pseudogenes.json --chunk pse --strain BBQS859

for pseudogenes, we have one file for each chromosome, so you will have to run the command again with the file containing data on the second chromosome:

python3 bin/bed_to_json.py --in /web/docs/bbqs_master/raw/bbqs859_chr2.pseudo_for_browser.bed --out trackData_pseudogenes.json --chunk pse --strain BBQS859
  1. Verify the appropriate tracks pse-0.json and trackData_pseudogenes.json exist in the output data directory.

  2. Copy these files to the production data directory with

cp data/tracks/BBQS859/NZ_QPEQ01000001.1/pse-0.json /web/docs/bbqs_master/data/tracks/BBQS859/NZ_QPEQ01000001.1
cp data/tracks/BBQS859/NZ_QPEQ01000001.1/trackData_pseudogenes.json /web/docs/bbqs_master/data/tracks/BBQS859/NZ_QPEQ01000001.1
  1. Repeat the above for the chromosome 2 data.

  2. Reload the browser.

Updating Island Tracks

  1. Navigate to /home/bencap/jbrowse_track_building and add any new raw data to the appropriate raw/ directory in the web documents.

  2. Build the island tracks from the appropriate .bed file with a command similar to the one below

python3 bin/bed_to_json.py --in /web/docs/bbqs_master/raw/bbqs859_chr1.GI_for_browser.bed --out trackData_islands.json --chunk isl --strain BBQS859

remember to also build data for the second chromosome.

  1. Verify the appropriate tracks isl-0.json and trackData_islands.json exist in the output data directory.

  2. Copy these files to the production data directory with

cp data/tracks/BBQS859/NZ_QPEQ01000001.1/isl-0.json /web/docs/bbqs_master/data/tracks/BBQS859/NZ_QPEQ01000001.1
cp data/tracks/BBQS859/NZ_QPEQ01000001.1/trackData_islands.json /web/docs/bbqs_master/data/tracks/BBQS859/NZ_QPEQ01000001.1
  1. Repeat the above for the chromosome 2 data.

  2. Reload the browser.

Updating IS Element Tracks

  1. Navigate to /home/bencap/jbrowse_track_building and add any new raw data to the appropriate raw/ directory in the web documents.

  2. Build the IS Element tracks from the appropriate .bed file with a command similar to the one below

python3 bin/bed_to_json.py --in /web/docs/bbqs_master/raw/bbqs859_chr1.IS_for_browser.bed --out trackData_iselements.json --chunk ise --strain BBQS859

remember to also build data for the second chromosome.

  1. Verify the appropriate tracks ise-0.json and trackData_iselements.json exist in the output data directory.

  2. Copy these files to the production data directory with

cp data/tracks/BBQS859/NZ_QPEQ01000001.1/ise-0.json /web/docs/bbqs_master/data/tracks/BBQS859/NZ_QPEQ01000001.1
cp data/tracks/BBQS859/NZ_QPEQ01000001.1/trackData_iselements.json /web/docs/bbqs_master/data/tracks/BBQS859/NZ_QPEQ01000001.1
  1. Repeat the above for the chromosome 2 data.

  2. Reload the browser.

Updating Horizontally Transferred Gene Tracks

  1. Navigate to /home/bencap/jbrowse_track_building and add any new raw data to the appropriate raw/ directory in the web documents.

  2. Build the gene transfer tracks from the appropriate .bed file with a command similar to the one below

python3 bin/bed_to_json.py --in /web/docs/bbqs_master/raw/bbqs859_chr1.hgt_for_browser.bed --out trackData_genetransfer.json --chunk hgt --strain BBQS859

remember to also build data for the second chromosome.

  1. Verify the appropriate tracks hgt-0.json and trackData_genetransfer.json exist in the output data directory.

  2. Copy these files to the production data directory with

cp data/tracks/BBQS859/NZ_QPEQ01000001.1/hgt-0.json /web/docs/bbqs_master/data/tracks/BBQS859/NZ_QPEQ01000001.1
cp data/tracks/BBQS859/NZ_QPEQ01000001.1/trackData_genetransfer.json /web/docs/bbqs_master/data/tracks/BBQS859/NZ_QPEQ01000001.1
  1. Repeat the above for the chromosome 2 data.

  2. Reload the browser.

Updating Secretion System Tracks

  1. Navigate to /home/bencap/jbrowse_track_building and add any new raw data to the appropriate raw/ directory in the web documents.

  2. Build the gene transfer tracks from the appropriate .bed file with a command similar to the one below

python3 bin/bed_to_json.py --in /web/docs/bbqs_master/raw/bbqs859_chr1.ss_for_browser.bed --out trackData_secretion.json --chunk sec --strain BBQS859

remember to also build data for the second chromosome.

  1. Verify the appropriate tracks sec-0.json and trackData_secretion.json exist in the output data directory.

  2. Copy these files to the production data directory with

cp data/tracks/BBQS859/NZ_QPEQ01000001.1/sec-0.json /web/docs/bbqs_master/data/tracks/BBQS859/NZ_QPEQ01000001.1
cp data/tracks/BBQS859/NZ_QPEQ01000001.1/trackData_secretion.json /web/docs/bbqs_master/data/tracks/BBQS859/NZ_QPEQ01000001.1
  1. Repeat the above for the chromosome 2 data.

  2. Reload the browser.

Updating Secretion Effector Tracks

  1. Navigate to /home/bencap/jbrowse_track_building and add any new raw data to the appropriate raw/ directory in the web documents.

  2. Build the gene transfer tracks from the appropriate .bed file with a command similar to the one below

python3 bin/bed_to_json.py --in /web/docs/bbqs_master/raw/bbqs859_chr1.effectors_for_browser.bed --out trackData_effectors.json --chunk eff --strain BBQS859

remember to also build data for the second chromosome.

  1. Verify the appropriate tracks eff-0.json and trackData_effectors.json exist in the output data directory.

  2. Copy these files to the production data directory with

cp data/tracks/BBQS859/NZ_QPEQ01000001.1/eff-0.json /web/docs/bbqs_master/data/tracks/BBQS859/NZ_QPEQ01000001.1
cp data/tracks/BBQS859/NZ_QPEQ01000001.1/trackData_effectors.json /web/docs/bbqs_master/data/tracks/BBQS859/NZ_QPEQ01000001.1
  1. Repeat the above for the chromosome 2 data.

  2. Reload the browser.

Adding and Deleting Tracks

Generic Documentation for Adding New Tracks

  1. Navigate to /home/bencap/jbrowse_track_building and add any new raw data to the appropriate raw/ directory in the web documents.

  2. Build the track from the appropriate file. I recommend using .bed formats for custom data for consistency. Ensure you use a chunk name and track name different from other tracks. Note the chunk name should be three letters.

python3 bin/bed_to_json.py --in /web/docs/bbqs_master/raw/new_track_data.bed --out trackData_unique_track_name.json --chunk XXX --strain BBQS859

Again, remember to add both chromosomes.

  1. Verify the appropriate tracks XXX-0.json and trackData_unique_track_name.json exist in the output data directory.

  2. Copy these files to the production data directory with

cp data/tracks/BBQS859/NZ_QPEQ01000001.1/XXX-0.json /web/docs/bbqs_master/data/tracks/BBQS859/NZ_QPEQ01000001.1
cp data/tracks/BBQS859/NZ_QPEQ01000001.1/trackData_unique_track_name.json /web/docs/bbqs_master/data/tracks/BBQS859/NZ_QPEQ01000001.1
  1. Repeat the above for the chromosome 2 data.

  2. Navigate to data/tracks/trackList.json. Open the file and add an entry for the new track. This entry should follow the format below:

      {
         "category" : "Category for New Track", # this is the drop down menu under which the track will appear
         "compress" : 0,
         "disableCollapsedClick" : false,
         "enableCollapsedMouseover" : false,
         "hideFAASequenceBox" : true,
         "key" : "Secretion System Components", # this is the visible name of the track that shows up in the browser on the left hand side
         "label" : "TXSScan", # the name of the major software used to generate the track
         "maxFeatureGlyphExpansion" : 500000,
         "maxFeatureSizeForUnderlyingRefSeq" : 250000,
         "maxHeight" : 1000,
         "metadata" : {},
         "storeClass" : "JBrowse/Store/SeqFeature/NCList",
         "trackType" : "JBrowse/View/Track/CanvasFeatures",
         "type" : "JBrowse/View/Track/CanvasFeatures",
         "urlTemplate" : "tracks/BBQS859/{refseq}/trackData_unique_track_name.json" # this points to where the track is
      },
  1. If you want to add searchable features for this track, you should create a name directory using the track label:
mkdir ./<strain>/<track label>

This is where you will but the names.txt file for this track.

  1. Reload the browser.

Generic Documentation for Removing a Track

  1. Navigate to /web/docs/bbqs_master/data/tracks. Verify which track you intend to delete and retrieve both the chunk name (the three letter prefix to the -0.json file containing track data) and the trackData name (the suffix after trackData_).

  2. Run

rm BBQS859/NZ_QPEQ01000001.1/<prefix>*.json
rm BBQS859/NZ_QPEQ01000001.1/trackData_<suffix>.json

and repeat the above for the second chromosome.

  1. Delete the appropriate entry for this data from ./trackList.json. You should see the entry for the trackData_<suffix> under the urlTemplate field in the JSON object.

  2. Reload the browser.

Common Issues:

FileNotFoundError: [Errno 2] No such file or directory: 'data/tracks/BBQS859/NZ_QPEQ01000001.1/trackData_pseudogenes.json'

This error indicates the python script could not find a viable output path for the data. Simply run

mkdir data/tracks/BBQS859/NZ_QPEQ01000001.1

and run the command again.