aineniamh / snipit

snipit: summarise snps relative to your reference sequence
GNU General Public License v3.0
141 stars 28 forks source link

add "--flip-vertical" argument to flip Y axis so sequences appear below reference #1

Closed tomkinsc closed 3 years ago

tomkinsc commented 3 years ago

Thanks so much for making snipit, @aineniamh. I learned about it as a result of your excellent ASM NGS conference talk today. The plots it makes are beautiful.

I'm not sure how welcome contributions may be, or if there are contribution/style guidelines I should be following, but I made a small prospective addition:

This PR introduces a new argument, --flip-vertical, which, if specified, inverts the y-axis so sequence patches and text are drawn below the reference sequence rather than above (for those who prefer such a view—could be better for print). It does this by calling ax.invert_yaxis() after the y-axis limits have been set if --flip-vertical is specified. This way all drawing can be done as usual with no change to the coordinate space, though some tweaks to aligned elements may be necessary in places; for example, when the plot is flipped vertically the text alignment of the numeric position labels is toggled so they align to suit with the new orientation. This PR also includes a .gitignore file so *.pyc etc. files are ignored from commits, and a few small changes that are evident from the diffs.

Unrelated to this PR, but I also made a bioconda recipe for snipit since I saw it was released under an open license—I hope that's ok! This tool meets a need we've had for a while for various projects, so I'm glad it exists and works so well.

aineniamh commented 3 years ago

Hi @tomkinsc, that is so awesome, thanks so much! Also, thank you so much for making the bioconda recipe, it's honestly not something I've done before and have been meaning to learn how to for a while now!