Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
405c2e8
fix for excel date flaot
teharrison Aug 1, 2016
e2ffb59
Merge pull request #1027 from teharrison/develop
teharrison Aug 1, 2016
22207d9
fixed drisee counts
Aug 2, 2016
5c6bf49
Merge pull request #1028 from paczian/develop
Aug 2, 2016
616ac9b
fixed misspelled table name
Aug 2, 2016
0f3b418
Merge pull request #1029 from paczian/develop
Aug 2, 2016
8da2b50
fixed uri_(un)escape
Aug 2, 2016
7a22491
Merge pull request #1030 from paczian/develop
Aug 2, 2016
e60138d
added catch for very special attributes
Aug 2, 2016
17dd453
Merge pull request #1031 from paczian/develop
Aug 2, 2016
855d250
analysis and inbox pipelines now use docker, new clientgroups for ana…
teharrison Aug 3, 2016
b049cae
Merge pull request #1032 from teharrison/develop
teharrison Aug 3, 2016
83eb109
typo in submission
teharrison Aug 5, 2016
b7e5e96
Merge branch 'develop' of github.com:MG-RAST/MG-RAST into develop
teharrison Aug 5, 2016
d2985b6
Merge pull request #1033 from teharrison/develop
teharrison Aug 5, 2016
9958a3b
fix log spam
teharrison Aug 5, 2016
c63c69d
fix expiration on submission reciept / node
teharrison Aug 5, 2016
db24379
Merge branch 'develop' of github.com:MG-RAST/MG-RAST into develop
teharrison Aug 5, 2016
5fb0c60
Merge pull request #1034 from teharrison/develop
teharrison Aug 5, 2016
9cc75b7
better error handeling in asyncrnous postgres queries
teharrison Aug 9, 2016
e664fa3
Merge pull request #1035 from teharrison/develop
teharrison Aug 9, 2016
8c53581
perl typo
teharrison Aug 9, 2016
f58dc81
Merge pull request #1036 from teharrison/develop
teharrison Aug 9, 2016
c7e56bf
fix nested hash
teharrison Aug 9, 2016
d2c2446
Merge pull request #1037 from teharrison/develop
teharrison Aug 9, 2016
d4b39b5
fix typo
teharrison Aug 10, 2016
05a329a
Merge pull request #1038 from teharrison/develop
teharrison Aug 10, 2016
63bf90c
fix variable
teharrison Aug 10, 2016
fe59fcf
Merge pull request #1039 from teharrison/develop
teharrison Aug 10, 2016
82d5a2d
fix pipeline resources read access
teharrison Aug 11, 2016
e36aac6
Merge pull request #1040 from teharrison/develop
teharrison Aug 11, 2016
5047959
option to POST md5 list for annoatated sequences / similarity
teharrison Aug 11, 2016
3dd26ac
added sample and library to metagenome summary
Aug 12, 2016
d14f0ec
Merge pull request #1041 from paczian/develop
Aug 12, 2016
e30440a
add option to retrieve annotated reads from input md5 list, add fasta…
teharrison Aug 15, 2016
0749493
typo fixes
teharrison Aug 15, 2016
c027c2c
add support for both postgres servers
teharrison Aug 15, 2016
8165be2
adding blat sequence alignment to compute resource
teharrison Aug 15, 2016
e597663
Merge branch 'develop' of github.com:MG-RAST/MG-RAST into develop
teharrison Aug 15, 2016
6f61efc
full name
teharrison Aug 16, 2016
8e72bfe
test postgres connection
teharrison Aug 16, 2016
246615b
fix slow query join
teharrison Aug 16, 2016
f4d2054
simple test
teharrison Aug 16, 2016
9add689
perl syntax fixes
teharrison Aug 16, 2016
c56bfc0
fasta output fix
teharrison Aug 16, 2016
d95852a
fasta output fix
teharrison Aug 16, 2016
6218e96
missing perl lib
teharrison Aug 16, 2016
39df3c6
docker image / data update
teharrison Aug 16, 2016
4f0860c
more error checking
teharrison Aug 16, 2016
e32a074
complete API blast compute
teharrison Aug 16, 2016
88aeabb
add evalue option
teharrison Aug 16, 2016
249eb59
use smart host in perl code and not sendmail
teharrison Aug 17, 2016
1f3a7be
add list of read ids
teharrison Aug 17, 2016
e8600fc
change fasta header format
teharrison Aug 17, 2016
d578cd4
add back api-doc
teharrison Aug 17, 2016
0c9dce5
perl typos
teharrison Aug 17, 2016
68b2680
Merge pull request #1042 from teharrison/develop
teharrison Aug 17, 2016
3d6db97
added another dbhandle getter, because the handle got stale
Aug 26, 2016
d257799
Merge pull request #1044 from paczian/develop
Aug 26, 2016
9f0729d
added better error handling for inbox requests
Aug 29, 2016
27363a8
fix broken returns
teharrison Sep 1, 2016
4c46be5
Merge branch 'develop' of github.com:MG-RAST/MG-RAST into develop
teharrison Sep 1, 2016
5485aec
added idmap function that converts an obscurified id to a normal one …
Sep 6, 2016
065dc32
Merge pull request #1045 from paczian/develop
Sep 6, 2016
c14fc16
Merge branch 'develop' of github.com:MG-RAST/MG-RAST into develop
teharrison Sep 6, 2016
5bb2aef
stricter checking
teharrison Sep 6, 2016
1e79515
fix file name
teharrison Sep 6, 2016
31c5c65
shorten expiration time for temp nodes
teharrison Sep 6, 2016
0caf8bf
Merge pull request #1046 from teharrison/develop
teharrison Sep 7, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions bin/api2html.pl
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ sub usage {

# build the navigation
$html .= '';

foreach my $res (sort { $a->{name} cmp $b->{name} } @{$structure->{resources}}) {
$html .= '<li><a href="#'.$res->{name}.'">'.$res->{name}.'</a></li>';
}
Expand Down Expand Up @@ -142,6 +143,9 @@ sub usage {
foreach my $param (sort keys(%{$req->{attributes}})) {
my ($att_obj, $att_hash);
my $att = $param;
if (ref($req->{attributes}->{$param}) ne 'ARRAY') {
next;
}
my $att_type = $req->{attributes}->{$param}->[0];
my $att_desc = $req->{attributes}->{$param}->[1];
if ($att_type eq 'cv') {
Expand Down
2 changes: 1 addition & 1 deletion bin/download_m5nr_blast.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# set a default values
# m5nr blast files - 2.6 GB & 11.7 GB
M5NR_VERSIONS="20100309 20131215"
M5NR_VERSIONS="20100309 20120401 20131215"
TARGET="/m5nr"

for i in $M5NR_VERSIONS; do
Expand Down
13 changes: 3 additions & 10 deletions dockerfiles/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ RUN apt-get update && apt-get install -y \
libpq-dev \
make \
curl \
ncbi-blast+ \
perl-modules \
liburi-perl \
libwww-perl \
Expand Down Expand Up @@ -36,7 +37,7 @@ RUN mkdir -p /MG-RAST /var/log/httpd/api.metagenomics
COPY . /MG-RAST
RUN cd /MG-RAST && \
make && \
# make api-doc && \
make api-doc && \
cp -rv src/MGRAST/bin/* bin/. && \
cd site/CGI && \
rm -fv metagenomics.cgi linkin.cgi m5nr.cgi m5nr_rest.cgi
Expand All @@ -58,12 +59,6 @@ RUN apt-get install -y python-dev python-pip && \
ENV PERL_MM_USE_DEFAULT 1
RUN cpan Inline::Python

# setup sendmail
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install postfix && \
cp /usr/share/postfix/main.cf.debian /etc/postfix/main.cf && \
postconf -e relayhost=[smtp.mcs.anl.gov] && \
postconf -e myorigin=mcs.anl.gov

RUN mkdir -p /sites/1/ && \
cd /sites/1/ && \
ln -s /MG-RAST/
Expand All @@ -75,9 +70,7 @@ RUN cd /MG-RAST/conf && ln -s /api-server-conf/Conf.pm
RUN ln -s /api-server-conf/postgresql/ /usr/sbin/.postgresql

# m5nr blast files in mounted dir
RUN mkdir -p /m5nr && \
ln -s /api-server-data/20100309 /m5nr/20100309 && \
ln -s /api-server-data/20131215 /m5nr/20131215
RUN mkdir -p /m5nr

# Execute:
# /etc/init.d/postfix start
Expand Down
7 changes: 7 additions & 0 deletions src/MGRAST/bin/validate_metadata
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ ENVO_VER = None
LOG_FILE = None
JSON_FILE = None
INVALID = []
EXCEL_DATE_START = datetime.datetime(1899, 12, 30)
valid_email = Email()
valid_http_url = HttpUrl()
valid_name_str = string.ascii_letters+string.digits+'+-_()@; :.'
Expand Down Expand Up @@ -161,6 +162,12 @@ def validate_type(key, val, atype, name=False):
except ValueError:
return None
return unicode(dVal.date())
elif isinstance(val, float):
try:
dVal = EXCEL_DATE_START + datetime.timedelta(days=int(val))
except ValueError:
return None
return unicode(dVal.date())
else:
return None
elif atype == 'time':
Expand Down
9 changes: 5 additions & 4 deletions src/MGRAST/lib/Abundance.pm
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ use List::MoreUtils qw(natatime);
1;

sub new {
my ($class, $chdl, $version) = @_;
my ($class, $chdl, $version, $pghost) = @_;

# connect to database
my $dbh = undef;
eval {
my $host = $Conf::mgrast_dbhost;
my $host = $pghost || $Conf::mgrast_dbhost;
my $database = $Conf::mgrast_db;
my $user = $Conf::mgrast_dbuser;
my $password = $Conf::mgrast_dbpass;
Expand Down Expand Up @@ -159,7 +159,6 @@ sub all_job_abundances {
}
}
if ($org && $set->{organism}) {
print STDERR Dumper($set->{organism});
foreach my $o (@{$set->{organism}}) {
if ($tax) {
next if (($tax eq 'domain') && ($tax_map->{$o} =~ /other|unknown|unclassified/));
Expand All @@ -181,9 +180,11 @@ sub all_job_abundances {
}
};

my $total_md5 = 0;
while (my @row = $sth->fetchrow_array()) {
$md5s->{$row[0]} = $row[1];
$count++;
$total_md5++;
if ($count == $self->chunk) {
$add_annotations->();
$md5s = {};
Expand All @@ -195,7 +196,7 @@ sub all_job_abundances {
}
$self->end_query($sth);

return ($org_map, $fun_map, $ont_map);
return ($total_md5, $org_map, $fun_map, $ont_map);
}

sub all_job_md5sums {
Expand Down
19 changes: 15 additions & 4 deletions src/MGRAST/lib/JobDB/Project.pm
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,17 @@ sub metagenomes_summary {

my $project_jobs = $self->_master->ProjectJob->get_objects( {project => $self} );
my $user = $self->_master->{_user};

if (@$project_jobs > 0) {

if (@$project_jobs > 0) {
my $jdbh = $self->_master->db_handle();
my $samp_lib_hash = {};
my $mdc = $jdbh->selectall_arrayref('select Job.metagenome_id, MetaDataCollection.ID, MetaDataCollection.type from Job, MetaDataCollection where Job.primary_project='.$self->_id.' and (MetaDataCollection._id=Job.library or MetaDataCollection._id=Job.sample)', { Slice => {} });
foreach my $row (@$mdc) {
unless (exists $samp_lib_hash->{$row->{metagenome_id}}) {
$samp_lib_hash->{$row->{metagenome_id}} = {};
}
$samp_lib_hash->{$row->{metagenome_id}}->{$row->{type}} = $row->{ID};
}
my @pdata = ();
my $user_jobs = {};
my $ujr = defined($user) ? $user->has_right_to(undef, 'view', 'metagenome') : [];
Expand All @@ -499,11 +508,13 @@ sub metagenomes_summary {
$pj->seq_method,
$pj->viewable,
$pj->created_on,
{}
{},
$samp_lib_hash->{$pj->{metagenome_id}}->{sample} ? "mgs".$samp_lib_hash->{$pj->{metagenome_id}}->{sample} : undef,
$samp_lib_hash->{$pj->{metagenome_id}}->{library} ? "mgl".$samp_lib_hash->{$pj->{metagenome_id}}->{library}: undef
];
$i++;
}
my $jdbh = $self->_master->db_handle();
$jdbh = $self->_master->db_handle();
my $res = $jdbh->selectall_arrayref('SELECT tag, value, job FROM JobAttributes WHERE job IN ('.join(", ", map { $_->{_id} } @pjobs).')', { Slice => {} });
foreach my $row (@$res) {
$data[$jindices->{$row->{job}}]->[14]->{$row->{tag}} = $row->{value};
Expand Down
2 changes: 1 addition & 1 deletion src/MGRAST/lib/Pipeline.pm
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ sub template_keywords {
'ach_annotation_ver' => "1",

# awe clients
'clientgroups' => "mgrast_i2_2xlarge,mgrast_i3_xlarge",
'clientgroups' => "mgrast_dbload,mgrast_single,mgrast_multi",
'priority' => 1,

# urls
Expand Down
Loading