Skip to content

Commit 56540c0

Browse files
authored
Make meta dbs (#448)
* Make meta dbs * Remove meta db creation for 3.21 * Add meta db creation for experiments, annotations
1 parent 0c92c8c commit 56540c0

File tree

4 files changed

+66
-0
lines changed

4 files changed

+66
-0
lines changed

propagation/3.22/updateReposPkgs-bioc.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ WIN_CONTRIB="$REPOS_ROOT/bin/windows/contrib/$R_VERSION"
1717
MAC_BIG_SUR_x86_64_CONTRIB="$REPOS_ROOT/bin/macosx/big-sur-x86_64/contrib/$R_VERSION"
1818
MAC_BIG_SUR_arm64_CONTRIB="$REPOS_ROOT/bin/macosx/big-sur-arm64/contrib/$R_VERSION"
1919

20+
META_SRC="$SRC_CONTRIB/Meta"
21+
META_R_EXPR="source('/home/biocbuild/BBS/utils/makeMetaDbs.R')"
22+
MEAT_PATH="/home/biocbuild/bbs-$BIOC_VERSION-bioc/meat"
23+
2024
if [ ! -f "$PROPAGATION_DB_FILE" ]; then
2125
echo "ERROR: $PROPAGATION_DB_FILE not found. Did postrun.sh run?"
2226
exit 1
@@ -72,6 +76,13 @@ for i in `ls $MANUALS_SRC`; do
7276
mkdir -p $MANUALS_DEST/$pkg/man
7377
cp --update --verbose $MANUALS_SRC/$i $MANUALS_DEST/$pkg/man
7478
done
79+
echo ""
80+
echo "========================================================================"
81+
/bin/date
82+
echo "------------------------------------------------------------------------"
83+
84+
echo "Updating $META_SRC with aliases and cross refences dbs..."
85+
$Rscript -e "$META_R_EXPR; try(makeMetaDbs('$PROPAGATION_DB_FILE', '$MEAT_PATH', '$REPOS_ROOT', '$META_SRC'))"
7586

7687
echo "DONE."
7788
exit 0

propagation/3.22/updateReposPkgs-data-annotation.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ PROPAGATION_DB_FILE="$BBS_OUTGOING_DIR/../PROPAGATION_STATUS_DB.txt"
1414
REPOS_ROOT="$HOME/PACKAGES/$BIOC_VERSION/data/annotation"
1515
SRC_CONTRIB="$REPOS_ROOT/src/contrib"
1616

17+
META_SRC="$SRC_CONTRIB/Meta"
18+
META_R_EXPR="source('/home/biocbuild/BBS/utils/makeMetaDbs.R')"
19+
MEAT_PATH="/home/biocbuild/bbs-$BIOC_VERSION-data-annotation/meat"
20+
1721
if [ ! -f "$PROPAGATION_DB_FILE" ]; then
1822
echo "ERROR: $PROPAGATION_DB_FILE not found. Did postrun.sh run?"
1923
exit 1
@@ -58,6 +62,13 @@ for i in `ls $MANUALS_SRC`; do
5862
mkdir -p $MANUALS_DEST/$pkg/man
5963
cp --update --verbose $MANUALS_SRC/$i $MANUALS_DEST/$pkg/man
6064
done
65+
echo ""
66+
echo "========================================================================"
67+
/bin/date
68+
echo "------------------------------------------------------------------------"
69+
70+
echo "Updating $META_SRC with aliases and cross refences dbs..."
71+
$Rscript -e "$META_R_EXPR; try(makeMetaDbs('$PROPAGATION_DB_FILE', '$MEAT_PATH', '$REPOS_ROOT', '$META_SRC'))"
6172

6273
echo "DONE."
6374
exit 0

propagation/3.22/updateReposPkgs-data-experiment.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ PROPAGATION_DB_FILE="$BBS_OUTGOING_DIR/../PROPAGATION_STATUS_DB.txt"
1414
REPOS_ROOT="$HOME/PACKAGES/$BIOC_VERSION/data/experiment"
1515
SRC_CONTRIB="$REPOS_ROOT/src/contrib"
1616

17+
META_SRC="$SRC_CONTRIB/Meta"
18+
META_R_EXPR="source('/home/biocbuild/BBS/utils/makeMetaDbs.R')"
19+
MEAT_PATH="/home/biocbuild/bbs-$BIOC_VERSION-data-experiment/meat"
20+
1721
if [ ! -f "$PROPAGATION_DB_FILE" ]; then
1822
echo "ERROR: $PROPAGATION_DB_FILE not found. Did postrun.sh run?"
1923
exit 1
@@ -58,6 +62,13 @@ for i in `ls $MANUALS_SRC`; do
5862
mkdir -p $MANUALS_DEST/$pkg/man
5963
cp --update --verbose $MANUALS_SRC/$i $MANUALS_DEST/$pkg/man
6064
done
65+
echo ""
66+
echo "========================================================================"
67+
/bin/date
68+
echo "------------------------------------------------------------------------"
69+
70+
echo "Updating $META_SRC with aliases and cross refences dbs..."
71+
$Rscript -e "$META_R_EXPR; try(makeMetaDbs('$PROPAGATION_DB_FILE', '$MEAT_PATH', '$REPOS_ROOT', '$META_SRC'))"
6172

6273
echo "DONE."
6374
exit 0

utils/makeMetaDbs.R

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
makeMetaDbs <- function(db_filepath, repos_root, meta_path) {
2+
3+
meat_dir <- Sys.getenv("BBS_MEAT_PATH")
4+
prop_status <- read.dcf(db_filepath)
5+
6+
pkgs <- c()
7+
for (i in 1:dim(prop_status)[2]) {
8+
pkg_type_stage <- strsplit(colnames(prop_status)[i], "#")[[1]]
9+
if ("source" %in% pkg_type_stage &&
10+
strsplit(prop_status[i], ",")[[1]][1] %in% c("YES", "UNNEEDED")) {
11+
pkgs <- c(pkgs, pkg_type_stage[1])
12+
}
13+
}
14+
15+
web_dir <- file.path(repos_root, "web", "packages")
16+
meta_dir <- file.path(meta_path)
17+
if (!dir.exists(meta_dir)) {
18+
dir.create(meta_dir, recursive = TRUE)
19+
}
20+
21+
pkg_paths <- file.path(meat_dir, pkgs)
22+
for (pkg_path in pkg_paths) {
23+
biocViews::build_db_from_source(pkg_path, repos_root)
24+
}
25+
26+
aliases_db_file <- file.path(meta_dir, "aliases.rds")
27+
meta_aliases_db <- biocViews::build_meta_aliases_db(web_dir, aliases_db_file)
28+
saveRDS(meta_aliases_db, aliases_db_file, version = 2)
29+
30+
rdxrefs_db_file <- file.path(meta_dir, "rdxrefs.rds")
31+
meta_rdxrefs_db <- biocViews::build_meta_rdxrefs_db(web_dir, rdxrefs_db_file)
32+
saveRDS(meta_rdxrefs_db, rdxrefs_db_file, version = 2)
33+
}

0 commit comments

Comments
 (0)