Apps

basicApp.py

class BasicApp(title, subtitle, description, page_type, layout=[], logo=None, footer=None)[source]

Bases: object

Defines 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 footer
property layout
add_to_layout(section)[source]
extend_layout(sections)[source]
get_HTML_title()[source]
get_HTML_subtitle()[source]
get_HTML_description()[source]
add_basic_layout()[source]

Calls class functions to setup the layout: title, subtitle, description, logo and footer.

build_page()[source]

Builds page basic layout.

dataUploadApp.py

class DataUploadApp(title, subtitle, description, layout=[], logo=None, footer=None)[source]

Bases: apps.basicApp.BasicApp

Defines 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.

buildPage()[source]

Builds page with the basic layout from basicApp.py and adds relevant Dash components for project data upload.

dataUpload.py

homepageApp.py

homepageStats.py

importsApp.py

imports.py

initialApp.py

loginApp.py

class LoginApp(title, subtitle, description, layout=[], logo=None, footer=None)[source]

Bases: apps.basicApp.BasicApp

Defines the login App Enables user to access the reports

buildPage()[source]

Builds page with the basic layout from basicApp.py and adds the login form.

projectApp.py

projectCreationApp.py

class ProjectCreationApp(title, subtitle, description, layout=[], logo=None, footer=None)[source]

Bases: apps.basicApp.BasicApp

Defines what the project creation App is in the report_manager. Includes multiple fill in components to gather project information and metadata.

buildPage()[source]

Builds page with the basic layout from basicApp.py and adds relevant Dash components for project creation.

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.

Parameters
  • driver (py2neo driver) – py2neo driver, which provides the connection to the neo4j graph database.

  • projectId (str) – internal project identifier (CPxxxxxxxxxxxx).

Returns

Project external identifier.

Return type

str

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:

  1. Retrieves new project external identifier and creates project node and relationships in the graph database.

  2. Creates subjects, timepoints and intervention nodes.

  3. Saves all the entities and relationships to tab-delimited files.

  4. 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.