Ejemplo n.º 1
0
    def retrieve_dataset(self):
        connection = Connection(get_bamboo_url(self.project))
        self.dataset = CachedDataset(get_option(self.project, 'ests_dataset'),
                                     connection=connection)
        self.data = self.dataset.get_data(query={u'barcode': self.sample_id},
                                          cache=True)[0]

        self.siblings = {}
        for position in self.POSITIONS:
            if position == self.position:
                self.siblings[position] = self.sample_id
                continue
            try:
                data = self.dataset.get_data(query={u'position': position,
                                                u'block': self.data['block'],
                                                u'quadrant': self.data['quadrant'],
                                                u'cluster': self.data['cluster'],
                                                u'plot': self.data['plot'],
                                                },
                                         select=['barcode'],
                                         cache=True)[-1]
                if isinstance(data, dict):
                    data = data.get(u'barcode', u'')
            except:
                # raise
                data = None
            self.siblings[position] = data
Ejemplo n.º 2
0
def options(request):
    if not request.method == "POST":
        return ms_options(request)

    response = ms_options(request)

    # try to update bamboo datasets
    for key_prefix in ('ests1', 'ests2', 'ests3', 'ests4', 'ests5', 'ests6'):
        form = get_option(request.user.project, '%s_form' % key_prefix)
        key = '%s_dataset' % key_prefix
        if raw_getset_bamboo_dataset(request.user.project, form, key):
            messages.success(request, u"%s bamboo dataset "
                             u"retrieved successfuly." % key_prefix)
        else:
            messages.warning(request, u"Unable to retrieve %s bamboo dataset."
                             % key_prefix)

    return response
Ejemplo n.º 3
0
def get_bamboo_url(project):
    return get_option(project, 'bamboo_uri')
Ejemplo n.º 4
0
def get_bamboo_ids_dataset(project):
    return get_option(project, 'bamboo_ids_dataset')
Ejemplo n.º 5
0
def get_formhub_ids_form(project):
    return get_option(project, 'formhub_ids_form')
Ejemplo n.º 6
0
def get_formhub_ids_user(project):
    return get_option(project, 'formhub_ids_user')
Ejemplo n.º 7
0
def get_formhub_url(project):
    return get_option(project, 'formhub_uri')
Ejemplo n.º 8
0
def get_ests_dataset(project):
    connection = Connection(get_bamboo_url(project))
    return CachedDataset(get_option(project, 'ests_dataset'),
                                    connection=connection)