Skip to content

Commit b13a24c

Browse files
committed
move setup.sh to root for now -- having problems with travis build.
1 parent 7fcb29e commit b13a24c

File tree

3 files changed

+187
-3
lines changed

3 files changed

+187
-3
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ before_install:
1616
- npm install -g jshint
1717
install:
1818
- npm install
19-
- bash utils/setup.sh legacy
19+
- bash setup.sh legacy
2020
before_script:
2121
- cat tests/travis.conf | envsubst > tests/travis-envsubst.conf
2222
- nginx -c `pwd`/tests/travis-envsubst.conf

setup.sh

+184
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
#!/bin/bash
2+
done_message () {
3+
if [ $? == 0 ]; then
4+
echo " done."
5+
if [ "x$1" != "x" ]; then
6+
echo $1;
7+
fi
8+
else
9+
echo " failed. See setup.log file for error messages." $2
10+
fi
11+
}
12+
13+
legacy_message () {
14+
echo "Legacy scripts wig-to-json.pl and bam-to-json.pl have removed from setup. Their functionality has been superseded by add-bam-track.pl and add-bw-track.pl. If you require the old versions, run 'setup.sh legacy'."
15+
}
16+
17+
18+
19+
echo > setup.log;
20+
21+
LEGACY_INSTALL=0
22+
if [ $# -gt 1 ] ; then
23+
echo "USAGE: ./setup.sh [legacy]"
24+
echo -e "\tTakes one optional argument, presence triggers legacy software install."
25+
exit 1
26+
fi
27+
if [[ ($# -eq 1) && ("$1" = "legacy") ]] ; then
28+
LEGACY_INSTALL=1
29+
else
30+
legacy_message
31+
fi
32+
33+
# if src/dojo/dojo.js exists, but that is the only file in that directory (or other directories don't exist)
34+
# OR
35+
# if dev we don't care
36+
echo -n "Installing javascript dependencies ..."
37+
if [ -f "src/dojo/dojo.js" ] && ! [ -f "src/dojo/_firebug/firebug.js" ]; then
38+
echo "Detected precompiled version." ;
39+
elif ! [ -f "src/dojo/dojo.js" ]; then
40+
echo "Dojo does not exist, installing" ;
41+
npm install;
42+
fi
43+
echo "done"
44+
45+
46+
# log information about this system
47+
echo -n "Gathering system information ..."
48+
(
49+
echo '============== System information ====';
50+
set -x;
51+
lsb_release -a;
52+
uname -a;
53+
sw_vers;
54+
system_profiler;
55+
grep MemTotal /proc/meminfo;
56+
echo; echo;
57+
) >>setup.log 2>&1;
58+
echo "done"
59+
60+
echo -n "Installing Perl prerequisites ..."
61+
if ! ( perl -MExtUtils::MakeMaker -e 1 >/dev/null 2>&1); then
62+
echo;
63+
echo "WARNING: Your Perl installation does not seem to include a complete set of core modules. Attempting to cope with this, but if installation fails please make sure that at least ExtUtils::MakeMaker is installed. For most users, the best way to do this is to use your system's package manager: apt, yum, fink, homebrew, or similar.";
64+
fi;
65+
( set -x;
66+
bin/cpanm -v --notest -l extlib/ --installdeps . < /dev/null;
67+
bin/cpanm -v --notest -l extlib/ --installdeps . < /dev/null;
68+
set -e;
69+
bin/cpanm -v --notest -l extlib/ --installdeps . < /dev/null;
70+
) >>setup.log 2>&1;
71+
done_message "" "As a first troubleshooting step, make sure development libraries and header files for GD, Zlib, and libpng are installed and try again.";
72+
73+
echo
74+
echo -n "Formatting Volvox example data ...";
75+
( set -e;
76+
set -x;
77+
78+
# format volvox
79+
rm -rf sample_data/json/volvox;
80+
bin/prepare-refseqs.pl --fasta docs/tutorial/data_files/volvox.fa --out sample_data/json/volvox;
81+
bin/biodb-to-json.pl -v --conf docs/tutorial/conf_files/volvox.json --out sample_data/json/volvox;
82+
cat docs/tutorial/data_files/volvox_microarray.bw.conf >> sample_data/json/volvox/tracks.conf
83+
cat docs/tutorial/data_files/volvox_sine.bw.conf >> sample_data/json/volvox/tracks.conf
84+
cat docs/tutorial/data_files/volvox-sorted.bam.conf >> sample_data/json/volvox/tracks.conf
85+
cat docs/tutorial/data_files/volvox-sorted.bam.coverage.conf >> sample_data/json/volvox/tracks.conf
86+
cat docs/tutorial/data_files/volvox-paired.bam.conf >> sample_data/json/volvox/tracks.conf
87+
cat docs/tutorial/data_files/volvox.vcf.conf >> sample_data/json/volvox/tracks.conf
88+
cat docs/tutorial/data_files/volvox_fromconfig.conf >> sample_data/json/volvox/tracks.conf
89+
cat docs/tutorial/data_files/volvox.gff3.conf >> sample_data/json/volvox/tracks.conf
90+
cat docs/tutorial/data_files/volvox.gtf.conf >> sample_data/json/volvox/tracks.conf
91+
cat docs/tutorial/data_files/volvox.sort.gff3.gz.conf >> sample_data/json/volvox/tracks.conf
92+
cat docs/tutorial/data_files/volvox.sort.bed.gz.conf >> sample_data/json/volvox/tracks.conf
93+
cat docs/tutorial/data_files/bookmarks.conf >> sample_data/json/volvox/tracks.conf
94+
bin/add-json.pl '{ "dataset_id": "volvox", "include": [ "../../raw/volvox/functions.conf" ] }' sample_data/json/volvox/trackList.json
95+
bin/add-json.pl '{ "dataset_id": "volvox", "plugins": [ "NeatHTMLFeatures","NeatCanvasFeatures","HideTrackLabels" ] }' sample_data/json/volvox/trackList.json
96+
bin/generate-names.pl --safeMode -v --out sample_data/json/volvox;
97+
98+
# also recreate some symlinks used by tests and such
99+
if [ -d sample_data/json/modencode ]; then
100+
mkdir -p sample_data/json/modencode/tracks;
101+
ln -sf ../../volvox/tracks/volvox_microarray.wig sample_data/json/modencode/tracks/volvox_microarray.wig;
102+
fi;
103+
mkdir -p sample_data/raw;
104+
if [ ! -e sample_data/raw/volvox ]; then
105+
ln -s ../../docs/tutorial/data_files sample_data/raw/volvox;
106+
fi;
107+
ln -sf ../../docs/tutorial/conf_files/volvox.json sample_data/raw/;
108+
109+
touch sample_data/json/volvox/successfully_run;
110+
111+
) >>setup.log 2>&1
112+
done_message "To see the volvox example data, browse to http://your.jbrowse.root/index.html?data=sample_data/json/volvox.";
113+
114+
echo
115+
echo -n "Formatting Yeast example data ...";
116+
( set -e;
117+
set -x;
118+
119+
# format volvox
120+
rm -rf sample_data/json/yeast/;
121+
bin/prepare-refseqs.pl --fasta sample_data/raw/yeast_scaffolds/chr1.fa.gz --fasta sample_data/raw/yeast_scaffolds/chr2.fa.gzip --out sample_data/json/yeast/;
122+
gunzip -c sample_data/raw/yeast_scaffolds/chr1.fa.gz sample_data/raw/yeast_scaffolds/chr2.fa.gzip > sample_data/raw/yeast_chr1+2/yeast.fa;
123+
bin/biodb-to-json.pl --conf sample_data/raw/yeast.json --out sample_data/json/yeast/;
124+
bin/add-json.pl '{ "dataset_id": "yeast" }' sample_data/json/yeast/trackList.json
125+
bin/add-json.pl '{ "dataset_id": "yeast", "plugins": [ "NeatHTMLFeatures","NeatCanvasFeatures","HideTrackLabels" ] }' sample_data/json/yeast/trackList.json
126+
bin/generate-names.pl --dir sample_data/json/yeast/;
127+
) >>setup.log 2>&1
128+
done_message "To see the yeast example data, browse to http://your.jbrowse.root/index.html?data=sample_data/json/yeast.";
129+
130+
if [ $LEGACY_INSTALL -eq 0 ] ; then
131+
legacy_message
132+
exit 0
133+
fi
134+
135+
echo
136+
echo -n "Building and installing legacy wiggle format support (superseded by BigWig tracks) ...";
137+
(
138+
set -e;
139+
if( [ ! -f bin/wig2png ] ); then
140+
set -x;
141+
cd src/wig2png;
142+
./configure && make;
143+
cd ../..;
144+
fi
145+
set -x;
146+
bin/wig-to-json.pl --key 'Image - volvox_microarray.wig' --wig docs/tutorial/data_files/volvox_microarray.wig --category "Pre-generated images" --out sample_data/json/volvox;
147+
) >>setup.log 2>&1
148+
done_message "" "If you really need wig-to-json.pl (most users don't), make sure libpng development libraries and header files are installed and try running setup.sh again.";
149+
150+
echo
151+
echo -n "Building and installing legacy bam-to-json.pl support (superseded by direct BAM tracks) ...";
152+
(
153+
set -e;
154+
155+
# try to install Bio::DB::Sam if necessary
156+
if( perl -Iextlib/lib/perl5 -Mlocal::lib=extlib -MBio::DB::Sam -e 1 ); then
157+
echo Bio::DB::Sam already installed.
158+
else
159+
if( [ "x$SAMTOOLS" == "x" ] ); then
160+
set -x;
161+
162+
if [ ! -e samtools-0.1.20 ]; then
163+
if hash curl 2>/dev/null; then
164+
curl -L https://github.com/samtools/samtools/archive/0.1.20.zip -o samtools-0.1.20.zip;
165+
else
166+
wget -O samtools-0.1.20.zip https://github.com/samtools/samtools/archive/0.1.20.zip;
167+
fi
168+
unzip -o samtools-0.1.20.zip;
169+
rm samtools-0.1.20.zip;
170+
perl -i -pe 's/^CFLAGS=\s*/CFLAGS=-fPIC / unless /\b-fPIC\b/' samtools-0.1.20/Makefile;
171+
fi;
172+
make -C samtools-0.1.20 -j3 lib;
173+
export SAMTOOLS="$PWD/samtools-0.1.20";
174+
fi
175+
echo "samtools in env at '$SAMTOOLS'";
176+
set +e;
177+
bin/cpanm -v -l extlib Bio::DB::[email protected];
178+
set -e;
179+
bin/cpanm -v -l extlib Bio::DB::[email protected];
180+
fi
181+
182+
bin/bam-to-json.pl --bam docs/tutorial/data_files/volvox-sorted.bam --tracklabel bam_simulated --key "Legacy BAM - volvox-sorted.bam" --cssClass basic --metadata '{"category": "BAM"}' --clientConfig '{"featureCss": "background-color: #66F; height: 8px", "histCss": "background-color: #88F"}' --out sample_data/json/volvox;
183+
) >>setup.log 2>&1;
184+
done_message "" "If you really need bam-to-json.pl (most users don't), try reading the Bio-SamTools troubleshooting guide at https://metacpan.org/source/LDS/Bio-SamTools-1.33/README for help getting Bio::DB::Sam installed.";

utils/jb_setup.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ var setupScript = "setup.sh";
1212
var thisPath = process.cwd();
1313

1414
// check if jbrowse is a module
15-
if (fs.pathExistsSync(thisPath+"/node_modules/jbrowse/utils/"+setupScript)) {
15+
if (fs.pathExistsSync(thisPath+"/node_modules/jbrowse/"+setupScript)) {
1616
shelljs.cd("node_modules/jbrowse");
1717
}
1818

19-
shelljs.exec("utils/setup.sh");
19+
shelljs.exec(setupScript);

0 commit comments

Comments
 (0)