Example #1
0
    def test_sniffer(self):
        output = girder_worker.convert(
            "table",
            {
                "format": "csv",
                "url": "file://" + os.path.join("data", "test.csv")
            },
            {"format": "rows"}
        )
        self.assertEqual(len(output["data"]["fields"]), 32)
        self.assertEqual(output["data"]["fields"][:3], [
            "FACILITY", "ADDRESS", "DATE OF INSPECTION"
        ])
        self.assertEqual(len(output["data"]["rows"]), 14)

        flu = girder_worker.load(os.path.join(
            self.analysis_path, "xdata", "flu.json"))

        output = girder_worker.run(
            flu,
            inputs={},
            outputs={"data": {"type": "table", "format": "rows"}}
        )
        self.assertEqual(output["data"]["data"]["fields"][:3], [
            "Date", "United States", "Alabama"
        ])
 def test_pgls(self):
     pgls = girder_worker.load(os.path.join(self.arbor_path, 'pgls.json'))
     tree_file = os.path.join('data', 'anolis.phy')
     table_file = os.path.join('data', 'anolisDataAppended.csv')
     girder_worker.run(
         pgls,
         {
             'tree': {'format': 'newick', 'url': 'file://' + tree_file},
             'table': {'format': 'csv', 'url': 'file://' + table_file},
             'correlation': {'format': 'text', 'data': 'BM'},
             'ind_variable': {'format': 'text', 'data': 'SVL'},
             'dep_variable': {'format': 'text', 'data': 'PCI_limbs'}
         }
     )
Example #3
0
 def test_pgls(self):
     pgls = girder_worker.load(os.path.join(self.arbor_path, "pgls.json"))
     tree_file = os.path.join("data", "anolis.phy")
     table_file = os.path.join("data", "anolisDataAppended.csv")
     girder_worker.run(
         pgls,
         {
             "tree": {"format": "newick", "url": "file://" + tree_file},
             "table": {"format": "csv", "url": "file://" + table_file},
             "correlation": {"format": "text", "data": "BM"},
             "ind_variable": {"format": "text", "data": "SVL"},
             "dep_variable": {"format": "text", "data": "PCI_limbs"}
         }
     )
 def test_cont2disc(self):
     cont2disc = girder_worker.load(
         os.path.join(self.arbor_path, 'continuous_to_discrete.json'))
     table_file = os.path.join('data', 'anolisDataAppended.csv')
     girder_worker.run(
         cont2disc,
         {
             'table': {'format': 'csv', 'url': 'file://' + table_file},
             'column': {'format': 'text', 'data': 'SVL'},
             'thresh': {'format': 'number', 'data': 3.5}
         },
         {
             'newtable': {'format': 'rows'}
         }
     )
Example #5
0
 def test_cont2disc(self):
     cont2disc = girder_worker.load(
         os.path.join(self.arbor_path, "continuous_to_discrete.json"))
     table_file = os.path.join("data", "anolisDataAppended.csv")
     girder_worker.run(
         cont2disc,
         {
             "table": {"format": "csv", "url": "file://" + table_file},
             "column": {"format": "text", "data": "SVL"},
             "thresh": {"format": "number", "data": 3.5}
         },
         {
             "newtable": {"format": "rows"}
         }
     )
Example #6
0
 def test_mammal_tree(self):
     mammal = girder_worker.load(
         os.path.join("data", "Mammal tree extraction.json"))
     girder_worker.run(
         mammal,
         {
             "table": {
                 "format": "csv",
                 "url": "file://" +
                        os.path.join("data", "mammal_lnMass_tiny.csv")
             },
             "outRowCount": {"format": "number", "data": 19}
         },
         {
             "tree": {"format": "nested"}
         }
     )