Git Product home page Git Product logo

mplotter's Introduction

mplotter

Creates publication quality dot plot using ggplot

While mummerplot is a nice dotplot viewing application, its plots are not of publication quality. To work around this, mummerplot output can be plotted with ggplot or R graphics. There are several ways to do it. Here I describe one such way. I use a program that takes mummerplot output and convert into R compatible table. Then I provide an example R script to create a pretty, publication quality dotplot. For questions and comments, write to me: [email protected]

Citation: If you find this useful and use it in a paper, please cite this paper which used an early version of this pipeline.

Step 1.

Run mummerplot on your delta file like this -

 mummerplot [options] --prefix foo --postscript foo.delta

Here, you can add any mummerplot option you want. You can add '-filter' or '-layout' or '-fat', basically anything mummerplot allows! If you don't add postscript or png option, the dotplot will be created on your screen.

Step 2.

Remove the first three lines from the plot files and use the gp file to generate the files for tick labels-

 tail -n +4 foo.fplot > foo.new.fplot
 tail -n +4 foo.rplot > foo.new.rplot
 sed 's/["|,|\|)|(]//g' foo.gp |tail -n +3 |awk '{if(NF >1)print $1"\t"$2}'|head -n -26 >foo.new.gp

Step 3.

Run mplotter on the foo.new.fplot and foo.new.rplot files.

mplotter foo.new.fplot foo.new.rplot foo.new.gp

mplotter will create 4 files. They are -

  1. dot.txt: Contains the x and y coordinates for the dots (alignment start and ends). Also contains the alignment orientation in the final column.

  2. line.txt: Contains 5 columns. First two columns have alignment start coordinates (x1,y1) and the second and the third columns have the alignment end cooridnates (x2,y2). The final column has orientation.

  3. xticks.txt: Contains a table for x ticks positions and labels

  4. yticks.txt: Same as xticks.txt but contains information for the y ticks.

Thoe who are familiar with ggplot can already see where this is going. Use the example R script "plot_script.R" or create your own R script uisng the data files generated with mplotter.

If you have a different example ggplot script or R script, feel free to share it here.

PS: If you are trying to create a dotplot between two sequences, there is an easier way to use ggplot than this. Feel free to write to me to know the trick.

mplotter's People

Contributors

mahulchak avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.