Ejemplo n.º 1
0
    def testRequiredFields(self):
        required = WgsAssembledSeqSet.required_fields()

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

        self.assertTrue(len(required) > 0,
                        "required_field() did not return empty value.")
Ejemplo n.º 2
0
    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("Creating a temp file for example/testing purposes.")
temp_file = tempfile.NamedTemporaryFile(delete=False).name
print("Local file: %s" % temp_file)

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

seq_set = WgsAssembledSeqSet()

seq_set.assembler = "the assembler"
seq_set.assembly_name = "name for the assembly"
seq_set.comment = "test comment. Hello world!"
seq_set.checksums = { "md5": "72bdc024d83226ccc90fbd2177e78d56"}
seq_set.format = "fasta"
seq_set.format_doc = "the format doc"
seq_set.sequence_type = "nucleotide"
seq_set.size = 5000
seq_set.study = "prediabetes"
seq_set.links = { "computed_from": [ "b9af32d3ab623bcfbdce2ea3a502c015" ] }

# Optional properties
Ejemplo n.º 3
0
    formatter = logging.Formatter(
        '%(asctime)s - %(name)s - %(levelname)s - %(message)s')
    ch.setFormatter(formatter)
    root.addHandler(ch)


set_logging()

session = iHMPSession(username, password)

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

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

seq_set = WgsAssembledSeqSet()

seq_set.assembler = "the assembler"
seq_set.assembly_name = "name for the assembly"
seq_set.comment = "test comment. Hello world!"
seq_set.checksums = {"md5": "72bdc024d83226ccc90fbd2177e78d56"}
seq_set.format = "fasta"
seq_set.format_doc = "the format doc"
seq_set.sequence_type = "nucleotide"
seq_set.size = 5000
seq_set.study = "prediabetes"
seq_set.links = {"computed_from": ["b9af32d3ab623bcfbdce2ea3a502c015"]}

# Optional properties