johnomics / tapestry

Validate and edit small eukaryotic genome assemblies
MIT License
31 stars 2 forks source link

html report is not written #3

Closed Niicii closed 4 years ago

Niicii commented 5 years ago

Hey John,

after hearing your talk at london calling I finally have the chance to try out your tool :) I noticed that it does not write the html report if the outpath is supplied with a "/" at the end of it.

All other files except the html report are present. alignments.db assembly.fasta contig_details.tsv contigs_assembly.bam contigs_assembly.bam.bai reads_assembly.bam reads_assembly.bam.bai reads.fastq.gz

The error message printed to stdout is the following:

2019-08-19 17:53:22 INFO        Clustering contigs
2019-08-19 17:53:22 INFO        Generating contig details
2019-08-19 17:53:22 INFO        Generating Tapestry report
Traceback (most recent call last):
  File "/home/lwen/anaconda3/envs/tapestry/bin/weave", line 47, in <module>
    assembly.report()
  File "/home/lwen/anaconda3/envs/tapestry/lib/python3.7/site-packages/tapestry/assembly.py", lin                                                                                                                                         e 361, in report
    self.html_report()
  File "/home/lwen/anaconda3/envs/tapestry/lib/python3.7/site-packages/tapestry/assembly.py", lin                                                                                                                                         e 343, in html_report
    with open(f"{self.outdir}/{self.outdir}.tapestry_report.html", 'wt') as html_report:
FileNotFoundError: [Errno 2] No such file or directory: './bc14_tapestry_CCCTAA//./bc14_tapestry_CCCTAA/.tapestry_report.html'

From the error message it looks like the "/" messes up the naming of the html report because it uses the output folder name which is not stripped of the "/"

johnomics commented 5 years ago

Hi Laura, thanks for reporting this, sorry for the bug. This should be fixed in the latest GitHub commit: https://github.com/johnomics/tapestry/commit/07de57a3eb330b0e65244c5b3f0d482bfd0db0fb