return f,f.get_axes()
def plot_motif_scores(motif_scores,title="",figsize=(20,3),ylim=(0,20),xlim=None,show=True):
if show==False:
plt.ioff()
else:
plt.ion()
//remove any redundant axes
motif_scores=motif_scores.squeeze()
f=plt.figure(figsize=figsize)
plt.plot(motif_scores, "-o")
plt.xlabel("Sequence base")
After Change
def plot_motif_scores(motif_scores,title="",figsize=(20,3),ylim=(0,20),xlim=None,axes=None):
//remove any redundant axes
motif_scores=motif_scores.squeeze()
if axes is None:
f,axes=plt.subplots(1,dpi=80,figsize=figsize)
show=True
else:
show=False
axes.plot(motif_scores, "-o")
axes.set_xlabel("Sequence base")
//threshold motif scores at 0; any negative scores are noise that we do not need to visualize
if ylim!=None: