Skip to content

Commit

Permalink
Cleaned up PEP8 violations.
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelklee committed Mar 19, 2019
1 parent a9ab423 commit 33990be
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,4 +249,4 @@ def initialize_state_from_instance(self, instance: 'FancyAdamax'):
self.get_rho_m().set_value(instance.get_rho_m().get_value())
self.get_rho_u().set_value(instance.get_rho_u().get_value())
if not self.disable_bias_correction:
self.get_res_tensor().set_value(instance.get_res_tensor().get_value())
self.get_res_tensor().set_value(instance.get_res_tensor().get_value())
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def _read_sample_copy_number_log_posterior(self,
delimiter=delimiter,
comment=comment)
assert read_log_q_c_tc.shape == (self.denoising_calling_workspace.num_intervals,
self.denoising_calling_workspace.calling_config.num_copy_number_states)
self.denoising_calling_workspace.calling_config.num_copy_number_states)
return read_log_q_c_tc

def _read_sample_copy_number_log_emission(self,
Expand All @@ -271,9 +271,8 @@ def _read_sample_copy_number_log_emission(self,
io_consts.default_copy_number_log_emission_tsv_filename,
delimiter=delimiter,
comment=comment)
assert read_log_emission_tc.shape ==\
(self.denoising_calling_workspace.num_intervals,
self.denoising_calling_workspace.calling_config.num_copy_number_states)
assert read_log_emission_tc.shape == (self.denoising_calling_workspace.num_intervals,
self.denoising_calling_workspace.calling_config.num_copy_number_states)
return read_log_emission_tc

def __call__(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ def get_normalized_prob_vector(prob_vector: np.ndarray, prob_sum_tol: float) ->
else:
_logger.warning("The given probability vector ({0}) is not normalized to unity within the provided "
"tolerance ({1}); sum = {2}. Normalization was enforced. However, please check the inputs "
"for unintentional errors.".format(
prob_vector, prob_sum_tol, prob_sum))
"for unintentional errors.".format(prob_vector, prob_sum_tol, prob_sum))
return prob_vector / prob_sum


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ def __init__(self,
mean_mapping_error_correction_s = eps * read_depth_s * shared_workspace.average_ploidy_s

denoised_copy_ratio_st = ((shared_workspace.n_st - mean_mapping_error_correction_s.dimshuffle(0, 'x'))
/ ((1.0 - eps) * read_depth_s.dimshuffle(0, 'x') * bias_st))
/ ((1.0 - eps) * read_depth_s.dimshuffle(0, 'x') * bias_st))

Deterministic(name='denoised_copy_ratio_st', var=denoised_copy_ratio_st)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,4 +312,4 @@ def get_segment_quality_end(self, end_index: int, call_state: int) -> float:
self.beta_tc[end_index + 1, call_state]))
logp = logsumexp(np.asarray(complementary_paths_unnorm_logp)) - self.log_data_likelihood

return logp_to_phred(logp)
return logp_to_phred(logp)
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,7 @@ def rectify_contig(_contig: str):
for j, contig in enumerate(self.contig_list):
if rectify_contig(contig) not in all_standard_contigs:
_logger.warning("Sample {0} has an unrecognized contig ({1}). Germline contig ploidy determination "
"may not be reliable for decoy/non-standard contigs.".format(
self.sample_name, contig))
"may not be reliable for decoy/non-standard contigs.".format(self.sample_name, contig))
if rectify_contig(contig) in autosomal_contigs and self.ploidy_j[j] != homo_sapiens_autosomal_contig_ploidy:
_logger.warning("Sample {0} has an anomalous ploidy ({1}) for contig {2}. ".format(
self.sample_name, self.ploidy_j[j], contig) + general_warning_msg)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,8 +533,8 @@ def _update_discrete_posteriors(self):
# if there is a self-consistency loop and not converged ...
if not iters_converged and self.hybrid_inference_params.max_calling_iters > 1:
_logger.warning('{0} did not converge. Increase maximum calling rounds (current: {1}) '
'if this behavior persists.'.format(
self.calling_task_name, self.hybrid_inference_params.max_calling_iters))
'if this behavior persists.'.format(self.calling_task_name,
self.hybrid_inference_params.max_calling_iters))

return iters_converged

Expand Down

0 comments on commit 33990be

Please sign in to comment.