Transcription of a Template (Noncoding) Strand String with Python

I have always flirted with computer languages, ever since my years with BASIC and Pascal in high school (ah the hey day of the Apple II and TRS80).  Recently I have been coming back to it as an interesting distraction and a way to deal with some problems in teaching things like population genetics and evolution.  Obviously the days of BASIC and Pascal are long gone (though you can still get them), and it is the land of C++, PHP, Python, and many others.  I don’t really mind learning a new language, as they all make a type of logical sense to me (more so than say French or Japanese), so I have dabbled in a number of them.  My current language of choice is python (2.7, not 3.0) as it runs on pretty much anything and can be installed on a USB key to help move things around.

One thing I don’t get about the newest languages is the obsession with Object Oriented Programming (OOP).  I grew up in the age of the Procedural Program (main program with subroutines) and still think in that paradigm.  While I can see some uses for OOP in VERY large programs, I think it isn’t that big of an advantage for the types of programs I write, especially since I will probably eventually head towards the even more obscure Functional Programming paradigm when I get bored.  The beauty of Python is that while it has OOP properties, it does not require it, so I can program it just fine without the need for going into OOP (the other non-OOP languages, PERL and C are also ones I dabble in).

Today I was working on a program to demonstrate basic genetic processes and then test the students with random sequences.  I was writing a function to produce the reverse complement RNA sequence of a given DNA sequence and have a bugger of time getting it right.  Admittedly there are “packages” for Python that have the function I am looking for baked in (i.e. biopython), but I view it as an intellectual challenge to figure out how to do it with just the basic tools (kind of like knowing how to solve a problem before using the calculator).  It took me a while to figure it out (given my primitive knowledge of Python at this point), but I got it.  When I decided to compare my solution to others I found that there were no easy examples on the web for producing the reverse complement of a given sequence.  I am sure there are more elegant solutions, but here is mine.


#Function to transcribe template sequences
def ttranscription(sequence):
tsequence="" #initializing variables, not all needed, but habit
i=0
j=0
tempsequence=list(sequence) #casting the string into a mutable list

  #iterative loop that goes through the list and replaces the bases
for i,j in enumerate(tempsequence):
if j=="A":
tempsequence[i]="U"
elif j=="T":
tempsequence[i]="A"
elif j=="G":
tempsequence[i]="C"
elif j=="C":
tempsequence[i]="G"

  #iterative loop that produces a new string from the list data
for i,j in enumerate(tempsequence):
tsequence+=j

  tsequence=tsequence[::-1] #reverses the sequence
return tsequence #returns the reverse complement sequence to the program

Obviously, this is just a quick and dirty logic exercise with no error checking or elaboration.  I just thought I would post it.

New Term, New Tech

It is the start of another year of teaching for me at the college level (my sixth).  With each new year I like to run through the tech I am using to either directly teach or indirectly support my teaching.  This year is a little different since I am teaching a chemistry class for the first time, and that has changed some of my teaching equipment.

Computer (Main):  Dell Studio 15 from 2009 (Core 2 Duo, 4 GB RAM, Intel graphics, Vista)

This computer may not seem like much for specs anymore, but it is a workhorse and very functional as a primary machine for office and technical work.  The screen is a nice size and the machine runs forever on the included extended battery. I probably won’t be replacing it anytime soon.

Computer (Portable):  HP Touchsmart TM2 (i5 with switchable graphics, 6 GB RAM, W7)

I got this machine before HP decided to go all in with the Touchpad (see how that worked out) and think it is still the best convertible tablet out there.  For under a thousand bucks I got a machine with good specs, an active digitizer, capacitance touch and a killer battery life.  This will probably be my choice until a W8 slate comes out that has an active digitizer and good battery life.  One other bonus is that it has a VGA port, which is nice in education where all the projectors are still analog.

Ereader: Nook Simple Touch Reader

I also have a Nook Color Reader, but have found the Eink Nook V2 to be a better fit for my reading style.  The design on this device is fantastic and the battery life is outrageous.  I simply think there is not a better Eink reader out there, and the new Pearl displays make it easier to forget color.

Phone:  Samsung Focus (Windows Phone 7-Mango dev build)

I finally left the iPhone behind and switched to the new Windows Phone ecosystem.  While there are not as many apps in the system, all the ones I care about (except Pandora and Nook) are there.  I think the UI and experience are great and better than the iPhone or Android experiences I have had.

MP3 Player:  Microsoft Zune HD (16 GB)

If you have a Windows Phone you should get a Zune.  Granted most of the time my Zune is plugged into my car, but the shared Zune Pass makes it worth the money.  The unlimited downloads and ten permanent downloads a month deal is pretty good and better than what iTunes offers.

Classroom Software:  Microsoft PowerPoint (Biology Classes), Microsoft OneNote (Chemistry Classes)

I have a split load this term and have found that Chemistry is a much more dynamic teaching experience than Biology.  Biology classes are very concept based with little active problem solving inherent to them.  What problems there are are usually ones you talk through and have complex solutions.  This type of work lends itself to PowerPoint presentations.  This year I have been experimenting with hyperlinked PPT files, where the student (or I) can jump around the presentation and hopefully make better connections.  In Chemistry I am finding the class to be much more problem oriented so I am taking a different approach to presentations.  I set up a large page in a OneNote notebook that covers the concepts, examples and class problems I want to discuss, then using my tablet I project this file and we work through the page and problems.  At the end, the entire page can be dumped to a PDF and posted for the students.  I experimented with this before on Genetics problems, but this is the first large scale use I have done.

Course Website:  Wordpress and Roundcube Webmail

For years I built my own site from scratch, and got very good at it.  However, the restrictive firewall at my school always made it a pain to upload from school, so this year I just started moving everything to my own installation of WordPress.  The firewall lets me post materials, it runs on my own server, and I have to worry very little about coding (though I can if I want).  Likewise, I am running my own installation of Roundcube Webmail to handle my email accounts for students and love its simplicity.

 

Ford Fusion Hybrid First Impressions

I finally replaced my 2002 Chevy Malibu.  It had over 120k miles on it and I drive around 110 miles a day to and from work, I wanted to have more faith in my car than the last year had instilled and didn’t want to spend the $3000 needed to fix up the Malibu.

My number one concern with the new car was gas mileage.  I needed the car to be significantly better than the Malibu (25-27 mpg on commute) for it to be cost effective for me.  When I started looking I glanced at the foreign hybrids (Prius and Insight) but quickly learned that while I could squeeze my 6’4″ frame into them, there was no way a child’s seat was going in the back after that.  After flirting with a couple of full-size cars and crossovers I finally tried the 2010 Ford Fusion Hybrid.  After one test drive I was hooked and have since purchased one.  These are my impressions after about 750 miles.

Size

The Malibu was a nice car.  The model I had (the first model of the 2000′s reintroduction) had a lot of interior room, easily fitting me and passengers.  The Fusion is a good compromise.  It is a smidge smaller in the back seats than the Malibu (sorry Uncle Jim, no riding in the back for you) and there is about an inch less headroom.  Overall it is a good fit.  The shoulder room is amazing (something the new GM models do not have) and the ergonomics of the seat make for a comfy ride.  The car is your standard mid-size sedan, but the trunk is small, a large chunk is taken by the battery pack.

Mileage

Here is where the car shines and in my opinion out competes the Prius.  On my daily commute I have averaged a solid 41-43 mpg at 55 mph (I take back roads).  On the Interstate it makes the EPA estimate of 39-40 mpg (70 mph).  I know Consumer Reports said the car gets less than the stated milage, but I have been beating the stated milage on a consistent basis.  Of note, the car’s active feedback system (it puts more virtual leaves on the base as you drive more efficiently and the tach goes completely green when you enter EV mode) does make you much more aware of your driving style and I have found myself working towards better numbers.  In addition, the 47 mph EV mode and the electronic speed control that works as low as 25 mph really help the milage.

Driving Experience

The car is peppy.  You would never know there is a fule-sipping 4 cylinder engine under the hood.  When you need to accelerate the car can do it (by adding torque from the electrical system I think) and it handles curves well.  I wish the suspension was a little smoother, but it is a mid-sized sedan… there is only so much you can ask for.

The cabin lets in next to no road noise, even at highway speed.  Everything you need to access is right at your fingertips (through on wheel controls) or within easy reach on the center console.

Here is one place I must comment on Ford’s overall design.  First, kudos for not going overboard on the central console.  The Taurus has a third of the front seat room taken up by the center console and I was glad to see that this design asthetic wasn’t carried over.  However, if you are going to add changable ambient lighting, why not make all the interior lights changes rather than just the cup holders and some under dash lights.

Entertainment

This is a win for Ford.  The car has Sirius satillite radio, an FM/AM tuner where channels can be directly entered via a keypad (why did that take so long), a six-CD changer in dash, and both an auxillary and USB port hidden in the armrest console.  The USB port can be directly linked to an iPod or better yet a USB drive (I’m mention why in a moment).  The whole mess is linked together by Ford’s Sync system (a modification of Microsoft’s voice command from their Windows Mobile cell phones).  The sync system works well, once you learn the commands, and makes it easy to control the media.  In addition the system can connect through Bluetooth to your phone, indexing the phone book and making it voice dialing capable.

There is one problem with the Sync system, but I think it is unique to the iPhone.  When the phone is connected through the Bluetooth system and the USB port, the system gets confused on how music is supposed to be outputed (yes it can do BT streaming).  Typically you end up being able to access the iPod functions, but get no sound.  Apparently you can work around this by selecting on your phone the output you want, but I have had limited luck with that.  It is easier to go get an 8, 16 or 32 GB flash drive (portable HDD also work) copy the music to it and then plug it in the armrest console and forget it.

Pros

  • Mileage
  • Driver comfort
  • Entertainment Options

Cons

  • Back seat room
  • Trunk space
  • Rough ride at times

Long Summer Break

So I took the summer off.  For the first time since my K12 years I was not working for the entirety of the summer break (usually I teach at least a summer course), and it was spectacular.  I finished my triathlon (beat the people that didn’t finish), took a vacation to Florida, survived my first Chuck-E-Cheese birthday party (Jane’s 3rd Bday), celebrated a decade of married life, got another year closer to forty and bought a new car.  All in all a very eventful summer.  I hope this coming school year is as exciting as usual and that a few of my students are inspired by the classes.

Less than 36 hours…

In less than 36 hours I will be running my first triathlon.  I am nervous and a little intimidated but I will accomplish it.

The Best Five – PSP

The PSP has had a hard time recently.  Recently, Sony announced that the PSP Go “experiment” was a learning experience where they learned that users like their physical media.  Many people have predicted the death of the platform or the ever promised PSP2 (two analog sticks being the requirement).  I have a PSP-2000 (the second incarnation, “slim and light” with the good screen) and love the system for its versatility.  Along with its amazing multimedia capabilities it is still an excellent gaming system.  Here are my five favorite games for the system.

1.  Little Big Planet – The epitome of platforming on a portable system.  Super Mario Brothers may be the granddaddy of the genera, but recent portable iterations have been nothing more than rehashes of the glory days.  LBP takes the genera in new directions with originality, expandability, and detail.  If you get no other game for the system I would recommend this one above all others.

2.  Killzone Liberation – Too many franchises tried to port themselves directly to the PSP from the big-brother PS2 and PS3 systems, keeping the gameplay intact.  For a few this worked (LBP, GoW) but most failed miserably.  The genera most often meeting with failure was the first person shooter (FPS), a huge segment of the PS3 arena.  The lack of a second analog stick limits the FPS abilities for the system and the genera seldom worked well with it (exception Resistance: Retribution).  Killzone, a huge FPS property on PS3, realized this limitation and decided to rethink the idea from the ground-up.  The resultant game is an excellent third-person shooter that captures the essence of the franchise but still delivers spectacular gameplay.

3.  Prinny: I can be a hero – A game that knows the meaning of “Hard Core.”  It may be a platformer, but I challange you to more grueling, yet satisfying experience on any system.  The property is a great expansion of a classic PS franchise and wins major points for humor, detail and just good old-fashion gameplay.

4.  Jeanne d’Arc – There are tons of turn based strategy games on the DS and PSP, but most are rehashes of older titles that show little original thought.  This game is a new property that really makes for a fun game in the genera.  The play is spot-on and the fact that it was built from the ground up for the PSP shows in its level of utilizing the system without compromise.

5.  God of War, Chains of Olympus - The only game of the above I do not own, not a fan of the property, but I will acknowledge that it is probably the most technologically advanced game on the system.  Again, one of the rare portable versions that succeeds in bringing the game unaltered to a portable system.

Finally did it!

After almost a year of work I have finally in one day accomplished the successful completion of both the cycling stage and the running stage right after the other.  Yeah the total time sucked (2:45), but I don’t care.  I pretty much expect to be at the bottom of the pack anyway, but it is a huge psychological boost to KNOW that I can do it.  I only have a few weeks left and I doubt I will try the full brick again, but I had to try it once just to see.

14 Miles Road Cycling – 75 minutes

5 Miles Speed-Walk – 85 minutes

Transition – 5 minutes

New Name, New Direction

I haven’t been posting here recently because frankly I haven’t had the time to do much interesting tech stuff recently.  Life, jobs, and the family have kept me pretty busy and away from the diversions I used to spend so much time one.  In fact I hate to admit it but I am still trying to finish Mass Effect so that I can start into what I hear is a great sequel.  I have been busy the last few months and I decided that this blog should expand its scope, since my life has become much more diverse in its downtime exploits.  Hence the new name and the new subtitle.  Now this blog will cover anything that interest me, from my daughter’s burgeoning interesting in Tablet PC made art to what my current exercise routine is moving to.  I have no illusions that this will interest anymore people, but it is cathartic for me.

New Tablet OS

Here is my first post from my newly updated tablet.   I just updated my HP tc4200 to Windows 7.  The system is a first-generation Centrino with 1.5 GB RAM and a new 250 GB HDD.  Overall my initial impressions are very good. The system runs smooth and the handwriting recognition is top-notch.  This entire post was entered through the handwriting system.

Favicons

I geeked out a little today and added Favicons to all my blogs.