Skip to content

Fix read length plot for limited variation data.#2085

Merged
daviesrob merged 2 commits into
samtools:developfrom
whitwham:bamplotstat_fix
Aug 9, 2024
Merged

Fix read length plot for limited variation data.#2085
daviesrob merged 2 commits into
samtools:developfrom
whitwham:bamplotstat_fix

Conversation

@whitwham

Copy link
Copy Markdown
Member

Fixes #2068 where the limited length variations were causing the x range to be wrong. Some other changes to quiet warnings about y ranges.

@daviesrob daviesrob self-assigned this Jul 25, 2024

@daviesrob daviesrob left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a good fix for the read length plot, although in testing I found it's still possible to break plot-bamstats elsewhere by not giving it much data. E.g.:

mkdir /tmp/stats
./samtools stats test/dat/view.002.sam > /tmp/view.002.stats
./misc/plot-bamstats -p /tmp/stats/view.002 /tmp/view.002.stats 
Warning: empty x range [1:1], adjusting to [0.99:1.01]
Warning: empty x range [1:1], adjusting to [0.99:1.01]
Warning: empty x range [2:2], adjusting to [1.98:2.02]

plot '-' smooth csplines with lines lc 1 title 'First fragments' 
     ^
"/tmp/stats/view.002-gc-content.gp", line 12: Can't calculate splines, need at least 3 points

The command exited with non-zero status 256:
	gnuplot /tmp/stats/view.002-gc-content.gp

This may be something to look at in the future.

Meanwhile, #2068 (comment) notes that the read length plot doesn't appear on the html page. It doesn't look like it should be too hard to add...

Comment thread misc/plot-bamstats Outdated
Added read-length to html page.

Changed file suffix from read_length to read-length to match the other file names.
@daviesrob daviesrob merged commit 4d0d312 into samtools:develop Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants