diff --git a/bin/plot-coverage.py b/bin/plot-coverage.py index 8d63312..492ed99 100755 --- a/bin/plot-coverage.py +++ b/bin/plot-coverage.py @@ -125,7 +125,7 @@ def plot_coverage(depths: pd.DataFrame, bed: dict, sample_name: str="Sample", th longest_chrom_length = depths[depths.chrom == longest_chrom].pos.max() longest_chrom_length_mb = longest_chrom_length / 1_000_000 sns.set_style("whitegrid") - dpi = 100 + dpi = 300 width_pixels = round(longest_chrom_length_mb * width_inches_per_mb * dpi) height_pixels = round(height_inches_per_chrom * num_chroms * dpi) logging.info(f"Plot size: {width_pixels} x {height_pixels} pixels") diff --git a/modules/alignment_variants.nf b/modules/alignment_variants.nf index a12557e..43b5f30 100644 --- a/modules/alignment_variants.nf +++ b/modules/alignment_variants.nf @@ -418,12 +418,18 @@ process plot_coverage { tuple val(sample_id), path("${sample_id}_${short_long}_coverage.png"), optional: true script: + log_scale = params.coverage_plot_log_scale ? "--log-scale" : "" """ plot-coverage.py \ --sample-id ${sample_id} \ --ref ${ref} \ --depths ${depths} \ --threshold ${params.min_depth} \ + --y-limit ${params.coverage_plot_y_limit} \ + --width-inches-per-mb ${params.coverage_plot_width_inches_per_mb} \ + --height-inches-per-chrom ${params.coverage_plot_height_inches_per_chrom} \ + --window ${params.coverage_plot_window_size} \ + ${log_scale} \ --output ${sample_id}_${short_long}_coverage.png """ diff --git a/nextflow.config b/nextflow.config index a47b572..1693045 100644 --- a/nextflow.config +++ b/nextflow.config @@ -27,6 +27,11 @@ params { min_alternate_fraction_for_variant_calling = 0.1 qualimap_coverage_histogram_limit = 100 coverage_by_depth_limit = 500 + coverage_plot_y_limit = 500 + coverage_plot_log_scale = false + coverage_plot_width_inches_per_mb = 3 + coverage_plot_height_inches_per_chrom = 2 + coverage_plot_window_size = 1000 qualimap_memory = '4G' skip_alignment_cleaning = false align_long_reads = false