Skip to content

plot-bamstats fails when only one RL is in the stats file #2068

Description

@mariyeta

Trying to use plot-bamstats with samtools-1.20 but the command fails.

Command:

plot-bamstats -p mypref mytestfile.stats

Command error:

"mypref-read_length.gp", line 20: Can't plot with an empty x range!

The command exited with non-zero status 256:
	gnuplot mypref-read_length.gp

 at /usr/local/bin/plot-bamstats line 54.
	main::error("The command exited with non-zero status 256:\x{a}\x{9}gnuplot mypref-"...) called at /usr/local/bin/plot-bamstats line 339
	main::plot("mypref-read_length.gp") called at /usr/local/bin/plot-bamstats line 1335
	main::plot_read_len_hist(HASH(0x55fb79728de8)) called at /usr/local/bin/plot-bamstats line 44

In the mypref-read_length.gp the xrange is [101: 101]. The input mytestfile.stats file has only one RL:

# Read lengths. Use `grep ^RL | cut -f 2-` to extract this part. The columns are: read length, count
RL	101	1959398
# Read lengths - first fragments. Use `grep ^FRL | cut -f 2-` to extract this part. The columns are: read length, count
FRL	101	979699
# Read lengths - last fragments. Use `grep ^LRL | cut -f 2-` to extract this part. The columns are: read length, count
LRL	101	979699

When running on a stats file with multiple values for RL, the plot-bamstats command finishes successfully.

Also, should the generated HTML report include all images (as currently it looks like it is missing the *-coverage.png and *-read_length.png)?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions