diff --git a/jbrowse/bin/inline_includes.pl b/jbrowse/bin/inline_includes.pl index 17b59672..93f4b5e0 100755 --- a/jbrowse/bin/inline_includes.pl +++ b/jbrowse/bin/inline_includes.pl @@ -115,12 +115,20 @@ =head1 AUTHOR my $includedir = "$Bin/../jbrowse/data/c_elegans"; for my $f (@includes) { + if ($f eq 'includes/rnaseq_splice.json') { + $f = 'includes/' . $BIOPROJECT .'_rnaseq_splice.json'; + warn $f; + } + if ($f eq 'includes/operons.json') { + $f = 'includes/' .$BIOPROJECT .'_operons.json'; + warn $f; + } local $/ = undef; open (my $F, "<", "$includedir/$f") or die "$!:$f"; my $data = <$F>; close $F; - warn $f; + #warn $f; $json = JSON->new->decode($data); for my $a (@{$$json{'tracks'}}){ diff --git a/jbrowse/jbrowse/data/c_elegans/includes/rnaseq_splice.json b/jbrowse/jbrowse/data/c_elegans/includes/c_elegans_PRJNA13758_rnaseq_splice.json similarity index 100% rename from jbrowse/jbrowse/data/c_elegans/includes/rnaseq_splice.json rename to jbrowse/jbrowse/data/c_elegans/includes/c_elegans_PRJNA13758_rnaseq_splice.json diff --git a/jbrowse/jbrowse/data/c_elegans/includes/simple_rnaseq_splice.json b/jbrowse/jbrowse/data/c_elegans/includes/simple_rnaseq_splice.json index eca5ea3a..6a567519 120000 --- a/jbrowse/jbrowse/data/c_elegans/includes/simple_rnaseq_splice.json +++ b/jbrowse/jbrowse/data/c_elegans/includes/simple_rnaseq_splice.json @@ -1 +1 @@ -rnaseq_splice.json \ No newline at end of file +c_elegans_PRJNA13758_rnaseq_splice.json \ No newline at end of file diff --git a/jbrowse2/Dockerfile.mkzip b/jbrowse2/Dockerfile.mkzip index 937032f5..5e41bc54 100644 --- a/jbrowse2/Dockerfile.mkzip +++ b/jbrowse2/Dockerfile.mkzip @@ -5,11 +5,11 @@ FROM gmod/jbrowse2-buildenv:1.2 -ARG RELEASE=289 +ARG RELEASE=292 ARG AWS_ACCESS_KEY_ID ARG AWS_SECRET_ACCESS_KEY -RUN git clone --single-branch --branch jb2-289 https://github.com/WormBase/website-genome-browsers.git +RUN git clone --single-branch --branch jb2-292 https://github.com/WormBase/website-genome-browsers.git RUN mkdir -p /usr/share/nginx/html/tools/genome WORKDIR /usr/share/nginx/html/tools/genome/ @@ -49,6 +49,8 @@ RUN ../../../bin/make_embed_config.pl --release $RELEASE RUN ../../../bin/make_global_config.pl --release $RELEASE > config.json RUN cp config.json /usr/share/nginx/html/tools/genome/jbrowse2/config.json +RUN cp /blast_tracks.json /usr/share/nginx/html/tools/genome/jbrowse2/blast_tracks.json +RUN cp /blast_tracks.txt /usr/share/nginx/html/tools/genome/jbrowse2/blast_tracks.txt RUN mkdir -p /usr/share/nginx/html/tools/genome/jbrowse2/embed/ RUN cp *embed.json /usr/share/nginx/html/tools/genome/jbrowse2/embed/ diff --git a/jbrowse2/bin/make_global_config.pl b/jbrowse2/bin/make_global_config.pl index b311c742..8b7c7892 100755 --- a/jbrowse2/bin/make_global_config.pl +++ b/jbrowse2/bin/make_global_config.pl @@ -152,10 +152,27 @@ #I dont think we need several of the things that are empty arrays #in the existing config +print JSON->new->pretty(1)->encode($json); +# build the bioproject-->tracks for jbrowse blast file +open (my $blast, "<", "/blast_tracks.txt") or die "unable to open blast/tracks text file: $!"; +open (my $blastjson, ">", "/blast_tracks.json") or die "unable to open blast_tracks.json for writing: $!"; +my @blastarray; +while (<$blast>) { + chomp; + my ($assembly, $tracklist) = split /\t/; + my (undef, undef, $bioproject) = split '_', $assembly; #literal underscore + my @blasttracks = split ",", $tracklist; + my $hashref; + $$hashref{'bioproject'} = $bioproject; + $$hashref{'genomebrowser'}{'tracks'} = \@blasttracks; + push @blastarray, $hashref; +} +my $toplevelhash; +$$toplevelhash{'wormbaseVersion'} = 'WS'.$RELEASE; +$$toplevelhash{'bioprojects'} = \@blastarray; +print $blastjson JSON->new->pretty(1)->encode($toplevelhash); +close $blast; +close $blastjson; - - -print JSON->new->pretty(1)->encode($json); - diff --git a/jbrowse2/bin/make_tracks_config.pl b/jbrowse2/bin/make_tracks_config.pl index c990ff22..0120ca49 100755 --- a/jbrowse2/bin/make_tracks_config.pl +++ b/jbrowse2/bin/make_tracks_config.pl @@ -53,12 +53,36 @@ #create list of track configs to include my @includes; +my @blast_tracks; for my $i (@{$$trackList{'include'}}) { $i =~ s/includes\///; + if ($i eq 'operons.json') { + #$i = $ASSEMBLY . '_operons.json'; + # explicitly skip this since the species specific config will get picked up + next; + } + if ($i eq 'rnaseq_splice.json') { + #$i = $ASSEMBLY . '_rnaseq_splice.json'; + # explicitly skip this since the species specific config will get picked up + next; + } push @includes, $i unless ($i =~ /functions.conf/ or $i =~ /PR.*DNA.json/ or $i =~ /alphafold/ or $i =~ /expression_patterns/); + + if ($i eq 'genes.json') { + push @blast_tracks, $ASSEMBLY . "_curated_genes"; + } + elsif ($i eq 'protein_motifs.json') { + push @blast_tracks, $ASSEMBLY . "_protein_motifs"; + } + elsif ($i eq 'variations_classical_alleles.json') { + push @blast_tracks, $ASSEMBLY . "_classical_alleles"; + } + elsif ($i eq 'genblastg.json') { + push @blast_tracks, $ASSEMBLY . "_genblastg_cds_predictions"; + } } my $includedir = "$Bin/../config/track_configs"; @@ -92,6 +116,14 @@ #print JSON->new->pretty(1)->encode($outputjson); +open (my $BLAST, ">>", '/blast_tracks.txt') or die "couldn't open blast_tracks.txt: $!"; + +warn join(',',@blast_tracks); +if (scalar @blast_tracks > 0) { + warn "$ASSEMBLY\t" . join(',',@blast_tracks) . "\n"; + print $BLAST "$ASSEMBLY\t" . join(',',@blast_tracks) . "\n"; +} +close $BLAST; # create a 'tracks' section for a server instance open (my $trackout, ">", $ASSEMBLY."_tracks.json") or die "$!";