Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
141 changes: 141 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
########################################################################
# Top level makefile for MG-RAST.
#
# Jared Wilkening, Argonne National Laboratory
# Based upon work of:
# Bob Jacobsen, Lawrence Berkeley National Lab
# Ed Frank, Argonne National Laboratory
# Bob Olson, Argonne National Laboratory
########################################################################

SHELL = /bin/sh

export PWD := $(shell pwd)
export TOPDIR := $(shell /bin/pwd)
TARGET = site
export TARGETDIR = $(TOPDIR)/$(TARGET)

libdir = $(TARGETDIR)/lib
bindir = $(PWD)/bin
cgidir = $(TARGETDIR)/CGI
workdir = $(TARGETDIR)/tmp
srcdir = $(PWD)/src

TOOL_HDR := $(TOPDIR)/$(TARGET)/tool_hdr

PACKAGES := $(subst /,, $(subst $(srcdir)/,, $(dir $(wildcard $(srcdir)/*/Makefile))))

#
# OVERRIDES is a macro passed into children-makes to guide them.
#

OVERRIDES = \
TOPDIR=$(TOPDIR) \
TOOL_HDR=$(TOOL_HDR) \
libdir=$(libdir) \
bindir=$(bindir) \
cgidir=$(cgidir)

########################################################################
#
# Targets- these are actually done by the packages, except for
# a few setup-like things, eg., installdirs.
#
# Note that the behavior of package makefiles is centralized
# into ReleaseTools/standard.mk. The package makefiles only
# define a few macros to define their needs, whenever possible.
#
########################################################################

.PHONY: lib clean purge

# if you change all: make sure all: in standard.mk is consistent.

all: installdirs $(TOOL_HDR) lib

# Use the PACKAGES macro to transform lib, bin, etc., targets
# into package level dependencies, e.g., lib -> PkgA.lib, PkgB.lib
# Rules below then cause PkgA.lib to do a make in PkgaA on lib:

ALL.LIB = $(foreach var,$(PACKAGES),$(srcdir)/$(var).lib)
lib: Makefile $(ALL.LIB)

clean: Makefile purge installdirs

purge:
rm -rf $(TARGET)/bin $(TARGET)/lib $(TARGET)/tmp $(TARGET)/CGI


##
# Targets to setup the expected directory structure for the
# work directory. The work directory should be created
# with the mkworkdir command.
###

# If make installdirs is called when no packages are checked out,
# then lib and tmp are not made. So we add two rules here
# to handle that case.

installdirs: $(libdir) $(bindir) $(cgidir) $(cgidir)/Html $(cgidir)/Html/css $(workdir)
- mkdir -p $(libdir)
- mkdir -p $(workdir)
- mkdir -p $(bindir)
- mkdir -p $(cgidir)

# the subdirs are for putting python pyc etc. into

$(libdir): $(foreach var,$(PACKAGES),$(libdir)/$(var).installdirs)

$(libdir)/%.installdirs:
- mkdir -p $(@:.installdirs=)
- mkdir -p $(@:.installdirs=)Gen

$(bindir):
- mkdir -p $(bindir)

$(cgidir):
- mkdir $(cgidir)

$(cgidir)/Html:
mkdir -p $(cgidir)/Html

$(cgidir)/Html/css:
mkdir -p $(cgidir)/Html/css

$(workdir): $(foreach var,$(PACKAGES),$(workdir)/$(var).installdirs)

$(workdir)/%.installdirs:
- mkdir -p $(@:.installdirs=)

########################################################################
# Rules
#
# These rules convert PACKAGENAME.rule into make operations
# in PACKAGENAME. Real rules live in standard.mk
########################################################################

%.all:
@$(MAKE) -C $(@:.lib=) $(OVERRIDES) all

%.lib:
@$(MAKE) -C $(@:.lib=) $(OVERRIDES) lib

%.clean:
@$(MAKE) -C $(@:.clean=) $(OVERRIDES) clean

$(libdir)/$(PKGNAME)/%.pl: $(TOPDIR)/$(PKGNAME)/%.pl
cp $< $@

$(bindir)/%: $(TOPDIR)/src/$(PKGNAME)/%
cp $< $@
chmod 755 $@

$(cgidir)/Html/%: $(TOPDIR)/src/$(PKGNAME)/%
cp $< $(cgidir)/Html/.

# implementation of the decouple: steps that just build whole packages
# the .PHONY here lets us defer to the lib and bin in the package

$(TARGETDIR)/tool_hdr: $(wildcard ReleaseTools/makeScriptHeaders)
cd $(TOPDIR); $(bindir)/makeScriptHeaders $(TOOL_HDR)

19 changes: 19 additions & 0 deletions bin/makeScriptHeaders
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh

TOOL_HDR=$1

echo "#!/usr/bin/env perl

BEGIN {
unshift @INC, qw(
${TARGETDIR}/lib
${TARGETDIR}/lib/WebApplication
${TARGETDIR}/lib/PPO
${TARGETDIR}/lib/MGRAST
${TOPDIR}/conf
);
}
use Data::Dumper;
use FIG_Config;
# end of tool_hdr
########################################################################" > ${TOOL_HDR}
70 changes: 70 additions & 0 deletions conf/FIG_Config.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
package FIG_Config;

$ROOT = "/Users/jared/gitprojects/MG-RAST";

$html_base = $ROOT."/site/CGI/Html";
$bin = $ROOT."/bin";
$temp = $ROOT."/CGI/Tmp";
$incoming = $ROOT."/incoming";
$locks = $ROOT."/locks";
$temp_url = "http://localhost:8080/Tmp";
$cgi_url = "http://localhost:8080/";
$server_version = "3.1.2";
$web_memcache = "kursk-2.mcs.anl.gov:11211";

# JobDB
$mgrast_jobcache_db = 'JobDB';
$mgrast_jobcache_host = "kursk-3.mcs.anl.gov";
$mgrast_jobcache_user = "mgrast";
$mgrast_jobcache_password = "";
$mgrast_v3_jobs = "/mcs/bio/mg-rast/jobsv3";
$mgrast_jobs = "/mcs/bio/mg-rast/jobsv3";
$mgrast_data = "/mcs/bio/mg-rast/data";
$mgrast_projects = $ROOT."/projects";
$run_preprocess = $ROOT."/bin/run_preprocess.sh";
$create_job = $ROOT."/Pipeline/stages/create_and_submit_job";
$create_job_qiime = $ROOT."/Pipeline/stages/create_job_qiime";
$seq_length_stats = $ROOT."/bin/seq_length_stats";

$require_terms_of_service = 2;

# MetadataDB (now the same db as JobDB)
$mgrast_metadata_db = "JobDB";
$mgrast_metadata_host = "kursk-3.mcs.anl.gov";
$mgrast_metadata_user = "mgrast";
$mgrast_metadata_password = "";

# FormWiz
$mgrast_formWizard_templates = "$ROOT/src/MGRAST/Templates";

# OOD
$OOD_ontology_db = "MG_RAST_OOD";
$OOD_ontology_dbhost = "kursk-3.mcs.anl.gov";
$OOD_ontology_dbuser = "mgrast";

# Analysis DB
$mgrast_db = "mgrast_analysis";
$mgrast_dbms = "Pg";
$mgrast_dbuser = "mgrastprod";
$mgrast_dbhost = "kursk-3.mcs.anl.gov";

# ACH settings
$babel_db = "mgrast_ach_prod";
$babel_dbtype = "Pg";
$babel_dbuser = "mgrastprod";
$babel_dbhost = "kursk-3.mcs.anl.gov";

# Web Application
$webapplication_db = 'WebAppBackend';
$webapplication_backend = 'MySQL';
$webapplication_host = 'kursk-3.mcs.anl.gov';
$webapplication_user = 'webapplication';
$no_prefs = 1;

$mgrast_config_dir = "$ROOT/src/MGRAST/conf";
$r_executable = "/soft/packages/R/2.11.1/bin/R";
$r_scripts = "$ROOT/src/MGRAST/r/";
$fraggenescan_executable = "/soft/packages/FragGeneScan/1.15/bin/FragGeneScan";
$run_fraggenescan = "/soft/packages/FragGeneScan/1.15/bin/run_FragGeneScan.pl";

1;
1 change: 1 addition & 0 deletions site/CGI/Html/AC_OETags.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

113 changes: 113 additions & 0 deletions site/CGI/Html/Ajax.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
var request_collection = new Array();
window.onUnload = abort_requests();

// Return the path to the HTML directory.
function htmlPath() {
var metaValue = document.getElementsByName("HTML_PATH");
var retVal = "./Html";
if (metaValue.length > 0) {
retVal = metaValue[0].content;
}
return retVal;
}


function abort_requests () {
for (i=0; i<request_collection.length; i++) {
request_collection[i].abort();
}
}

function execute_ajax (sub, target, source, loading_text, no_load_image, post_hook, component, additional_parameters, return_object) {
var http_request;
var agt=navigator.userAgent.toLowerCase();
if (agt.indexOf("msie") != -1) {
no_load_image = 1;
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (err) {
alert('You must enable ActiveX in your security settings to view all features of this page.');
}
} else {
http_request = new XMLHttpRequest();
http_request.overrideMimeType('text/plain');
}

var source_form = document.getElementById(source);
var parameters = "";
if (source_form) {
var form_elements = source_form.elements;
for (i=0; i<form_elements.length; i++) {
if (! form_elements[i].name) {
continue;
}
if ((form_elements[i].type =='radio') || (form_elements[i].type == 'checkbox')) {
if (form_elements[i].checked) {
parameters = parameters + form_elements[i].name + "=" + encodeURIComponent(form_elements[i].value) + "&";
}
} else if (form_elements[i].type =='select-multiple') {
for (h=0; h<form_elements[i].options.length; h++) {
if (form_elements[i].options[h].selected) {
parameters = parameters + form_elements[i].name + '=' + encodeURIComponent(form_elements[i].options[h].value) + "&";
}
}
} else {
parameters = parameters + form_elements[i].name + "=" + encodeURIComponent(form_elements[i].value) + "&";
}
}
} else {
parameters = source + "&";
}
parameters = parameters + "sub=" + sub + "&";
if (component) {
parameters = parameters + "component=" + component + "&";
}
if (additional_parameters) {
parameters = parameters + additional_parameters + "&";
}
parameters = parameters + document.getElementById('ajax_params').value;

if (! no_load_image) {
if (! loading_text) {
loading_text = "Loading...";
}

var content = document.getElementById(target);
var img_div = document.createElement('div');
var img = document.createElement('img');
img.src = htmlPath() + '/ajax-loader.gif';
img.style.width = '20px';
img.style.height = '20px';
img_div.appendChild(img);
img_div.appendChild(document.createTextNode(loading_text));
img_div.style.position = 'absolute';
img_div.style.top = content.pageY;
img_div.style.left = content.pageX;
img_div.style.background = '#fff';
img_div.style.padding = '1px';
content.insertBefore(img_div, document.getElementById(target).firstChild);
}

var script_url = document.getElementById('ajax_url').value;
http_request.onreadystatechange = function() { ajax_result(http_request, target, post_hook); };

http_request.open('POST', script_url, true);
http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http_request.send(parameters);

// save a reference to the request
request_collection[request_collection.length] = http_request;
if (return_object == 1) {
return http_request;
}
}

function ajax_result (http_request, target, post_hook) {
if (http_request.readyState == 4) {
document.getElementById(target).innerHTML = http_request.responseText;
if (typeof(post_hook) == 'function') {
post_hook();
}
}
}
Loading