def testRequiredFields(self): required = SixteenSRawSeqSet.required_fields() self.assertEqual(type(required), tuple, "required_fields() returns a tuple.") self.assertTrue(len(required) > 0, "required_field() did not return empty value.")
import json import logging from cutlass import SixteenSRawSeqSet from cutlass import iHMPSession from pprint import pprint import tempfile import sys username = "******" password = "******" session = iHMPSession(username, password) print("Required fields: ") print(SixteenSRawSeqSet.required_fields()) seq_set = SixteenSRawSeqSet() seq_set.checksums = { "md5": "72bdc024d83226ccc90fbd2177e78d56" } seq_set.comment = "test comment. Hello world!" seq_set.exp_length = 2000 seq_set.format = "fasta" seq_set.format_doc = "url" seq_set.seq_model = "a machine" seq_set.sequence_type = "nucleotide" seq_set.size = 3000 seq_set.study = "prediabetes" print("Creating a temp file for example/testing purposes.") temp_file = tempfile.NamedTemporaryFile(delete=False).name
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(SixteenSRawSeqSet.required_fields()) seq_set = SixteenSRawSeqSet() seq_set.checksums = {"md5": "72bdc024d83226ccc90fbd2177e78d56"} seq_set.comment = "test comment. Hello world!" seq_set.exp_length = 2000 seq_set.format = "fasta" seq_set.format_doc = "url" seq_set.seq_model = "a machine" seq_set.sequence_type = "nucleotide" seq_set.size = 3000 seq_set.study = "prediabetes" print("Creating a temp file for example/testing purposes.") temp_file = tempfile.NamedTemporaryFile(delete=False).name