In my snakemake workflow, I use deeptools bamCoverage (in a make_bigwig rule), then computeMatrix and plotProfile (in different plot_*_profile rules) to create coverage profiles for various kinds of small RNAs. It sometimes happens that there are very few reads in a particular category of small RNAs. This results in bamCoverage exiting with an error (when I use the --skipNAs option, in order to make coverage profiles not take into account empty regions):
Error: The generated bedGraphFile was empty. Please adjust
your deepTools settings and check your input files.
The fact that bamCoverage fails make things a little annoying for me, because the later the failure, the easier to handle things in my workflow: I will need to catch the error and generate a dummy output file in the make_bigwig rule, and then handle the special dummy file in the plot_*_profile rules.
I would be fine having an empty coverage file: the absence of reads (either in the bam file, or matching selection criteria in bamCoverage) is not due to an error.
Is this just not possible, by the format definition?
Did I miss an option to have bamCoverage accept making empty files?
Would this make computeMatrix fail?