예제 #1
0
#!/usr/bin/env python

import os
import sys
import json
import logging

from cutlass import iHMPSession

import settings
from cutlass_utils import \
        load_data, get_parent_node_id, list_tags, format_query, \
        write_csv_headers, values_to_node_dict, write_out_csv, \
        get_field_header, dump_args, log_it

log = log_it('osdf_submit')
log.info('Starting metadata submission to OSDF server.')

# load username, password from files
dcc_user = settings.auth.dcc_user
dcc_pass = settings.auth.dcc_pass
session = iHMPSession(dcc_user, dcc_pass)
log.info('Loaded session: {}'.format(session.get_session()))

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Main Actions ~~~~~

def main():
    """make it happen!"""

    """ Project node """
    # Predefined_id_from_osdf_for_overall_iHMP_project
예제 #2
0
#!/usr/bin/env python
""" load Visit into OSDF using info from data file """

import os
import re

from cutlass.Visit import Visit

import settings
from cutlass_utils import \
        load_data, get_parent_node_id, list_tags, format_query, \
        write_csv_headers, values_to_node_dict, write_out_csv, \
        load_node, get_field_header, dump_args, log_it

filename=os.path.basename(__file__)
log = log_it(filename)

# the Higher-Ups
node_type          = 'visit'
parent_type        = 'subject'
grand_parent_type  = 'study'
great_parent_type  = 'project'
node_tracking_file = settings.node_id_tracking.path

class node_values:
    visit_id = ''
    visit_number = ''
    interval = ''
    clinic_id = ''
    tags = ['rand_subject_id: ','sub_study: ','study: ']
예제 #3
0
#!/usr/bin/env python

import sys

from cutlass import iHMPSession

from settings import auth
from settings import NodeRetrievalFiles
from cutlass_utils import log_it, format_query
from cutlass_search import retrieve_nodes, retrieve_query_all

log = log_it('retrieve_osdf_nodes')
log.info('Starting metadata download from OSDF server.')

# load username, password from files
session = iHMPSession(auth.dcc_user, auth.dcc_pass, ssl=False)
log.info('Loaded session: {}'.format(session.get_session()))

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Main Actions ~~~~~
def retrieve_node_type(session, node_type):
    data_file_name = NodeRetrievalFiles[node_type]
    qry = '&&'.join([format_query("prediabetes", field="tags"),
                     format_query(node_type, field="node_type")])
    log.debug("query: %s", qry)
    retrieve_query_all(session, qry, data_file_name)


def main():
    """make it happen!"""

    """ Subject node """
예제 #4
0
import os
import re
import json
import yaml
import logging

import settings
from cutlass_utils import \
        load_data, get_parent_node_id, list_tags, format_query, \
        write_csv_headers, values_to_node_dict, write_out_csv, \
        load_node, get_field_header, dump_args, log_it

log = log_it(__name__)
예제 #5
0
#!/usr/bin/env python

import sys

from cutlass import iHMPSession

from settings import auth
from settings import NodeUpdateFiles
from cutlass_utils import log_it
from cutlass_search import update_nodes, delete_nodes

log = log_it('jax_osdf_update')
log.info('Starting metadata submission to OSDF server.')

# load username, password from files
dcc_user = auth.dcc_user
dcc_pass = auth.dcc_pass
session = iHMPSession(dcc_user, dcc_pass, ssl=False)
log.info('Loaded session: {}'.format(session.get_session()))
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Main Actions ~~~~~


def main():
    """make it happen!"""

    # study_name = 'prediabetes'
    # study_node_id = '194149ed5273e3f94fc60a9ba58f7c24'

    """ Subject node """
    # update_nodes(session, NodeUpdateFiles['Subject'], 'subject')
    """ Visit node """
예제 #6
0
파일: study.py 프로젝트: JAX-GM/osdf_submit
from cutlass.Study import Study

from cutlass_utils import log_it
import settings

# filename=os.path.basename(__file__)
# log = log_it(filename)

# Log It!
import os, logging # needed for LogIt function!
def log_it(filename=os.path.basename(__file__)):
    """log_it setup"""
    logging.basicConfig(level=logging.DEBUG,
        format="%(asctime)s %(levelname)s %(funcName)s: %(message)s")
    return logging.getLogger(filename)
log = log_it()

node_type='study'
parent_type = 'project'
node_tracking_file = settings.node_id_tracking.path


class node_values:
    name = 'prediabetes'
    description = 'Type 2 diabetes mellitus (T2D) is a significant health problem facing our nation. Close to 20 million individuals in the United States have T2D, and 79 million aged 20 years or older are clinically pre-diabetic, with a 5-year conversion rate of 10% to 23% from prediabetes to T2D. In a collaborative effort to systematically understand diabetes and its etiology, the team is comprised of leading experts in research on both the human host as well as the microbiome, as properties of both are likely relevant in ' #T2D development. For a better elucidation of mechanisms of onset and progression of T2D disease, the group is performing a detailed analysis of the biological processes that occur in the microbiome and human host by longitudinal profiling of patients at risk for T2D. Both microbiome and host profiles are being analyzed by state-of-the-art omics platforms, and these large-scale and diverse data sets will be integrated to determine the dynamic pathways that change during the onset and progression of T2D, especially during viral infections and other stresses. This longitudinal study is expected to reveal changes in the microbiome and host at an unprecedented level of detail, and identify molecules and pathways that play important roles in diabetes onset and progression.'
    center = 'Stanford University / Jackson Laboratory'
    contact = 'Wenyu Zhou <*****@*****.**>'
    subtype = 'prediabetes'
    tags = [ 'prediabetes', 'overeaters', ]

# print("Required fields: {}".format(OSDFNode.required_fields()))
예제 #7
0
#!/usr/bin/env python

import os
import sys
import json
import logging

from cutlass import iHMPSession

import settings
from cutlass_utils import \
        load_data, get_parent_node_id, list_tags, format_query, \
        write_csv_headers, values_to_node_dict, \
        get_field_header, dump_args, log_it

log = log_it('jax_osdf_submit')
log.info('Starting metadata submission to OSDF server.')

# load username, password from files
dcc_user = settings.auth.dcc_user
dcc_pass = settings.auth.dcc_pass
session = iHMPSession(dcc_user, dcc_pass, ssl=False)
log.info('Loaded session: {}'.format(session.get_session()))

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Main Actions ~~~~~

def main():
    """make it happen!"""

    """ Project node """
    # Predefined_id_from_osdf_for_overall_iHMP_project