Skip to content
Browse files

display fixes for server side use

  • Loading branch information...
1 parent b9f5122 commit b5e8457130f810e1504934022420c435ab9b3bc7 @meren committed
Showing with 6 additions and 4 deletions.
  1. +6 −4 entropy_analysis.py
View
10 entropy_analysis.py
@@ -100,7 +100,7 @@ def get_unique_sequences(alignment, limit = 10):
return unique_sequences
-def visualize_distribution(alignment, entropy_values, output_file, quick = False, display = True):
+def visualize_distribution(alignment, entropy_values, output_file, quick = False, no_display = False):
import matplotlib.pyplot as plt
import numpy as np
@@ -144,7 +144,7 @@ def visualize_distribution(alignment, entropy_values, output_file, quick = False
plt.ylabel('Shannon Entropy')
plt.savefig(output_file)
- if display:
+ if not no_display:
plt.show()
@@ -157,8 +157,10 @@ def visualize_distribution(alignment, entropy_values, output_file, quick = False
parser.add_argument('--quick', action = 'store_true', default = False,
help = 'When set, entropy values will be shown as fast as\
possible (some visualization steps will be skipped).')
+ parser.add_argument('--no-display', action = 'store_true', default = False,
+ help = 'When set, no figures will be shown.')
args = parser.parse_args()
- entropy_values = entropy_analysis(args.alignment, output_file = args.alignment + '-ENTROPY.txt')
- visualize_distribution(args.alignment, entropy_values, output_file = args.alignment + '-ENTROPY.png', quick = args.quick)
+ entropy_values = entropy_analysis(args.alignment, output_file = args.alignment + '-ENTROPY')
+ visualize_distribution(args.alignment, entropy_values, output_file = args.alignment + '-ENTROPY.png', quick = args.quick, no_display = args.no_display)

0 comments on commit b5e8457

Please sign in to comment.
Something went wrong with that request. Please try again.