Wednesday, June 17, 2015

Audio Data from Genetic Code[For An Actual Purpose]

Right, so as I mentioned in the post on the Basic Audio Analysis tool I mentioned Hamming distances. I wrote the Audio Analysis tool because it could also be used with the VD genetics tools that I have been working on and describing at the linked location. Now the method I demonstrated is also useful for returning the Ham function back to the top of the program so to speak(so that it can be analyzed or cross analyzed) and to use the other functions as well, for instance the Ham of the Distance function of each waveform would be useful for a more accurate comparison of the two as it equalizes them using abs val.


And now we import the data:

Recall that the data is in the format of:


Unfortunately this post is more of a how to so far but, what the hell I guess they all are. Anyway now for how to do this with genetic data(still a How To, I suppose):

Just write a good old formula( probably 20 or 4 depending on whether you are messing with Aminos or Nucleics. Lets do nucleics for simplicity:

rtf.Text=
"a
c
t
g
g
t
c
a
c
g
t
a
g
c
a
t"
'you can use an array or manually add in the \n via replace(all,any,any +\n)
'now I mention the above comment because if using the aminos the vals will be over double digits and thus
'the lines must be used or commas or colons or # or % or &(you get the idea hopefully)
rtf.Text=Replace(rtf.Text,"a","1")
rtf.Text=Replace(rtf.Text,"g","2")
rtf.Text=Replace(rtf.Text,"c","3")
rtf.Text=Replace(rtf.Text,"t","4")
'note that base pairs add to 5, just an easy checking method for later more complex operations which are profitable financially and thus will not be blogged about
Now these are numbers so just run the audacity operation on them export as a .wav file, and then run through the program. There you go, audio from genetic data and you can calculate Hamm(kinda) and perform other useful operations on the data. Cheers!

No comments:

Post a Comment