Skip to content

Commit

Permalink
Merge pull request #259 from WormBase/jb2-292
Browse files Browse the repository at this point in the history
Jb2 292
  • Loading branch information
scottcain authored Jun 19, 2024
2 parents 661b0e1 + 735dcc4 commit a9ef719
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 8 deletions.
10 changes: 9 additions & 1 deletion jbrowse/bin/inline_includes.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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'}}){
Expand Down
6 changes: 4 additions & 2 deletions jbrowse2/Dockerfile.mkzip
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down Expand Up @@ -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/
Expand Down
25 changes: 21 additions & 4 deletions jbrowse2/bin/make_global_config.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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);

32 changes: 32 additions & 0 deletions jbrowse2/bin/make_tracks_config.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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 "$!";
Expand Down

0 comments on commit a9ef719

Please sign in to comment.