Esempio n. 1
0
def convert(source_inv_fp, target_fp):
    """ Converter for ISA-Tab to SampleTab.
    :param source_inv_fp: File descriptor of input investigation file
    :param target_fp: File descriptor to write output SampleTab to (must be writeable)
    """
    ISA = isatab.load(source_inv_fp)
    sampletab.dump(ISA, target_fp)
Esempio n. 2
0
def convert(source_json_fp, target_fp):
    """ Converter for ISA-JSON to SampleTab.
    :param source_json_fp: File descriptor of input ISA JSON file
    :param target_fp: File descriptor to write output SampleTab to (must be writeable)
    """
    ISA = isajson.load(source_json_fp)
    sampletab.dump(ISA, target_fp)
Esempio n. 3
0
def convert(source_inv_fp, target_fp):
    """ Converter for ISA-Tab to SampleTab.
    :param source_inv_fp: File descriptor of input investigation file
    :param target_fp: File descriptor to write output SampleTab to (must be writeable)
    """
    log.info("loading isatab %s", source_inv_fp.name)
    ISA = isatab.load(source_inv_fp)
    log.info("dumping sampletab %s", target_fp.name)
    sampletab.dump(ISA, target_fp)
Esempio n. 4
0
def convert(source_json_fp, target_fp):
    """ Converter for ISA-JSON to SampleTab.
    :param source_json_fp: File descriptor of input ISA JSON file
    :param target_fp: File descriptor to write output SampleTab to (must be writeable)
    """
    log.info("loading isajson %s", source_json_fp.name)
    ISA = isajson.load(source_json_fp)
    log.info("dumping sampletab %s", target_fp.name)
    sampletab.dump(ISA, target_fp)
Esempio n. 5
0
 def test_sampletab_load_dump_round_trip_GSB_537(self):
     with open(os.path.join(self._sampletab_data_dir, 'GSB-537.txt')) as fp:
         ISA = sampletab.load(fp)  # load into ISA objects
         with open(os.path.join(self._tmp_dir, "out.txt"), "w") as out_fp:
             sampletab.dump(ISA, out_fp)  # dump out to SampleTab from ISA objects
         with open(os.path.join(self._tmp_dir, "out.txt"), "r") as in_fp:
             ISA = sampletab.load(in_fp)  # load into ISA objects again from dumped SampleTab and check contents
             self.assertEqual(len(ISA.studies), 1)
             sources = ISA.studies[0].sources
             samples = ISA.studies[0].samples
             self.assertEqual(len(sources), 4)
             self.assertEqual(len(samples), 80)
             self.assertEqual(len(ISA.studies[0].process_sequence), 8)