Beispiel #1
0
def build_institute(internal_id, display_name, sanger_recipients=None,
                    coverage_cutoff=None, frequency_cutoff=None):
    """Build a institute object

    Args:
        internal_id(str)
        display_name(str)
        sanger_recipients(list(str)): List with email addresses

    Returns:
        institute_obj(scout.models.Institute)

    """

    LOG.info("Building institute %s with display name %s", internal_id,display_name)

    institute_obj = Institute(
        internal_id=internal_id, 
        display_name=display_name, 
        sanger_recipients=sanger_recipients,
        coverage_cutoff = coverage_cutoff,
        frequency_cutoff = frequency_cutoff
    )
    
    for key in list(institute_obj):
        if institute_obj[key] is None:
            institute_obj.pop(key)

    return institute_obj
Beispiel #2
0
def build_institute(internal_id,
                    display_name,
                    sanger_recipients=None,
                    coverage_cutoff=None,
                    frequency_cutoff=None):
    """Build a institute object

    Args:
        internal_id(str)
        display_name(str)
        sanger_recipients(list(str)): List with email addresses

    Returns:
        institute_obj(scout.models.Institute)

    """

    LOG.info("Building institute %s with display name %s", internal_id,
             display_name)

    institute_obj = Institute(internal_id=internal_id,
                              display_name=display_name,
                              sanger_recipients=sanger_recipients,
                              coverage_cutoff=coverage_cutoff,
                              frequency_cutoff=frequency_cutoff)

    for key in list(institute_obj):
        if institute_obj[key] is None:
            institute_obj.pop(key)

    return institute_obj
Beispiel #3
0
    def add_institute(self, internal_id, display_name):
        """Add a institute to the database

            Args:
                internal_id(str): The internal id (like cust003)
                display_name(str): The display name for a institute (like CMMS)
        """
        logger.info("Creating institute with internal_id: {0} and"\
                    " display_name: {1}".format(internal_id, display_name))
        institute = Institute(
            internal_id=internal_id,
            display_name=display_name
        )
        institute.save()
Beispiel #4
0
def get_institute(request):
    print('')
    logger.info("setup a institute")
    institute = Institute(
        internal_id='cust000',
        display_name='clinical'
    )
    logger.info("Adding institute to database")
    institute.save()
    def teardown():
        print('\n')
        logger.info('Removing institute')
        institute.delete()
        logger.info('Institute removed')
    request.addfinalizer(teardown)
    
    return institute
Beispiel #5
0
def build_institute(
    internal_id,
    display_name,
    loqusdb_id=None,
    sanger_recipients=None,
    collaborators=None,
    phenotype_groups=None,
    cohorts=None,
    coverage_cutoff=None,
    frequency_cutoff=None,
):
    """Build a institute object

    Args:
        internal_id(str)
        display_name(str)
        sanger_recipients(list(str)): List with email addresses
        collaborators(list(str)): List of institute _id to enable sharing with
        phenotype_groups(list(phenotype)): List of phenotype groups
        cohorts(list(str)): List of cohorts
    Returns:
        institute_obj(scout.models.Institute)

    """

    LOG.info("Building institute %s with display name %s", internal_id,
             display_name)

    institute_obj = Institute(
        internal_id=internal_id,
        display_name=display_name,
        sanger_recipients=sanger_recipients,
        loqusdb_id=loqusdb_id,
        collaborators=collaborators,
        phenotype_groups=phenotype_groups,
        cohorts=cohorts,
        coverage_cutoff=coverage_cutoff,
        frequency_cutoff=frequency_cutoff,
    )

    for key in list(institute_obj):
        if institute_obj[key] is None:
            institute_obj.pop(key)

    return institute_obj
Beispiel #6
0
def get_institute(institute_name):
  """
  Take a institute name and return a institute object.

  Args:
    institute_name: A string that represents the name of an institute

  Returns:
    A mongoengine Institute object described in scout.models.institute.py
  """
  return Institute(internal_id=institute_name, display_name=institute_name)