Auto Generated Documentation

metavizRoute.add_cors_headers(response)

Add access control allow headers to response

Args:
response: Flask response to be sent
Returns:
response: Flask response with access control allow headers set
metavizRoute.process_api()

Send the request to the appropriate cypher query generation function.

Args:

Returns:
res: Flask response containing query result
MeasurementsRequest.get_data(in_datasource)

This function returns the set of all samples in the database. The first cypher query is finding all samples in the database. The second cypher query is used to find the mix and max count value for all features across all samples. This is return along with data source information including name and taxonomic hierarchy level names.

Args:
in_datasource: namespace to query
Returns:
result: Sample nodes information in database
HierarchyRequest.df_to_tree(root, df)

Helper function to convert dataframe to a tree formatted in JSON

Args:
root: The id of the root node of tree df: The cypher response object for query
Returns:
root: Tree at current step
HierarchyRequest.get_data(in_params_selection, in_params_order, in_params_selected_levels, in_params_nodeId, in_params_depth, in_datasource)

Finds and returns the hierarchy of the taxonomic features in the database. The hierarchy is traversed starting at the root node by using the PARENT_OF relationships the paths to until all leaf nodes are discovered. The results are formatted according the the metaviz API specification.

Args:
in_params_selection: The samples selected in_params_order: The order of the features in_params_selected_levels: The levels for aggregation of each feature node or all nodes by default in_params_nodeId: The id of the root node in_params_depth: level depth to query at in_datasource: namespace to query
Returns:
result: Heirachy of levels in database
HierarchyRequest.row_to_dict(row)

Helper function to format the response.

Args:
row: A row from the cypher response
Returns:
toRet: Dictionary to be loaded into a JSON response
PCARequest.get_data(in_params_selectedLevels, in_params_samples, in_datasource)

Computes PCA over the selected samples and the given level of the hierarchy

Args:
in_params_selectedLevels: Level of hierarchy of features to compute PCA in_params_samples: Samples to use to compute PCA in_datasource: datasource to query
Returns:
resRowsCols: PCA for the samples at the selected level
CombinedRequest.get_data(in_params_start, in_params_end, in_params_order, in_params_selection, in_params_selectedLevels, in_params_samples, in_datasource)

Aggregates counts to the selected nodes in the feature hierarchy and returns the counts for the samples selected.

Args:
in_params_start: Start of range for features to use during aggregation in_params_end: End of range for features to use during aggregation in_params_order: Order of features in_params_selection: Features nodes and the selection type of expanded, aggregated, or removed in_params_selectedLevels: Level of the hierarchy to use in_params_samples: Samples to compute aggregation with
Returns:
resRowsCols: Aggregated counts for the selected Features over the selected Samples
utils.check_neo4j()

On start of application, checks that neo4j is running locally

Args:
none
Return:
none
utils.cypher_call(query)

Route query to the neo4j REST api. This showed the best performance compared to py2neo and python neo4j driver

Args:
query: Cypher query to send to Neo4j
Returns:
rq_res: Cypher query response
utils.process_result(result)

Process result from cypher into a data frame with specified columns

Args:
result: Cypher query response object
Returns:
df: dataframe of cypher query response
utils.process_result_graph(result)

Process result from cypher for into a dataframe

Args:
result: Cypher query response object
Returns:
df: dataframe of cypher query response
PartitionsRequest.get_data(in_datasource)

Returns the range of features in the database. The cypher query finds the root of the Neo4j feature hierarchy and retrieves the start and end values which denote the range of features.

Args:
in_datasource: namspace to query
Returns:
arr: Feature range under root of tree
DiversityRequest.get_data(in_params_selectedLevels, in_params_samples, in_datasource)

Computes Alpha Diversity using the specified samples and level of hierarchy :param in_params_selectedLevels: Hierarchy level to compute Alpha Diversity :param in_params_samples: Samples to use for computing Alpha Diversity :return:

Args:
in_params_selectedLevels: Hierarchy level to compute Alpha Diversity in_params_samples: Samples to use for computing Alpha Diversity in_datasource: datasource to query
Returns:
resRowsCols: Alpha diversity for the samples at the selected level

Previous topic

Welcome to data_provider’s documentation!

This Page