<commit_before># <A NAME="top"></A>![alt text](https://avatars2.githubusercontent.com/u/1263946?v=3&s=84 "KBase") [KBase SDK](../README.md)

1. [Install SDK Dependencies](kb_sdk_dependencies.md)
2. [Install SDK with Docker](kb_sdk_dockerized_install.md)
3. [Create Module](kb_sdk_create_module.md)
4. [Specify Module and Method(s)](kb_sdk_edit_module.md)
5. **Implement Method(s)**
6. [Specify User Interface](kb_sdk_make_ui.md)
7. [Locally Test Module and Method(s)](kb_sdk_local_test_module.md)
8. [Register Module](kb_sdk_register_module.md)
9. [Test in KBase](kb_sdk_test_in_kbase.md)
10. [Complete Module Info](kb_sdk_complete_module_info.md)
11. [Deploy](kb_sdk_deploy.md)

### <A NAME="impl"></A>5. Implement Method(s)

In the lib/\<MyModule> directory, edit the <MyModule>Impl.py (or *Impl.pl or *Server.java) "Implementation" file that 
defines the methods available in the module. The example module is very simple and implemented directly in this file
but it is better practice and more readable to separate implementation logic into multiple files, especially for modules 
containing more than one method. 

The workflow of most modules involves obtaining data from the KBase data stores, operating on that data (possibly with 3rd party 
code or executables), storing resulting data in the data stores, and producing a report of the work accomplished for the user.
This step of the guide will walk through this process and present some of the utility modules that help facilitate this work.

- A. [Install Other KBase Modules](#install)
- B. [Import and Initialise](#import)
- C. [Validating user input](#validate)
- D. [Adding Reference Data to Your Method](#impl-adding-data)
- E. [Interacting with KBase data stores (Workspaces)](#get-save-data)
- F. [Invoking Shell Tool](#impl-shell-tool)
- G. [Building Output Report](#impl-report)

#### <A NAME="install"></A>A. Install Other KBase Modules

If you begin by altering an existing app (as this walkthough demonstrates) you will already have some KBase utility 
modules in your lib directory. To install additional packages run `kb-sdk install <module name>` from the terminal.
Here's an sample of some of the modules that might be helpful for your app:

* [KBaseReport](https://appdev.kbase.us/#catalog/modules/KBaseReport) - Allows the creation of KBase 
reports which can present text, html, and downloadable files to the user as output to your app.
* [GenomeFileUtil](https://appdev.kbase.us/#catalog/modules/ReadsUtils) - Import/Export and Upload/Download 
of Genome data
*[AssemblyUtils](https://appdev.kbase.us/#catalog/modules/ReadsAlignmentUtils) - Provides tooling for interacting <commit_msg>Update kb_sdk_impl_methods.md<commit_after># <A NAME="top"></A>![alt text](https://avatars2.githubusercontent.com/u/1263946?v=3&s=84 "KBase") [KBase SDK](../README.md)

1. [Install SDK Dependencies](kb_sdk_dependencies.md)
2. [Install SDK with Docker](kb_sdk_dockerized_install.md)
3. [Create Module](kb_sdk_create_module.md)
4. [Specify Module and Method(s)](kb_sdk_edit_module.md)
5. **Implement Method(s)**
6. [Specify User Interface](kb_sdk_make_ui.md)
7. [Locally Test Module and Method(s)](kb_sdk_local_test_module.md)
8. [Register Module](kb_sdk_register_module.md)
9. [Test in KBase](kb_sdk_test_in_kbase.md)
10. [Complete Module Info](kb_sdk_complete_module_info.md)
11. [Deploy](kb_sdk_deploy.md)

### <A NAME="impl"></A>5. Implement Method(s)

In the lib/\<MyModule> directory, edit the \<MyModule>Impl.py (or *Impl.pl or *Server.java) "Implementation" file that 
defines the methods available in the module. The example module is very simple and implemented directly in this file
but it is better practice and more readable to separate implementation logic into multiple files, especially for modules 
containing more than one method. 

The workflow of most modules involves obtaining data from the KBase data stores, operating on that data (possibly with 3rd party 
code or executables), storing resulting data in the data stores, and producing a report of the work accomplished for the user.
This step of the guide will walk through this process and present some of the utility modules that help facilitate this work.

- A. [Install Other KBase Modules](#install)
- B. [Import and Initialise](#import)
- C. [Validating user input](#validate)
- D. [Adding Reference Data to Your Method](#impl-adding-data)
- E. [Interacting with KBase data stores (Workspaces)](#get-save-data)
- F. [Invoking Shell Tool](#impl-shell-tool)
- G. [Building Output Report](#impl-report)

#### <A NAME="install"></A>A. Install Other KBase Modules

If you begin by altering an existing app (as this walkthough demonstrates) you will already have some KBase utility 
modules in your lib directory. To install additional packages run `kb-sdk install <module name>` from the terminal.
Here's an sample of some of the modules that might be helpful for your app:

* [KBaseReport](https://appdev.kbase.us/#catalog/modules/KBaseReport) - Allows the creation of KBase 
reports which can present text, html, and downloadable files to the user as output to your app.
* [GenomeFileUtil](https://appdev.kbase.us/#catalog/modules/ReadsUtils) - Import/Export and Upload/Download 
of Genome data
*[AssemblyUtils](https://appdev.kbase.us/#catalog/modules/ReadsAlignmentUtils) - Provides tooling for interacting 
{'fraction_non_alphanumeric': 0.10536147954418083, 'fraction_numerical': 0.009714178965066317, 'mean_word_length': 5.2546728971962615, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7628455', 'n_tokens_mistral': 1661, 'n_tokens_neox': 1566, 'n_words': 603}