Exemplo n.º 1
0
lip = Lipidome()

lip.checksums = { "md5": "72bdc024d83226ccc90fbd2177e78d56" }
lip.study = "prediabetes"
lip.subtype = "host"

print("Creating a temp file for example/testing purposes.")
temp_file = tempfile.NamedTemporaryFile(delete=False).name
print("Local file: %s" % temp_file)

lip.local_file = temp_file

# Optional properties
lip.comment = "test lipidome comment"
lip.format = "gff3"
lip.format_doc = "the format url"

# Lipidomes are 'derived_from' MicrobiomeAssayPreps and HostAssayPreps
lip.links = { "derived_from": [ "419d64483ec86c1fb9a94025f3b93c50" ] }

lip.tags = [ "lipidome", "ihmp" ]
lip.add_tag("another")
lip.add_tag("and_another")

print(lip.to_json(indent=2))

if lip.is_valid():
    print("Valid!")

    success = lip.save()
Exemplo n.º 2
0
print("Required fields: ")
print(Lipidome.required_fields())

lip = Lipidome()

lip.checksums = {"md5": "72bdc024d83226ccc90fbd2177e78d56"}
lip.study = "prediabetes"
lip.subtype = "host"

print("Creating a temp file for example/testing purposes.")
temp_file = tempfile.NamedTemporaryFile(delete=False).name
print("Local file: %s" % temp_file)

# Optional properties
lip.comment = "test lipidome comment"
lip.format = "gff3"
lip.format_doc = "the format url"
lip.local_file = temp_file
lip.private_files = True

# Lipidomes are 'derived_from' MicrobiomeAssayPreps and HostAssayPreps
lip.links = {"derived_from": ["419d64483ec86c1fb9a94025f3b93c50"]}

lip.tags = ["lipidome", "ihmp"]
lip.add_tag("another")
lip.add_tag("and_another")

print(lip.to_json(indent=2))

if lip.is_valid():
    print("Valid!")