Apps¶
basicApp.py¶
-
class
BasicApp(title, subtitle, description, page_type, layout=[], logo=None, footer=None)[source]¶ Bases:
objectDefines what an App is in the report_manager. Other Apps will inherit basic functionality from this class. Attributes: Title, subtitle, description, logo, footer.
-
property
title¶
-
property
subtitle¶
-
property
description¶
-
property
page_type¶
-
property
logo¶
-
property
layout¶
-
property
dataUploadApp.py¶
-
class
DataUploadApp(title, subtitle, description, layout=[], logo=None, footer=None)[source]¶ Bases:
apps.basicApp.BasicAppDefines what the dataUpload App is in the report_manager. Used to upload experimental and clinical data to correct project folder.
Warning
There is a size limit of 55MB. Files bigger than this will have to be moved manually.
dataUpload.py¶
homepageApp.py¶
homepageStats.py¶
importsApp.py¶
imports.py¶
initialApp.py¶
loginApp.py¶
projectApp.py¶
projectCreationApp.py¶
projectCreation.py¶
-
get_project_creation_queries()[source]¶ Reads the YAML file containing the queries relevant to user creation, parses the given stream and returns a Python object (dict[dict]).
- Returns
Nested dictionary.
-
check_if_node_exists(driver, node, node_property, value)[source]¶ Queries the graph database and checks if a node with a specific property and property value already exists. :param driver: py2neo driver, which provides the connection to the neo4j graph database. :type driver: py2neo driver :param str node: node to be matched in the database. :param str node_property: property of the node. :param value: property value. :type value: str, int, float or bool :return: Pandas dataframe with user identifier if User with node_property and value already exists, if User does not exist, returns and empty dataframe.
-
get_new_project_identifier(driver, projectId)[source]¶ Queries the database for the last project external identifier and returns a new sequential identifier.
-
get_subject_number_in_project(driver, projectId)[source]¶ Extracts the number of subjects included in a given project.
- Parameters
driver (py2neo driver) – py2neo driver, which provides the connection to the neo4j graph database.
projectId (str) – external project identifier (from the graph database).
- Returns
Integer with the number of subjects.
-
create_new_project(driver, projectId, data, separator='|')[source]¶ Creates a new project in the graph database, following the steps:
Retrieves new project external identifier and creates project node and relationships in the graph database.
Creates subjects, timepoints and intervention nodes.
Saves all the entities and relationships to tab-delimited files.
Returns the number of projects created and the project external identifier.
- Parameters
driver (py2neo driver) – py2neo driver, which provides the connection to the neo4j graph database.
projectId (str) – internal project identifier (CPxxxxxxxxxxxx).
data – pandas Dataframe with project as row and other attributes as columns.
separator (str) – character used to separate multiple entries in a project attribute.
- Returns
Two strings: number of projects created and the project external identifier.