Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added make target to build api docs #303

Merged
merged 3 commits into from
May 3, 2013
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Makefile
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ OVERRIDES = \
# if you change all: make sure all: in standard.mk is consistent. # if you change all: make sure all: in standard.mk is consistent.


all: installdirs $(TOOL_HDR) lib all: installdirs $(TOOL_HDR) lib

# Use the PACKAGES macro to transform lib, bin, etc., targets # Use the PACKAGES macro to transform lib, bin, etc., targets
# into package level dependencies, e.g., lib -> PkgA.lib, PkgB.lib # 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: # Rules below then cause PkgA.lib to do a make in PkgaA on lib:
Expand All @@ -66,6 +66,8 @@ clean: Makefile purge
purge: purge:
rm -rf $(TARGET) bin/*.r rm -rf $(TARGET) bin/*.r


api-doc:
perl src/WebApplication/scripts/api2html.pl -url http://api.metagenomics.anl.gov -outfile site/CGI/Html/api.cgi


## ##
# Targets to setup the expected directory structure for the # Targets to setup the expected directory structure for the
Expand Down Expand Up @@ -93,7 +95,7 @@ $(libdir)/%.installdirs:
$(tmpdir): $(tmpdir):
- mkdir -p $(tmpdir) - mkdir -p $(tmpdir)
- chmod a+w $(tmpdir) - chmod a+w $(tmpdir)

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


Expand Down
8 changes: 5 additions & 3 deletions src/MGRAST/lib/resources2/annotations.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ sub new {
my $self = $class->SUPER::new(@args); my $self = $class->SUPER::new(@args);


# Add name / attributes # Add name / attributes
$self->{name} = "sequences"; $self->{name} = "annotations";
$self->{attributes} = { "id" => [ 'string', 'unique object identifier' ], $self->{attributes} = { "id" => [ 'string', 'unique object identifier' ],
"data" => [ 'hash', 'annotations names pointing to list of md5s' ], "data" => [ 'hash', [ { 'key' => ['string', 'annotation text'],
'value' => ['list', ['string', 'md5sum of hit protein']] },
'annotation to md5s' ]],
"version" => [ 'integer', 'version of the object' ], "version" => [ 'integer', 'version of the object' ],
"url" => [ 'uri', 'resource location of this object instance' ] }; "url" => [ 'uri', 'resource location of this object instance' ] };
return $self; return $self;
Expand Down Expand Up @@ -48,7 +50,7 @@ sub info {
'description' => "Returns a single data object.", 'description' => "Returns a single data object.",
'method' => "GET" , 'method' => "GET" ,
'type' => "synchronous" , 'type' => "synchronous" ,
'attributes' => $self->attributes, 'attributes' => $self->{attributes},
'parameters' => { 'required' => { "id" => [ "string", "unique metagenome identifier" ] }, 'parameters' => { 'required' => { "id" => [ "string", "unique metagenome identifier" ] },
'options' => { "type" => [ "cv", [[ "organism", "return organism data" ], 'options' => { "type" => [ "cv", [[ "organism", "return organism data" ],
[ "function", "return function data" ], [ "function", "return function data" ],
Expand Down
48 changes: 26 additions & 22 deletions src/MGRAST/lib/resources2/m5nr.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -18,27 +18,31 @@ sub new {
# Add name / attributes # Add name / attributes
$self->{name} = "m5nr"; $self->{name} = "m5nr";
$self->{hierarchy} = { taxonomy => [ ['species', 'taxonomy level'], $self->{hierarchy} = { taxonomy => [ ['species', 'taxonomy level'],
['genus', 'taxonomy level'], ['genus', 'taxonomy level'],
['family', 'taxonomy level'], ['family', 'taxonomy level'],
['order', ' taxonomy level'], ['order', ' taxonomy level'],
['class', ' taxonomy level'], ['class', ' taxonomy level'],
['phylum', 'taxonomy level'], ['phylum', 'taxonomy level'],
['domain', 'top taxonomy level'] ], ['domain', 'top taxonomy level'] ],
ontology => [ ['function', 'bottom ontology level'], ontology => [ ['function', 'bottom ontology level'],
['level3', 'ontology level' ], ['level3', 'ontology level' ],
['level2', 'ontology level' ], ['level2', 'ontology level' ],
['level1', 'top ontology level'] ] ['level1', 'top ontology level'] ]
}; };
$self->{attributes} = { taxonomy => [ 'list', ['list', 'requested taxonomy levels, from highest to lowest'] ], $self->{attributes} = { taxonomy => { id => [ 'string', 'unique object identifier' ],
ontology => [ 'list', ['list', 'requested ontology levels, from highest to lowest'] ], data => [ 'list', ['list', 'requested taxonomy levels, from highest to lowest'] ],
sources => [ 'hash', [['key', ['string', 'source name']], version => [ 'integer', 'version of the object' ],
['value', ['object', [ { 'name' => ['string', 'source name'], url => [ 'uri', 'resource location of this object instance' ] },
'description' => ['string', 'description of source'], ontology => { id => [ 'string', 'unique object identifier' ],
'type' => ['string', 'type of source'], data => [ 'list', ['list', 'requested ontology levels, from highest to lowest'] ],
'link' => ['string', 'link for source id'] }, version => [ 'integer', 'version of the object' ],
'information about source' ]]] url => [ 'uri', 'resource location of this object instance' ] },
]] sources => { id => [ 'string', 'unique object identifier' ],
}; data => [ 'hash', [{'key' => ['string', 'source name'],
'value' => ['object', 'source object']}, 'source object hash'] ],
version => [ 'integer', 'version of the object' ],
url => [ 'uri', 'resource location of this object instance' ] }
};
return $self; return $self;
} }


Expand Down Expand Up @@ -67,7 +71,7 @@ sub info {
'description' => "", 'description' => "",
'method' => "GET", 'method' => "GET",
'type' => "synchronous", 'type' => "synchronous",
'attributes' => $self->attributes->{ontology}, 'attributes' => $self->{attributes}{ontology},
'parameters' => { 'options' => { 'source' => ['cv', [ ['Subsystems', 'returns 4 level SEED-Subsystems ontology' ], 'parameters' => { 'options' => { 'source' => ['cv', [ ['Subsystems', 'returns 4 level SEED-Subsystems ontology' ],
['COG', 'returns 3 level COG ontology'], ['COG', 'returns 3 level COG ontology'],
['NOG', 'returns 3 level NOG ontology'], ['NOG', 'returns 3 level NOG ontology'],
Expand All @@ -84,7 +88,7 @@ sub info {
'description' => "", 'description' => "",
'method' => "GET", 'method' => "GET",
'type' => "synchronous", 'type' => "synchronous",
'attributes' => $self->attributes->{taxonomy}, 'attributes' => $self->{attributes}{taxonomy},
'parameters' => { 'options' => { 'min_level' => ['cv', $self->{hierarchy}{taxonomy}], 'parameters' => { 'options' => { 'min_level' => ['cv', $self->{hierarchy}{taxonomy}],
'id_map' => ['boolean', 'if true overrides other options and returns a map { NCBI tax ID: [taxonomy levels] }'], 'id_map' => ['boolean', 'if true overrides other options and returns a map { NCBI tax ID: [taxonomy levels] }'],
'min_level' => ['cv', $self->{hierarchy}{taxonomy}], 'min_level' => ['cv', $self->{hierarchy}{taxonomy}],
Expand All @@ -98,7 +102,7 @@ sub info {
'description' => "", 'description' => "",
'method' => "GET", 'method' => "GET",
'type' => "synchronous", 'type' => "synchronous",
'attributes' => $self->attributes->{sources}, 'attributes' => $self->{attributes}{sources},
'parameters' => { 'options' => {}, 'parameters' => { 'options' => {},
'required' => {}, 'required' => {},
'body' => {} } 'body' => {} }
Expand Down
53 changes: 23 additions & 30 deletions src/MGRAST/lib/resources2/metadata.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -16,36 +16,29 @@ sub new {
my $self = $class->SUPER::new(@args); my $self = $class->SUPER::new(@args);


# Add name / attributes # Add name / attributes
my %rights = $self->user ? map {$_, 1} @{$self->user->has_right_to(undef, 'view', 'project')} : (); my %rights = $self->user ? map {$_, 1} @{$self->user->has_right_to(undef, 'view', 'project')} : ();
my $metadata = [ 'hash', [['key', ['string', 'metadata label']], $self->{name} = "metadata";
['value', ['object', [ { 'type' => ['string', 'value type: text, int, float, select, ontology'], $self->{rights} = \%rights;
'definition' => ['string', 'definition of label'], $self->{attributes} = { "template" => { "project" => [ 'hash', [{'key' => ['string', 'project type'],
'required' => ['boolean', 'is a required label'], 'value' => ['hash', 'hash of metadata objects by label']}, 'projects and their metadata'] ],
'mixs' => ['boolean', 'is a MIxS label'], "sample" => [ 'hash', [{'key' => ['string', 'sample type'],
'aliases' => ['list', ['string', 'alternative name for label']] 'value' => ['hash', 'hash of metadata objects by label']}, 'samples and their metadata'] ],
}, 'information about metadata keyword' ]]] ] "library" => [ 'hash', [{'key' => ['string', 'library type'],
]; 'value' => ['hash', 'hash of metadata objects by label']}, 'libraries and their metadata'] ],
$self->{name} = "metadata"; "ep" => [ 'hash', [{'key' => ['string', 'enviromental package type'],
$self->{rights} = \%rights; 'value' => ['hash', 'hash of metadata objects by label']}, 'eps and their metadata'] ] },
$self->{attributes} = { "template" => { "project" => [ 'hash', ['key', ['string', 'project type']], "cv" => { "ontology" => [ 'hash', [{'key' => ['string', 'metadata label'],
['value', ['object', [$metadata, 'available metadata for this project type']]] ], 'value' => ['int', 'bioportal ontology ID']}, 'ontology IDs for metadata'] ],
"sample" => [ 'hash', ['key', ['string', 'sample type']], "ont_id" => [ 'hash', [{'key' => ['string', 'metadata label'],
['value', ['object', [$metadata, 'available metadata for this sample type']]] ], 'value' => ['int', 'bioportal term ID']}, 'term IDs for metadata'] ],
"library" => [ 'hash', ['key', ['string', 'library type']], "select" => [ 'hash', [{'key' => ['string', 'metadata label'],
['value', ['object', [$metadata, 'available metadata for this library type']]] ], 'value' => ['list', ['string', 'CV term']]}, 'list of CV terms for metadata'] ] },
"ep" => [ 'hash', ['key', ['string', 'enviromental package type']], "export" => { "id" => [ 'string', 'unique object identifier' ],
['value', ['object', [$metadata, 'available metadata for this ep type']]] ] }, "name" => [ 'string', 'human readable identifier' ],
"cv" => { "ontology" => [ 'hash', ['key', ['string', 'metadata label']], "samples" => [ 'list', [ 'object', 'sample object containing sample metadata, sample libraries, sample envPackage' ] ],
['value', ['int', 'bioportal ontology ID']] ], "sampleNum" => [ 'int', 'number of samples in project' ],
"ont_id" => [ 'hash', ['key', ['string', 'metadata label']], "data" => [ 'hash', [{'key' => ['string', 'metadata label'],
['value', ['int', 'bioportal term ID']] ], 'value' => ['object', 'project metadata objects']}, 'hash of metadata by label'] ] },
"select" => [ 'hash', ['key', ['string', 'metadata label']],
['value', ['int', 'list of available CV terms']] ] },
"export" => { "id" => [],
"name" => [],
"samples" => [],
"sampleNum" => [],
"data" => [] },
"validate_post" => { 'is_valid' => [ 'boolean', 'the inputed value is valid for the given category and label' ], "validate_post" => { 'is_valid' => [ 'boolean', 'the inputed value is valid for the given category and label' ],
'metadata' => [ 'object', 'valid metadata object for project and its samples and libraries' ] }, 'metadata' => [ 'object', 'valid metadata object for project and its samples and libraries' ] },
"validate_get" => { 'is_valid' => [ 'boolean', 'the inputed value is valid for the given category and label' ], "validate_get" => { 'is_valid' => [ 'boolean', 'the inputed value is valid for the given category and label' ],
Expand Down
2 changes: 1 addition & 1 deletion src/MGRAST/lib/resources2/metagenome.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ sub new {
"version" => [ 'integer', 'version of the object' ], "version" => [ 'integer', 'version of the object' ],
"url" => [ 'uri', 'resource location of this object instance' ], "url" => [ 'uri', 'resource location of this object instance' ],
"status" => [ 'cv', [ ['public', 'object is public'], "status" => [ 'cv', [ ['public', 'object is public'],
['private', 'object is private'] ] ], ['private', 'object is private'] ] ],
"sequence_type" => [ 'string', 'sequencing type' ] "sequence_type" => [ 'string', 'sequencing type' ]
}; };
return $self; return $self;
Expand Down
44 changes: 11 additions & 33 deletions src/MGRAST/lib/resources2/metagenome_statistics.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -22,39 +22,17 @@ sub new {
$self->{mgdb} = undef; $self->{mgdb} = undef;
$self->{attributes} = { $self->{attributes} = {
"id" => [ 'string', 'unique metagenome id' ], "id" => [ 'string', 'unique metagenome id' ],
"length_histogram" => { "length_histogram" => [ 'hash', [{'key' => ['string', 'pipeline stage'],
"upload" => [ 'list', 'length distribution of uploaded sequences' ], 'value' => ['list', 'length distribution of sequences in pipeline stage']}, 'length histograms for pipeline stages'] ],
"post_qc" => [ 'list', 'length distribution of post-qc sequences' ] "gc_histogram" => [ 'hash', [{'key' => ['string', 'pipeline stage'],
}, 'value' => ['list', 'gc % distribution of sequences in pipeline stage']}, 'gc % histograms for pipeline stages'] ],
"gc_histogram" => { "qc" => [ 'hash', [{'key' => ['string', 'QC type'],
"upload" => [ 'list', 'gc % distribution of uploaded sequences' ], 'value' => ['object', 'QC statistics object']}, 'set of QC statistics'] ],
"post_qc" => [ 'list', 'gc % distribution of post-qc sequences' ]
},
"qc" => {
"kmer" => { "6_mer" => {"columns" => ['list', 'names of columns'], "data" => ['list', 'kmer 6 counts']},
"15_mer" => {"columns" => ['list', 'names of columns'], "data" => ['list', 'kmer 15 counts']} },
"drisee" => { "counts" => {"columns" => ['list', 'names of columns'], "data" => ['list', 'drisee count profile']},
"percents" => {"columns" => ['list', 'names of columns'], "data" => ['list', 'drisee percent profile']},
"summary" => {"columns" => ['list', 'names of columns'], "data" => ['list', 'drisee summary stats']} },
"bp_profile" => { "counts" => {"columns" => ['list', 'names of columns'], "data" => ['list', 'nucleotide count profile']},
"percents" => {"columns" => ['list', 'names of columns'], "data" => ['list', 'nucleotide percent profile']} }
},
"sequence_stats" => [ 'hash', 'statistics on sequence files of all pipeline stages' ], "sequence_stats" => [ 'hash', 'statistics on sequence files of all pipeline stages' ],
"taxonomy" => { "taxonomy" => [ 'hash', [{'key' => ['string', 'taxonomic level'],
"species" => [ 'list', 'species counts' ], 'value' => ['list', ['tuple', 'taxanomic name and abundance']]}, 'set of abundaces per taxonomic levels'] ],
"genus" => [ 'list', 'genus counts' ], "ontology" => [ 'hash', [{'key' => ['string', 'ontology source'],
"family" => [ 'list', 'family counts' ], 'value' => ['list', ['tuple', 'ontology name and abundance']]}, 'set of abundaces per ontology group'] ],
"order" => [ 'list', 'order counts' ],
"class" => [ 'list', 'class counts' ],
"phylum" => [ 'list', 'phylum counts' ],
"domain" => [ 'list', 'domain counts' ]
},
"ontology" => {
"COG" => [ 'list', 'COG counts' ],
"KO" => [ 'list', 'KO counts' ],
"NOG" => [ 'list', 'NOG counts' ],
"Subsystems" => [ 'list', 'Subsystem counts' ]
},
"source" => [ 'hash', 'evalue and % identity counts per source' ], "source" => [ 'hash', 'evalue and % identity counts per source' ],
"rarefaction" => [ 'list', 'rarefaction coordinate data' ] "rarefaction" => [ 'list', 'rarefaction coordinate data' ]
}; };
Expand Down Expand Up @@ -84,7 +62,7 @@ sub info {
'description' => "Returns a JSON structure of statistical information.", 'description' => "Returns a JSON structure of statistical information.",
'method' => "GET" , 'method' => "GET" ,
'type' => "synchronous" , 'type' => "synchronous" ,
'attributes' => $self->attributes, 'attributes' => $self->{attributes},
'parameters' => { 'options' => { 'verbosity' => ['cv', 'parameters' => { 'options' => { 'verbosity' => ['cv',
[['minimal','returns only sequence_stats attribute'], [['minimal','returns only sequence_stats attribute'],
['verbose','returns all but qc attribute'], ['verbose','returns all but qc attribute'],
Expand Down
6 changes: 3 additions & 3 deletions src/MGRAST/lib/resources2/project.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ sub new {
$self->{attributes} = { "id" => [ 'string', 'unique object identifier' ], $self->{attributes} = { "id" => [ 'string', 'unique object identifier' ],
"name" => [ 'string', 'human readable identifier' ], "name" => [ 'string', 'human readable identifier' ],
"libraries" => [ 'list', [ 'reference library', 'a list of references to the related library objects' ] ], "libraries" => [ 'list', [ 'reference library', 'a list of references to the related library objects' ] ],
"samples" => [ 'list', [ 'reference sample', 'a list of references to the related sample objects' ] ], "samples" => [ 'list', [ 'reference sample', 'a list of references to the related sample objects' ] ],
"analyzed" => [ 'list', [ 'reference metagenome', 'a list of references to the related metagenome objects' ] ], "analyzed" => [ 'list', [ 'reference metagenome', 'a list of references to the related metagenome objects' ] ],
"description" => [ 'string', 'a short, comprehensive description of the project' ], "description" => [ 'string', 'a short, comprehensive description of the project' ],
"funding_source" => [ 'string', 'the official name of the source of funding of this project' ], "funding_source" => [ 'string', 'the official name of the source of funding of this project' ],
"pi" => [ 'string', 'the first and last name of the principal investigator of the project' ], "pi" => [ 'string', 'the first and last name of the principal investigator of the project' ],
Expand All @@ -31,7 +31,7 @@ sub new {
"version" => [ 'integer', 'version of the object' ], "version" => [ 'integer', 'version of the object' ],
"url" => [ 'uri', 'resource location of this object instance' ], "url" => [ 'uri', 'resource location of this object instance' ],
"status" => [ 'cv', [ ['public', 'object is public'], "status" => [ 'cv', [ ['public', 'object is public'],
['private', 'object is private'] ] ] ['private', 'object is private'] ] ]
}; };
return $self; return $self;
} }
Expand Down
Loading