Git Product home page Git Product logo

rituum's Introduction

Rituum

A small widget for displaying DNA nucleotide sequences in a browser, and converting to binary code and other data formats. HTML and Javascript.

rituum

Getting started

To get started include the minified javascript file rtm.js in your header.

<script src="rtm.js"></script>

You need a HTML containing element for each sequence. Make an element <div id="container"></div> and the rituum will nest nicely inside of it.

var rituum = new neodna__Rituum();
rituum.init();
rituum.nest( "container" );

Each Rituum is setup with two basic modes, __RTM__NUCLEOTIDE and __RTM__BINARY. Here we set it to nucleotide anyway.

rituum.mode( __RTM__NUCLEOTIDE );

Setting the sequence

We can input our sequence quickly and draw it on the page.

rituum.set( 'CCTACATTTCCTTTATTCATATTCTTTTTATTTTCTTGCCAATTCC' );
rituum.draw( 1 );

Commands

To get the raw contents of the Rituum.

var str = rituum.blob();

To get the contents of the Rituum window

var str = rituum.window();

To get the contents of the current selection made with the mouse.

var str = rituum.selection();

Note you can set the mode by clicking on the m. This toggles between __RTM__NUCLEOTIDE and __RTM__BINARY.

Copy and paste

Although the Rituum is drawn on canvas, you can still copy and paste using a selection you make with the mouse, or by clicking on the c button. This will copy the contents of any specific Rituum onto the clipboard.

Words

The power of the widget is being able to change the words used. Here you can add your own base language, ie. the default is ACGT and would be set like this

rituum.words( 2, 'ACGT' );

so when we click m we toggle through the modes we have added also.

rituum.words( 2, 'CGTA' );
rituum.words( 3, 'ABCDEFGH' );
rituum.words( 4, 'ABCDEFGHIJKLMNOP' );

Width

We can change the width of the widget

rituum.width( 28 );

Length

And the total length of the widget's main window

rituum.length( 64 );

Range

And we can select a range on the widget which allows us to use selected()

rituum.range( 5, 35 );

A work in progress. Thanks for taking a look.

rituum's People

Contributors

backwardmachine avatar

Watchers

 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.