Skip to content

Commit

Permalink
make all plots
Browse files Browse the repository at this point in the history
  • Loading branch information
maxibor committed May 7, 2020
1 parent 780e413 commit 26b0713
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
6 changes: 4 additions & 2 deletions pydamage/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@ def analyze(bam, wlen=30, show_al=False, mini=2000, cov=0.5, process=1, outdir="

if plot and len(filt_res) > 0:
print("\nGenerating Pydamage plots")
plotdir = f"{outdir}/plots"
utils.makedir(plotdir, confirm=False)

for ref in tqdm(filt_res):
dam_plot = damageplot(damage_dict=ref, wlen=wlen, qlen = ref['qlen'], outdir=outdir)
dam_plot.makedir()
dam_plot = damageplot(damage_dict=ref, wlen=wlen, qlen = ref['qlen'], outdir=plotdir)
dam_plot.draw()
df = utils.pandas_processing(res_dict=filt_res, outdir=outdir)
return(df)
Expand Down
7 changes: 1 addition & 6 deletions pydamage/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,7 @@ def __init__(self, damage_dict, wlen, qlen, outdir):
self.contig = damage_dict['reference']
self.pvalue = damage_dict['pvalue']
self.coverage = damage_dict['coverage']
self.outdir = outdir


def makedir(self):
self.plotdir = f"{self.outdir}/plots"
utils.makedir(self.plotdir, confirm=False)
self.plotdir = outdir

def draw(self):
"""Draw pydamage plots
Expand Down

0 comments on commit 26b0713

Please sign in to comment.