Wednesday, December 10, 2014

Gene Editor

The VD Editor is very good at making coding a faster and slicker process. I thought it to be time to make it an editor of genes, creating tools for analyzing sequences as well as ways of designing custom genomes. Here is how it works:

We start with some Jquery to handle the lightweight text operations, like switching out acronyms and words for protein sequences. First make some html:



 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
<body bgcolor = "#303030 ">


<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"> </script>

<style>
  #sideBar { vertical-align:top;}
  #contentArea { vertical-align:top;}
</style>
<table>
  <tr>
    <td id="sideBar">
 
      </td>
    <td id="contentArea">
      
      
<textarea name="texty" id="field_id_29" rows="40" cols="100" style="color: #0086f7; background-color: black;font-weight: bold; font-family: source code pro; font-size:11; "></textarea>

Note the linking of the jquery source into the file. This demands that our application work online. I used this method for future cross platform building ease:

We can add some JS and JQ:

1
2
3
4
5
         $("#field_id_29").bind("keyup", function() {
    var text = $(this).val();
    text = text.replace("alanine", "A" )
    $(this).val(text);
});

The above allows direct addition of amino acids into the sequence following using the Uniprot coding system.

Now for the big switcharoo:


1
2
3
4
5
6
7
8
       
var capsacine_synthase="MIFILTVNFRWRYLILLICKSLMLLEISCPVKYPERFLGVCDTLIFRQTCLQEIFRGTCRICLSCFLLIFLTIVFPAKFRRVLVGFSSFSTFGSRIMTWLELCLRQLLTVRRWFIECLRKCYSRCYSSGNCCFTKASGDIFITYYSVWFFASFIVLQCFDLSSFPWDCSVGFQWVYGYCQARVSKMFYFLANFGSSTQPNTWCVSFDFDEQFCIDVVGRIVEFVLWENPKCHWELVEIGVTENGKQFIDRWSPVFDYELVQLEGSCSIRESNEGENSNVFRLSQKLEDIITGKKSVFGFHSFAFVKFD"

  $("#field_id_29").bind("keyup", function() {
    var text = $(this).val();
    text = text.replace("capsacine synthase", capsacine_synthase )
    $(this).val(text);
});

Now we employ VB for heavy text operations so integrate the js doc via a we bowser.  Before we start messing with whole genomes lets add a method to identify major sequences. this is the basic method:



1
            buildbox.Text = Replace(buildbox.Text, "tata", "tataSTARTSTART")
Let's make sure we are online:



1
2
3
4
5
6
7
   If My.Computer.Network.IsAvailable Then
            adder.ForeColor = Color.Green
            adder.Text = "Internet Connected"
        Else
            adder.ForeColor = Color.Red
            adder.Text = "Internet Disconnected"
        End If


And we load text files for large data segments such as the entire genome of synechocystis. And there you have it , a basic sketch of the gene editor. It willb e embedded int he next VD release.



Sunday, November 30, 2014

Komputer Kite I

Today I decided to use the Arduino cell shield and sensors to make a flying telecommunication and monitoring unit. Below is the kite. It takes two people to launch, it will only require one person once I make the launching stand.


Plastic sheeting and composite plexiglass  cylinders create the kite. Simple and lightweight often go hand in hand.

As far as code goes the shield has a lib available. For power I'll be using a solar panel with a 9 volt rechargeable:

Sample code:

#include <GSM.h>

#define PINNUMBER ""

// initialize the library instance
GSM gsmAccess; // include a 'true' parameter for debug enabled
GSM_SMS sms;

void setup()
{
  // initialize serial communications
  Serial.begin(9600);

  Serial.println("SMS Messages Sender");

  // connection state
  boolean notConnected = true;

  // Start GSM shield
  // If your SIM has PIN, pass it as a parameter of begin() in quotes
  while(notConnected)
  {
    if(gsmAccess.begin(PINNUMBER)==GSM_READY)
      notConnected = false;
    else
    {
      Serial.println("Not connected");
      delay(1000);
    }
  }

  Serial.println("GSM initialized");
}

void loop()
{

  Serial.print("Enter a mobile number: ");
  char remoteNumber[20];  // telephone number to send sms
  readSerial(remoteNumber);
  Serial.println(remoteNumber);

  // sms text
  Serial.print("Now, enter SMS content: ");
  char txtMsg[200];
  readSerial(txtMsg);
  Serial.println("SENDING");
  Serial.println();
  Serial.println("Message:");
  Serial.println(txtMsg);

  // send the message
  sms.beginSMS(remoteNumber);
  sms.print(txtMsg);
  sms.endSMS(); 
  Serial.println("\nCOMPLETE!\n");
}

/*
  Read input serial
 */

int readSerial(char result[])
{
  int i = 0;
  while(1)
  {
    while (Serial.available() > 0)
    {
      char inChar = Serial.read();
      if (inChar == '\n')
      {
        result[i] = '\0';
        Serial.flush();
        return 0;
      }
      if(inChar!='\r')
      {
        result[i] = inChar;
        i++;
      }
    }
  }
}

Saturday, November 29, 2014

Random Dictionary Generation and Duplication

In over 43,000 samples only 4 strings were repeated in the random dictionary generation test. Inefficiency of  9.2263689624948101674585966692808e-5

Tested using filtering method

Biolistics Tip

Tip for Laucher, compresses fluid from surgical tubing and increases velocity:



 1
 2
 3
 4
 5
 6
 7
 8
 9
10
difference()
{
 for(i=[0:2])

 cylinder(r=50,h=70);

 for(i=[0:2])
 translate([0,0,-1])
 cylinder(r=40,h=72, r1=2, r2=12);
}
This is written in OpenSCAD, so constants may need changing for printers or CNC's