コード例 #1
0
ファイル: test_sample_attr.py プロジェクト: JAX-GM/cutlass
    def testRequiredFields(self):
        required = SampleAttribute.required_fields()

        self.assertEqual(type(required), tuple,
                         "required_fields() returns a tuple.")

        self.assertTrue(len(required) > 0,
                        "required_field() did not return empty value.")
コード例 #2
0
ファイル: test_sample_attr.py プロジェクト: carze/cutlass
    def testRequiredFields(self):
        """ Test the required_fields() static method. """
        required = SampleAttribute.required_fields()

        self.assertEqual(type(required), tuple,
                         "required_fields() returns a tuple.")

        self.assertTrue(
            len(required) > 0, "required_field() did not return empty value.")
コード例 #3
0
ファイル: sample_attr.py プロジェクト: JAX-GM/cutlass
import json
import logging
from cutlass import SampleAttribute
from cutlass import iHMPSession
from pprint import pprint
import tempfile
import sys

username = "******"
password = "******"

session = iHMPSession(username, password)

print("Required fields: ")
print(SampleAttribute.required_fields())

attrib = SampleAttribute()

attrib.fecalcal = "test fecalcal"
attrib.study = "prediabetes"

# SampleAttributes are 'associated_with' samples
attrib.links = { "associated_with": [ "610a4911a5ca67de12cdc1e4b4011876" ] }

attrib.tags = [ "sample_attr", "ihmp" ]
attrib.add_tag("sample")

print(attrib.to_json(indent=2))

if attrib.is_valid():
コード例 #4
0
ファイル: sample_attr.py プロジェクト: ihmpdcc/cutlass
    root = logging.getLogger()
    root.setLevel(logging.DEBUG)
    ch = logging.StreamHandler(sys.stdout)
    ch.setLevel(logging.DEBUG)
    formatter = logging.Formatter(
        '%(asctime)s - %(name)s - %(levelname)s - %(message)s')
    ch.setFormatter(formatter)
    root.addHandler(ch)


set_logging()

session = iHMPSession(username, password)

print("Required fields: ")
print(SampleAttribute.required_fields())

attrib = SampleAttribute()

attrib.fecalcal = "test fecalcal"
attrib.study = "prediabetes"

# SampleAttributes are 'associated_with' samples
attrib.links = {"associated_with": ["610a4911a5ca67de12cdc1e4b4011876"]}

attrib.tags = ["sample_attr", "ihmp"]
attrib.add_tag("sample")
attrib.sample_desc = "DNA: mom-vaginal"
attrib.sample_type = "BC1D"
attrib.subproject = "earlyPregStudy"