Skip to content

Commit

Permalink
Merge pull request #103 from NuttyLogic/development
Browse files Browse the repository at this point in the history
- fixed ZeroDivisionError when no alignment returned
  • Loading branch information
NuttyLogic authored Oct 20, 2020
2 parents e56a04a + a1d57e8 commit 8a55002
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion BSBolt/Utils/Launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ def process_mapping_statistics(mapping_dict):
dict(TotalReads=0, TotalAlignments=0, BSAmbiguous=0, C_C2T=0, C_G2A=0,
W_C2T=0, W_G2A=0, Unaligned=0)
processed_list = []
mappability = (mapping_dict['TotalAlignments'] - mapping_dict['Unaligned']) / mapping_dict['TotalAlignments']
try:
mappability = (mapping_dict['TotalAlignments'] - mapping_dict['Unaligned']) / mapping_dict['TotalAlignments']
except ZeroDivisionError:
mappability = '0.000%'
processed_list.append(f'Total Reads: {mapping_dict["TotalReads"]}')
processed_list.append(f'Mappability: {mappability * 100:.3f} %')
processed_list.append('------------------------------')
Expand Down
2 changes: 1 addition & 1 deletion BSBolt/Utils/Parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from BSBolt.Utils.ParserHelpMessages import aggregate_help, alignment_help, impute_help, index_help, meth_help, sim_help


parser = argparse.ArgumentParser(description='BiSulfite Bolt v1.3.5',
parser = argparse.ArgumentParser(description='BiSulfite Bolt v1.3.6',
usage='BSBolt Module {Module Arguments}')

subparsers = parser.add_subparsers(description='Please invoke BSBolt module for help,'
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def run(self):


setup(name='BSBolt',
version='1.3.5',
version='1.3.6',
description='Bisulfite Sequencing Processing Platform',
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 8a55002

Please sign in to comment.