diff --git a/q2_pysyndna/__init__.py b/q2_pysyndna/__init__.py index 017df38..1416a78 100644 --- a/q2_pysyndna/__init__.py +++ b/q2_pysyndna/__init__.py @@ -22,3 +22,14 @@ __name__ = 'q2-pysyndna' __version__ = _version.get_versions()['version'] + +__all__ = [__plugin_name__, __package_name__, __description__, + __long_description__, __license__, __author__, __email__, + __url__, __citations_fname__, SyndnaPoolCsvFormat, + SyndnaPoolDirectoryFormat, SyndnaPoolConcentrationTable, + LinearRegressionsYamlFormat, LinearRegressionsDirectoryFormat, + LinearRegressions, PysyndnaLogFormat, PysyndnaLogDirectoryFormat, + PysyndnaLog, TSVLengthFormat, TSVLengthDirectoryFormat, Length, + CoordsFormat, CoordsDirectoryFormat, Coords, fit, count_cells, + count_copies, view_log, view_fit] + diff --git a/q2_pysyndna/_settings.py b/q2_pysyndna/_settings.py index 5f1129f..09b4024 100644 --- a/q2_pysyndna/_settings.py +++ b/q2_pysyndna/_settings.py @@ -1,4 +1,3 @@ - __plugin_name__ = 'pysyndna' __package_name__ = 'q2_pysyndna' __description__ = 'Plugin to calculate absolute microbial cell counts' @@ -9,4 +8,4 @@ __author__ = 'Amanda Birmingham' __email__ = 'abirmingham@ucsd.edu' __url__ = 'https://github.com/AmandaBirmingham/q2-pysyndna' -__citations_fname__ = 'citations.bib' \ No newline at end of file +__citations_fname__ = 'citations.bib' diff --git a/q2_pysyndna/_visualizer.py b/q2_pysyndna/_visualizer.py index 8467cca..3176a5c 100644 --- a/q2_pysyndna/_visualizer.py +++ b/q2_pysyndna/_visualizer.py @@ -89,7 +89,7 @@ def _check_context(context: dict) -> dict: def _generate_template_fps(html_fnames: list) -> list: - if not INDEX_FNAME in html_fnames: + if INDEX_FNAME not in html_fnames: html_fnames.append(INDEX_FNAME) return list(map( lambda page: os.path.join(TEMPLATES, page), html_fnames)) diff --git a/q2_pysyndna/plugin_setup.py b/q2_pysyndna/plugin_setup.py index cb46b4d..6ec09f9 100644 --- a/q2_pysyndna/plugin_setup.py +++ b/q2_pysyndna/plugin_setup.py @@ -14,7 +14,6 @@ LinearRegressionsObjects, LinearRegressions, LinearRegressionsYamlFormat, LinearRegressionsDirectoryFormat, yaml_fp_to_linear_regressions_yaml_format, - dict_to_linear_regressions_yaml_format, linear_regressions_directory_format_to_linear_regressions_objects, linear_regressions_objects_to_linear_regressions_directory_format) from q2_pysyndna._type_format_pysyndna_log import ( @@ -25,14 +24,11 @@ from q2_pysyndna._type_format_length import ( Length, TSVLengthFormat, TSVLengthDirectoryFormat, - length_fp_to_df, - df_to_tsv_length_format) + length_fp_to_df) from q2_pysyndna._type_format_coords import ( Coords, CoordsFormat, CoordsDirectoryFormat, - coords_fp_to_df, - df_to_coords_format -) + coords_fp_to_df) # plugin instantiation plugin = Plugin( @@ -108,12 +104,6 @@ def _linear_regressions_yaml_format_to_dict( return yaml_fp_to_linear_regressions_yaml_format(str(data)) -# @plugin.register_transformer -# def _dict_to_linear_regressions_yaml_format( -# data: dict) -> LinearRegressionsYamlFormat: -# return dict_to_linear_regressions_yaml_format(data) - - @plugin.register_transformer def _linear_regressions_directory_format_to_linear_regressions_objects( data: LinearRegressionsDirectoryFormat) -> LinearRegressionsObjects: @@ -133,21 +123,11 @@ def _tsv_length_format_to_df(ff: TSVLengthFormat) -> pandas.DataFrame: return length_fp_to_df(str(ff)) -# @plugin.register_transformer -# def _df_to_tsv_length_format(df: pandas.DataFrame) -> TSVLengthFormat: -# return df_to_tsv_length_format(df) - - @plugin.register_transformer def _coords_format_to_df(ff: CoordsFormat) -> pandas.DataFrame: return coords_fp_to_df(str(ff)) -# @plugin.register_transformer -# def _df_to_coords_format(df: pandas.DataFrame) -> CoordsFormat: -# return df_to_coords_format(df) - - # Method registrations plugin.methods.register_function( function=q2_pysyndna.fit, diff --git a/q2_pysyndna/tests/test_type_format_linear_regressions.py b/q2_pysyndna/tests/test_type_format_linear_regressions.py index 623bbce..cabc002 100644 --- a/q2_pysyndna/tests/test_type_format_linear_regressions.py +++ b/q2_pysyndna/tests/test_type_format_linear_regressions.py @@ -130,8 +130,8 @@ class TestLinearRegressionsTransformers(TestPluginBase): LINREGOBJ_1_2_3 = LinearRegressionsObjects( linregs_dict=TEST_DICT_1_2_3, - log_msgs_list=["The following syndnas were dropped because they had fewer " - "than 200 total reads aligned:['p166']"]) + log_msgs_list=["The following syndnas were dropped because they had " + "fewer than 200 total reads aligned:['p166']"]) @staticmethod def compare_linear_regressions_directory_formats( @@ -254,13 +254,10 @@ def test_linear_regressions_objects_to_linear_regressions_directory_format( self): rel_fps = ['linear_regressions', 'linear_regressions_minimal'] - abs_fps = [self.get_data_path(rel_fp) - for rel_fp in rel_fps] + abs_fps = [self.get_data_path(rel_fp) for rel_fp in rel_fps] input_objs = [self.LINREGOBJ_1_2_3, - LinearRegressionsObjects( - self.TEST_DICT_1, - [])] + LinearRegressionsObjects(self.TEST_DICT_1,[])] for i in range(len(abs_fps)): abs_fp = abs_fps[i] @@ -272,4 +269,4 @@ def test_linear_regressions_objects_to_linear_regressions_directory_format( for exp_obs_pair in \ self.compare_linear_regressions_directory_formats( expected_format, out_format): - self.assertEqual(exp_obs_pair[0], exp_obs_pair[1]) \ No newline at end of file + self.assertEqual(exp_obs_pair[0], exp_obs_pair[1])