Skip to content

Commit e2e5561

Browse files
committed
Made SonarCloud's recommended changes NO_JIRA
1 parent f287c49 commit e2e5561

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

scripts/packing_similarity_dendrogram/packing_similarity_dendogram.py

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -193,23 +193,11 @@ def plot_tree(cluster, x_start_positions, y_start_positions, hs):
193193
# Plot tree
194194
plot_tree(cluster_list[0], xpositions, ypositions, heights)
195195

196-
# Plot formatting
197-
198-
199-
levels = range(n_ps_mols, -1, -1)
200-
highlighted_levels = range(n_ps_mols, -1, -1)
201-
# highlighted_levels.append(0)
202-
203-
# for level in highlighted_levels:
204-
# plt.plot([level, level], [0, count], "--", linewidth=0.5, color="Gray", zorder=1)
205-
206196
# Pad the plot to have enough space for structure indices
207-
# print("pad length is ",pad_length)
208197
plt.xlim(-1, n_ps_mols + pad_length)
209198
plt.ylim(0, count + 1)
210-
plt.xticks(np.arange(1,n_ps_mols+2,2)) #IJS 06/09/22 addition to replace ax.set_xticks(levels)
211-
# ax.set_xticks(levels)
212-
# ax.tick_params(axis='x', bottom='off', top='off')
199+
plt.xticks(np.arange(1,n_ps_mols+2,2)) # IJS 06/09/22 addition to replace ax.set_xticks(levels)
200+
213201
plt.xlabel('Packing Similarity / ' + str(n_ps_mols) + ' Molecules', fontsize='large')
214202
# Save output
215203
plt.savefig(filename + "_packing_similarity_tree.png", dpi=1000, bbox_inches='tight')
@@ -407,10 +395,8 @@ def main(input_file, matrix_file, n_ps_mols, output_ps_results, conf_threshold,
407395
ax.clear()
408396
plt.close()
409397

410-
411398
# Plot a dendrogram
412399
plot_dendrogram(cluster_list, n_ps_mols, input_name, pad_length)
413-
414400
print("--------------------------------------------------------")
415401

416402
sys.exit()
@@ -445,7 +431,7 @@ def main(input_file, matrix_file, n_ps_mols, output_ps_results, conf_threshold,
445431
parser.add_argument('-dt', '--dist_tol', type=float, default=0.25, metavar="0.25",
446432
help="Fractional tolerance for distances (0.0 - 1.0) used by packing similarity.")
447433
parser.add_argument('-pd', '--pad_length', type=float, default=5.0, metavar="0.25",
448-
help="padding on right of the plot for listing identifiers")#IJS 06/09/22 addition, as I hve an example with many refcodes that overspills the plot
434+
help="padding on right of the plot for listing identifiers") # IJS 06/09/22 addition, as I hve an example with many refcodes that overspills the plot
449435
args = parser.parse_args()
450436
if not os.path.isfile(args.input_file):
451437
parser.error('%s not found.' % args.input_file)
@@ -455,4 +441,4 @@ def main(input_file, matrix_file, n_ps_mols, output_ps_results, conf_threshold,
455441

456442
main(args.input_file, args.matrix, args.n_molecules, args.o, args.conf_tol, args.angle_tol,
457443
args.dist_tol, args.strip, args.n_structures, args.allow_molecular_differences,
458-
args.clustering_type,args.pad_length)
444+
args.clustering_type, args.pad_length)

0 commit comments

Comments
 (0)