Skip to content

Commit

Permalink
Merge branch 'main' into parentage-viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-campbell authored Jan 2, 2025
2 parents 30feb64 + aefb773 commit 13ef39a
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 22 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
id: restore-cache-jbrowse
with:
path: ./_site/assets/js/jbrowse
key: jbrowse-${{ hashFiles('_data/datastore-metadata/**', '_scripts/jbrowse-tracks.sh', 'Makefile', 'assets/js/jbrowse-config.json') }}
key: jbrowse-${{ hashFiles('_data/datastore-metadata/**', '_config.yml', '_scripts/jbrowse-tracks.sh', '_themes/jekyll-theme-legumeinfo/_includes/analytics.html', 'Makefile', 'assets/js/jbrowse-config.json') }}
- uses: actions/setup-node@v4
if: steps.restore-cache-jbrowse.outputs.cache-hit != 'true'
with:
Expand All @@ -69,13 +69,13 @@ jobs:
run: |
make jbrowse
rm -rf assets/js/jbrowse/test_data
mv assets/js/jbrowse _site/assets/js
bundle exec jekyll build --profile --trace # process assets/js/jbrowse/index.html as liquid
- uses: actions/cache/save@v4
id: save-cache-jbrowse
if: steps.restore-cache-jbrowse.outputs.cache-hit != 'true'
with:
path: ./_site/assets/js/jbrowse
key: jbrowse-${{ hashFiles('_data/datastore-metadata/**', '_scripts/jbrowse-tracks.sh', 'Makefile', 'assets/js/jbrowse-config.json') }}
key: jbrowse-${{ hashFiles('_data/datastore-metadata/**', '_config.yml', '_scripts/jbrowse-tracks.sh', '_themes/jekyll-theme-legumeinfo/_includes/analytics.html', 'Makefile', 'assets/js/jbrowse-config.json') }}
# create artifact.tar from ./_site directory & upload as artifact named 'github-pages'
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
Expand Down
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ else # assume dev container
PYTHON_VENV_ACTIVATE = true # no-op
endif

JBROWSE_VERSION = 2.15.4
JBROWSE_VERSION = 2.18.0
PA11YCI_VERSION = 3.1.X

serve: mostlyclean setup
Expand All @@ -74,9 +74,14 @@ pa11y: setup


# JBrowse CLI will already be installed globally if using a dev container
# Ensure JBrowse index.html is parsed by jekyll & inline GA script
jbrowse: setup
if ! { command -v jbrowse || npm ls @jbrowse/cli ; } >/dev/null 2>&1; then npm install $(NPM_INSTALL_OPTIONS) @jbrowse/cli@${JBROWSE_VERSION}; fi
if ! [ -d ./assets/js/jbrowse ]; then npx jbrowse create assets/js/jbrowse --tag=v${JBROWSE_VERSION}; fi
if ! [ -d ./assets/js/jbrowse ]; then \
npx jbrowse create assets/js/jbrowse --tag=v${JBROWSE_VERSION}; \
sed -i.bak -e 's/^/---\n---\n/' -e 's/>/>\n/g' assets/js/jbrowse/index.html; \
sed -i.bak -e '/<\/script>/r ./_themes/jekyll-theme-legumeinfo/_includes/analytics.html' assets/js/jbrowse/index.html; \
fi
cp assets/js/jbrowse-config.json assets/js/jbrowse/config.json
npm exec -c '_scripts/jbrowse-tracks.sh'

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Changes made to other file types (e.g., data and config files) may only be refle


```sh
make jbrowse # (optional) install JBrowse dependencies if needed
make jbrowse # (optional; slow!) install JBrowse dependencies if needed
# & run _scripts/jbrowse-tracks.sh to generate JBrowse config.json
make # install dependencies if needed & start jekyll server listening on localhost:4000
... CTRL-C ...
Expand Down
79 changes: 63 additions & 16 deletions _scripts/jbrowse-tracks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,46 @@ do
(
eval $(yaml2sh ${readme})
datastore_dir_url=${DATASTORE_URL}/$(dirname ${readme#_data/datastore-metadata/})
trackId=${identifier%.*}
assemblyNames=${identifier%.ann[0-9].*}
if grep -q jbrowse-index ${readme%/*}/MANIFEST.*.yml
then
config=$(printf '
{
"displays": [{"displayId":"%s","renderer":{"maxHeight":3000}}],
"textSearching": {
"textSearchAdapter": {
"type": "TrixTextSearchAdapter",
"textSearchAdapterId": "%s-index",
"ixFilePath": {
"uri": "https://data.soybase.org/jbrowse-index/trix/%s.ix",
"locationType": "UriLocation"
},
"ixxFilePath": {
"uri": "https://data.soybase.org/jbrowse-index/trix/%s.ixx",
"locationType": "UriLocation"
},
"metaFilePath": {
"uri": "https://data.soybase.org/jbrowse-index/trix/%s_meta.json",
"locationType": "UriLocation"
},
"assemblyNames": [
"%s"
]
}
}
}' "${trackId}" "${trackId}" "${trackId}" "${trackId}" "${trackId}" "${assemblyNames}")
else
config=$(printf '{"displays":[{"displayId":"%s","renderer":{"maxHeight":3000}}]}' "${identifier%.*}")
fi

jbrowse add-track \
${datastore_dir_url}/${scientific_name_abbrev}.${identifier}.gene_models_main.gff3.gz \
--assemblyNames=${identifier%.ann[0-9].*} \
--assemblyNames=${assemblyNames} \
--category='Genes' \
--trackId=${identifier%.*} \
--trackId=${trackId} \
--description="${synopsis}<br /><br /><b>more info:</b> ${datastore_dir_url}/" \
--config=$(printf '{"displays":[{"displayId":"%s","renderer":{"maxHeight":3000}}]}' "${identifier%.*}") \
--config="${config}" \
--out=assets/js/jbrowse
)
done
Expand All @@ -64,12 +97,38 @@ do
(
eval $(yaml2sh ${readme})
datastore_dir_url=${DATASTORE_URL}/$(dirname ${readme#_data/datastore-metadata/})
assemblyNames=${identifier%.mrk.*}
config=$(printf '
{
"textSearching": {
"textSearchAdapter": {
"type": "TrixTextSearchAdapter",
"textSearchAdapterId": "%s-index",
"ixFilePath": {
"uri": "https://data.soybase.org/jbrowse-index/trix/%s.ix",
"locationType": "UriLocation"
},
"ixxFilePath": {
"uri": "https://data.soybase.org/jbrowse-index/trix/%s.ixx",
"locationType": "UriLocation"
},
"metaFilePath": {
"uri": "https://data.soybase.org/jbrowse-index/trix/%s_meta.json",
"locationType": "UriLocation"
},
"assemblyNames": [
"%s"
]
}
}
}' "${identifier}" "${identifier}" "${identifier}" "${identifier}" "${assemblyNames}")
jbrowse add-track \
${datastore_dir_url}/${scientific_name_abbrev}.${identifier}.gff3.gz \
--assemblyNames=${identifier%.mrk.*} \
--assemblyNames=${assemblyNames} \
--category='Markers' \
--name=${identifier##*.} \
--trackId=${identifier} \
--config="${config}" \
--description="${synopsis}<br /><br /><b>more info:</b> ${datastore_dir_url}/" \
--out=assets/js/jbrowse
)
Expand Down Expand Up @@ -159,15 +218,3 @@ do
--out=assets/js/jbrowse/
done
done






# FIXME: too big & slow to generate for testing
# https://github.com/GMOD/jbrowse-components/issues/3019
#npx jbrowse text-index \
# --perTrack \
# --tracks='...' \
# --attributes='Name'
1 change: 1 addition & 0 deletions assets/js/jbrowse-config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"configuration": {
"disableAnalytics": true,
"hierarchical": {
"defaultCollapsed": {
"subCategories": true
Expand Down

0 comments on commit 13ef39a

Please sign in to comment.