Skip to content
Browse files

minor api changes: removed 'GO' source, made abundanceprofile and mat…

…rix 'id' unique for call, fixed spelling of 'Subsystems'
  • Loading branch information...
1 parent 1af1a52 commit 133a88bb0f51e20f3f5c60ad8f3af865c8bd6e76 Travis Harrison committed Dec 18, 2012
View
4 src/MGRAST/lib/resources2/abundanceprofile.pm
@@ -145,7 +145,7 @@ sub prepare_data {
map { $all_srcs->{$_->[0]} = 1 } @{$mgdb->sources_for_type('protein')};
map { $all_srcs->{$_->[0]} = 1 } @{$mgdb->sources_for_type('rna')};
} elsif ($params->{type} eq 'function') {
- map { $all_srcs->{$_->[0]} = 1 } @{$mgdb->sources_for_type('ontology')};
+ map { $all_srcs->{$_->[0]} = 1 } grep { $_->[0] !~ /^GO/ } @{$mgdb->sources_for_type('ontology')};
} elsif ($params->{type} eq 'feature') {
map { $all_srcs->{$_->[0]} = 1 } @{$mgdb->sources_for_type('protein')};
map { $all_srcs->{$_->[0]} = 1 } @{$mgdb->sources_for_type('rna')};
@@ -206,7 +206,7 @@ sub prepare_data {
}
}
- my $obj = { "id" => "mgm".$id,
+ my $obj = { "id" => "mgm".$id.'_'.$params->{type}.'_'.$params->{source},
"format" => "Biological Observation Matrix 1.0",
"format_url" => "http://biom-format.org",
"type" => $ttype." table",
View
4 src/MGRAST/lib/resources2/matrix.pm
@@ -265,7 +265,7 @@ sub prepare_data {
$self->return_data({"ERROR" => "invalid group_level for matrix call of type ".$type.": ".$glvl." - valid types are [".join(", ", @org_hier)."]"}, 500);
}
} elsif ($type eq 'function') {
- map { $all_srcs->{$_->[0]} = 1 } @{$mgdb->sources_for_type('ontology')};
+ map { $all_srcs->{$_->[0]} = 1 } grep { $_->[0] !~ /^GO/ } @{$mgdb->sources_for_type('ontology')};
if ( grep(/^$glvl$/, @func_hier) ) {
if ($glvl eq 'function') {
$glvl = ($source =~ /^[NC]OG$/) ? 'level3' : 'level4';
@@ -346,7 +346,7 @@ sub prepare_data {
push @$bcols, { id => 'mgm'.$cid, metadata => $cmd };
}
- my $obj = { "id" => join(";", map { $_->{id} } @$bcols),
+ my $obj = { "id" => join(";", map { $_->{id} } @$bcols).'_'.$glvl.'_'.$source.'_'.$rtype,
"format" => "Biological Observation Matrix 1.0",
"format_url" => "http://biom-format.org",
"type" => $ttype." table",
View
4 src/MGRAST/lib/resources2/metagenome_statistics.pm
@@ -53,7 +53,7 @@ sub new {
"COG" => [ 'list', 'COG counts' ],
"KO" => [ 'list', 'KO counts' ],
"NOG" => [ 'list', 'NOG counts' ],
- "Subsystem" => [ 'list', 'Subsystem counts' ]
+ "Subsystems" => [ 'list', 'Subsystem counts' ]
},
"source" => [ 'hash', 'evalue and % identity counts per source' ],
"rarefaction" => [ 'list', 'rarefaction coordinate data' ]
@@ -162,7 +162,7 @@ sub instance {
"COG" => $mgdb->get_ontology_stats($jid, 'COG'),
"KO" => $mgdb->get_ontology_stats($jid, 'KO'),
"NOG" => $mgdb->get_ontology_stats($jid, 'NOG'),
- "Subsystem" => $mgdb->get_ontology_stats($jid, 'Subsystem')
+ "Subsystems" => $mgdb->get_ontology_stats($jid, 'Subsystems')
},
source => $mgdb->get_source_stats($jid),
rarefaction => $mgdb->get_rarefaction_coords($jid)

0 comments on commit 133a88b

Please sign in to comment.
Something went wrong with that request. Please try again.