def test_experiments(self):
     """
     Test the experiments method
     """
     data = {
         "accessions.csv": [
             {
                 "project_id": "ENCODE",
                 "accession_id": "ABCD",
                 "species": "H**o sapiens",
                 "cell": "cell",
                 "readType": "readType",
                 "type": "type",
                 "qualities": "qualities",
                 "dataType": "dataType",
                 "rnaExtract": "rnaExtract",
                 "localization": "localization",
                 "lab": "lab",
             }
         ]
     }
     experiments.main(data, SANDBOX)
     file_path = os.path.join(SANDBOX, "experiments.csv")
     file_content = open(file_path, "r").read()
     header = "\t".join(["project_id", "accession_id", "replicate_id"])
     line = "\t".join(["ENCODE", "ABCD", "1"])
     expected = "%s\n%s\n" % (header, line)
     self.failUnless(file_content == expected, file_content)
 def test_experiments(self):
     """
     Test the experiments method
     """
     data = {
         'accessions.csv': [{
             'project_id': 'ENCODE',
             'accession_id': 'ABCD',
             'species': 'H**o sapiens',
             'cell': 'cell',
             'readType': 'readType',
             'type': 'type',
             'qualities': 'qualities',
             'dataType': 'dataType',
             'rnaExtract': 'rnaExtract',
             'localization': 'localization',
             'lab': 'lab'
         }]
     }
     experiments.main(data, SANDBOX)
     file_path = os.path.join(SANDBOX, 'experiments.csv')
     file_content = open(file_path, 'r').read()
     header = "\t".join(['project_id', 'accession_id', 'replicate_id'])
     line = "\t".join(['ENCODE', 'ABCD', '1'])
     expected = "%s\n%s\n" % (header, line)
     self.failUnless(file_content == expected, file_content)
    def install(self):
        workspace = self.buildout['extract']['workspace']
        staging = self.options['staging']
        if not os.path.exists(staging):
            os.makedirs(staging)

        data = {}
        for source in [f for f in glob.glob(os.path.join(workspace, '*.csv'))]:
            file_name = os.path.split(source)[-1]
            target = os.path.join(staging, file_name)
            shutil.copyfile(source, target)
            data[file_name] = read_csv(target)

        accessions.main(data, staging)
        annotations.main(data, staging)
        files.main(data, staging)
        genomes.main(data, staging)
        profiles.main(data)
        experiments.main(data, staging)
        read_length.main(data, staging)
        view.main(data, staging)
    def install(self):
        workspace = self.buildout['extract']['workspace']
        staging = self.options['staging']
        if not os.path.exists(staging):
            os.makedirs(staging)

        data = {}
        for source in [f for f in glob.glob(os.path.join(workspace, '*.csv'))]:
            file_name = os.path.split(source)[-1]
            target = os.path.join(staging, file_name)
            shutil.copyfile(source, target)
            data[file_name] = read_csv(target)

        accessions.main(data, staging)
        annotations.main(data, staging)
        files.main(data, staging)
        genomes.main(data, staging)
        profiles.main(data)
        experiments.main(data, staging)
        read_length.main(data, staging)
        view.main(data, staging)