From 023711e1e46335e67e90b7eafd2844391c750155 Mon Sep 17 00:00:00 2001 From: Scott Cain Date: Fri, 8 Mar 2024 10:03:01 -0800 Subject: [PATCH 01/15] trying to fix the splice junction skipping for elegans --- jbrowse/bin/inline_includes.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jbrowse/bin/inline_includes.pl b/jbrowse/bin/inline_includes.pl index 17b59672..bfa15db6 100755 --- a/jbrowse/bin/inline_includes.pl +++ b/jbrowse/bin/inline_includes.pl @@ -115,6 +115,9 @@ =head1 AUTHOR my $includedir = "$Bin/../jbrowse/data/c_elegans"; for my $f (@includes) { + if ($f == 'rnaseq_splice.json') { + $f = $BIOPROJECT .'_rnaseq_splice.json'; + } local $/ = undef; open (my $F, "<", "$includedir/$f") or die "$!:$f"; my $data = <$F>; From b1addd1f04602b6ffc28e6310d0920626858e1e9 Mon Sep 17 00:00:00 2001 From: Scott Cain Date: Fri, 8 Mar 2024 14:10:13 -0800 Subject: [PATCH 02/15] getting a little more specific with the splice fix --- jbrowse/bin/inline_includes.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jbrowse/bin/inline_includes.pl b/jbrowse/bin/inline_includes.pl index bfa15db6..7c8ccdc1 100755 --- a/jbrowse/bin/inline_includes.pl +++ b/jbrowse/bin/inline_includes.pl @@ -115,8 +115,8 @@ =head1 AUTHOR my $includedir = "$Bin/../jbrowse/data/c_elegans"; for my $f (@includes) { - if ($f == 'rnaseq_splice.json') { - $f = $BIOPROJECT .'_rnaseq_splice.json'; + if ($f eq 'includes/rnaseq_splice.json') { + $f = 'includes/' . $BIOPROJECT .'_rnaseq_splice.json'; } local $/ = undef; open (my $F, "<", "$includedir/$f") or die "$!:$f"; From 6d88815aa3810d476fb033d9ea1b1c66c1841210 Mon Sep 17 00:00:00 2001 From: Scott Cain Date: Sat, 9 Mar 2024 07:06:28 -0800 Subject: [PATCH 03/15] handling the species specific operon config too --- jbrowse/bin/inline_includes.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/jbrowse/bin/inline_includes.pl b/jbrowse/bin/inline_includes.pl index 7c8ccdc1..93f4b5e0 100755 --- a/jbrowse/bin/inline_includes.pl +++ b/jbrowse/bin/inline_includes.pl @@ -117,13 +117,18 @@ =head1 AUTHOR 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'}}){ From 24739ca240f3978c0dada726719fa842b50506e2 Mon Sep 17 00:00:00 2001 From: Scott Cain Date: Sat, 9 Mar 2024 07:29:34 -0800 Subject: [PATCH 04/15] two changes: creating blast track list and dealing with species specific splice and operons --- jbrowse2/bin/make_global_config.pl | 22 ++++++++++++++++++---- jbrowse2/bin/make_tracks_config.pl | 25 +++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/jbrowse2/bin/make_global_config.pl b/jbrowse2/bin/make_global_config.pl index b311c742..30a71b17 100755 --- a/jbrowse2/bin/make_global_config.pl +++ b/jbrowse2/bin/make_global_config.pl @@ -152,10 +152,24 @@ #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 ($bioproject) = split '_', $assembly; + my @blasttracks = split ",", $tracklist; + my $hashref; + $$hashref{'bioproject'} = $bioproject; + $$hashref{'genomebrowser'}{'tracks'} = @blasttracks; + push @blastarray, $hashref; +} +print $blastjson JSON->new->pretty(1)->encode(@blastarray); +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..d32d0d84 100755 --- a/jbrowse2/bin/make_tracks_config.pl +++ b/jbrowse2/bin/make_tracks_config.pl @@ -53,12 +53,32 @@ #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'; + } + if ($i eq 'rnaseq_splice.json') { + $i = $ASSEMBLY . '_rnaseq_splice.json'; + } 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 ($1 eq 'variations_classical_alleles.json') { + push @blast_tracks, $ASSEMBLY . "_classical_alleles"; + } + elsif ($1 eq 'genblastg.json') { + push @blast_tracks, $ASSEMBLY . "_genblastg_cds_predictions"; + } } my $includedir = "$Bin/../config/track_configs"; @@ -92,6 +112,11 @@ #print JSON->new->pretty(1)->encode($outputjson); +open (my $BLAST, ">>", 'blast_tracks.txt') or die "couldn't open blast_tracks.txt: $!"; +if (scalar @blast_tracks > 0) { + 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 "$!"; From 9e6ee28bb91f3d4e72bed5505c6ee5b5c698ebad Mon Sep 17 00:00:00 2001 From: Scott Cain Date: Sat, 9 Mar 2024 11:23:56 -0800 Subject: [PATCH 05/15] renaming the rnaseq_splice conf to make N2 specific --- ...aseq_splice.json => c_elegans_PRJNA13758_rnaseq_splice.json} | 0 .../jbrowse/data/c_elegans/includes/simple_rnaseq_splice.json | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename jbrowse/jbrowse/data/c_elegans/includes/{rnaseq_splice.json => c_elegans_PRJNA13758_rnaseq_splice.json} (100%) 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 From 6eb17d10d7900c3c6b18802b62613c775a87d089 Mon Sep 17 00:00:00 2001 From: Scott Cain Date: Sun, 10 Mar 2024 07:38:44 -0700 Subject: [PATCH 06/15] fixing the operon and splice config handling. Needs testing but should address https://github.com/WormBase/website/issues/9436 --- jbrowse2/bin/make_tracks_config.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/jbrowse2/bin/make_tracks_config.pl b/jbrowse2/bin/make_tracks_config.pl index d32d0d84..41ac2618 100755 --- a/jbrowse2/bin/make_tracks_config.pl +++ b/jbrowse2/bin/make_tracks_config.pl @@ -57,10 +57,14 @@ for my $i (@{$$trackList{'include'}}) { $i =~ s/includes\///; if ($i eq 'operons.json') { - $i = $ASSEMBLY . '_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'; + #$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/ From 8faef913670843793f88e6ec4c2cac526e5c150a Mon Sep 17 00:00:00 2001 From: Scott Cain Date: Sun, 10 Mar 2024 07:46:08 -0700 Subject: [PATCH 07/15] I think the arg for JSON->encode has to be a ref --- jbrowse2/bin/make_global_config.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jbrowse2/bin/make_global_config.pl b/jbrowse2/bin/make_global_config.pl index 30a71b17..e9e40ce0 100755 --- a/jbrowse2/bin/make_global_config.pl +++ b/jbrowse2/bin/make_global_config.pl @@ -168,7 +168,7 @@ $$hashref{'genomebrowser'}{'tracks'} = @blasttracks; push @blastarray, $hashref; } -print $blastjson JSON->new->pretty(1)->encode(@blastarray); +print $blastjson JSON->new->pretty(1)->encode(\@blastarray); close $blast; close $blastjson; From 637de4dc85c9179507a1aa023fe1cddc5b423f4f Mon Sep 17 00:00:00 2001 From: Scott Cain Date: Sun, 10 Mar 2024 23:54:29 +0000 Subject: [PATCH 08/15] debugging blast track config build --- jbrowse2/Dockerfile.mkzip | 4 ++-- jbrowse2/bin/make_tracks_config.pl | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/jbrowse2/Dockerfile.mkzip b/jbrowse2/Dockerfile.mkzip index 937032f5..5e81c13f 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/ diff --git a/jbrowse2/bin/make_tracks_config.pl b/jbrowse2/bin/make_tracks_config.pl index 41ac2618..c9a11787 100755 --- a/jbrowse2/bin/make_tracks_config.pl +++ b/jbrowse2/bin/make_tracks_config.pl @@ -117,6 +117,8 @@ #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) { print $BLAST "$ASSEMBLY\t" . join(',',@blast_tracks) . "\n"; } From 011508f8bb60544793e0fc38175ccb79e8585b45 Mon Sep 17 00:00:00 2001 From: Scott Cain Date: Sun, 10 Mar 2024 23:58:04 +0000 Subject: [PATCH 09/15] arg! $i != $1 --- jbrowse2/bin/make_tracks_config.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jbrowse2/bin/make_tracks_config.pl b/jbrowse2/bin/make_tracks_config.pl index c9a11787..a18ed91c 100755 --- a/jbrowse2/bin/make_tracks_config.pl +++ b/jbrowse2/bin/make_tracks_config.pl @@ -77,10 +77,10 @@ elsif ($i eq 'protein_motifs.json') { push @blast_tracks, $ASSEMBLY . "_protein_motifs"; } - elsif ($1 eq 'variations_classical_alleles.json') { + elsif ($i eq 'variations_classical_alleles.json') { push @blast_tracks, $ASSEMBLY . "_classical_alleles"; } - elsif ($1 eq 'genblastg.json') { + elsif ($i eq 'genblastg.json') { push @blast_tracks, $ASSEMBLY . "_genblastg_cds_predictions"; } } From 2e19473c7a490cdc22f0f1cb86771750258ea3fe Mon Sep 17 00:00:00 2001 From: Scott Cain Date: Mon, 11 Mar 2024 00:08:30 +0000 Subject: [PATCH 10/15] put the blast track config where I can find it (/) --- jbrowse2/bin/make_global_config.pl | 4 ++-- jbrowse2/bin/make_tracks_config.pl | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/jbrowse2/bin/make_global_config.pl b/jbrowse2/bin/make_global_config.pl index e9e40ce0..95cc0717 100755 --- a/jbrowse2/bin/make_global_config.pl +++ b/jbrowse2/bin/make_global_config.pl @@ -155,8 +155,8 @@ 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: $!"; +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; diff --git a/jbrowse2/bin/make_tracks_config.pl b/jbrowse2/bin/make_tracks_config.pl index a18ed91c..0120ca49 100755 --- a/jbrowse2/bin/make_tracks_config.pl +++ b/jbrowse2/bin/make_tracks_config.pl @@ -116,10 +116,11 @@ #print JSON->new->pretty(1)->encode($outputjson); -open (my $BLAST, ">>", 'blast_tracks.txt') or die "couldn't open blast_tracks.txt: $!"; +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; From bae598d9701c62151d8a73f08dd8563bc3008333 Mon Sep 17 00:00:00 2001 From: Scott Cain Date: Mon, 11 Mar 2024 00:40:23 +0000 Subject: [PATCH 11/15] cleaning up blast config output --- jbrowse2/bin/make_global_config.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jbrowse2/bin/make_global_config.pl b/jbrowse2/bin/make_global_config.pl index 95cc0717..ce8c393d 100755 --- a/jbrowse2/bin/make_global_config.pl +++ b/jbrowse2/bin/make_global_config.pl @@ -165,7 +165,7 @@ my @blasttracks = split ",", $tracklist; my $hashref; $$hashref{'bioproject'} = $bioproject; - $$hashref{'genomebrowser'}{'tracks'} = @blasttracks; + $$hashref{'genomebrowser'}{'tracks'} = \@blasttracks; push @blastarray, $hashref; } print $blastjson JSON->new->pretty(1)->encode(\@blastarray); From 42bede2b567b5f87528283ab8e0e7a6d3219a56c Mon Sep 17 00:00:00 2001 From: Scott Cain Date: Mon, 11 Mar 2024 00:49:19 +0000 Subject: [PATCH 12/15] fixing the split for bioproject --- jbrowse2/bin/make_global_config.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jbrowse2/bin/make_global_config.pl b/jbrowse2/bin/make_global_config.pl index ce8c393d..4b2b8e7f 100755 --- a/jbrowse2/bin/make_global_config.pl +++ b/jbrowse2/bin/make_global_config.pl @@ -161,7 +161,7 @@ while (<$blast>) { chomp; my ($assembly, $tracklist) = split /\t/; - my ($bioproject) = split '_', $assembly; + my ($bioproject) = split '\_', $assembly; #literal underscore my @blasttracks = split ",", $tracklist; my $hashref; $$hashref{'bioproject'} = $bioproject; From e4ed09b500e5875958f72413f7d8d9326c8f8539 Mon Sep 17 00:00:00 2001 From: Scott Cain Date: Mon, 11 Mar 2024 01:00:41 +0000 Subject: [PATCH 13/15] catching the right item of the assembly name --- jbrowse2/bin/make_global_config.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jbrowse2/bin/make_global_config.pl b/jbrowse2/bin/make_global_config.pl index 4b2b8e7f..76f091e6 100755 --- a/jbrowse2/bin/make_global_config.pl +++ b/jbrowse2/bin/make_global_config.pl @@ -161,7 +161,7 @@ while (<$blast>) { chomp; my ($assembly, $tracklist) = split /\t/; - my ($bioproject) = split '\_', $assembly; #literal underscore + my (undef, undef, $bioproject) = split '_', $assembly; #literal underscore my @blasttracks = split ",", $tracklist; my $hashref; $$hashref{'bioproject'} = $bioproject; From 0b51569d04f93fba52fbc2b169fc766191757381 Mon Sep 17 00:00:00 2001 From: Scott Cain Date: Mon, 11 Mar 2024 01:10:45 +0000 Subject: [PATCH 14/15] adding the ability to create the blast_track json file --- jbrowse2/Dockerfile.mkzip | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jbrowse2/Dockerfile.mkzip b/jbrowse2/Dockerfile.mkzip index 5e81c13f..5e41bc54 100644 --- a/jbrowse2/Dockerfile.mkzip +++ b/jbrowse2/Dockerfile.mkzip @@ -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/ From 735dcc46eb84026d4a8104639895e9f5eddae6b3 Mon Sep 17 00:00:00 2001 From: Scott Cain Date: Thu, 14 Mar 2024 10:52:32 -0700 Subject: [PATCH 15/15] possible change to blast config--needs testing --- jbrowse2/bin/make_global_config.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jbrowse2/bin/make_global_config.pl b/jbrowse2/bin/make_global_config.pl index 76f091e6..8b7c7892 100755 --- a/jbrowse2/bin/make_global_config.pl +++ b/jbrowse2/bin/make_global_config.pl @@ -168,7 +168,10 @@ $$hashref{'genomebrowser'}{'tracks'} = \@blasttracks; push @blastarray, $hashref; } -print $blastjson JSON->new->pretty(1)->encode(\@blastarray); +my $toplevelhash; +$$toplevelhash{'wormbaseVersion'} = 'WS'.$RELEASE; +$$toplevelhash{'bioprojects'} = \@blastarray; +print $blastjson JSON->new->pretty(1)->encode($toplevelhash); close $blast; close $blastjson;