Add access control allow headers to response
Send the request to the appropriate cypher query generation function.
Args:
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.
Helper function to convert dataframe to a tree formatted in JSON
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.
Helper function to format the response.
Computes PCA over the selected samples and the given level of the hierarchy
Aggregates counts to the selected nodes in the feature hierarchy and returns the counts for the samples selected.
On start of application, checks that neo4j is running locally
Route query to the neo4j REST api. This showed the best performance compared to py2neo and python neo4j driver
Process result from cypher into a data frame with specified columns
Process result from cypher for into a dataframe
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.
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: