Login

Join for Free!
118802 members


Programming Language of Choice

Everything on bioinformatics, the science of information technology as applied to biological research.

Moderator: BioTeam

Perl or Java or Awk or Python ?

Poll ended at Wed May 11, 2005 3:54 am

Perl
0
No votes
Java
1
33%
Awk
0
No votes
Python
2
67%
Other(plz Specify)
0
No votes
 
Total votes : 3

Postby b_d_41501 » Mon Jun 13, 2005 8:28 pm

Yeah, that's the whole reason I took Visual Basic last year. I made a cool little Who Wants to Be a Millionaire game. It was the final. lol
"Take four red capsules, in ten minutes take two more. Help is on the way."
----- Voice from the Medicine Cabinet
User avatar
b_d_41501
King Cobra
King Cobra
 
Posts: 746
Joined: Mon Apr 25, 2005 9:55 pm
Location: Kentucky

Postby biostudent84 » Mon Jun 13, 2005 8:41 pm

b_d_41501 wrote:Yeah, that's the whole reason I took Visual Basic last year. I made a cool little Who Wants to Be a Millionaire game. It was the final. lol


I was never allowed to do the graphical stuff in computer classes. I was too bad at them. I DID have the programming and coding down to a science though :)
User avatar
biostudent84
Site Admin
Site Admin
 
Posts: 974
Joined: Thu Nov 11, 2004 6:00 am
Location: Farmville, VA

Postby b_d_41501 » Mon Jun 13, 2005 8:46 pm

You really have to. If you don't it gets to be a very l o n g process. lol
"Take four red capsules, in ten minutes take two more. Help is on the way."
----- Voice from the Medicine Cabinet
User avatar
b_d_41501
King Cobra
King Cobra
 
Posts: 746
Joined: Mon Apr 25, 2005 9:55 pm
Location: Kentucky


Postby biostudent84 » Mon Jun 13, 2005 8:50 pm

b_d_41501 wrote:You really have to. If you don't it gets to be a very l o n g process. lol


Aye. But I just don't have the artistic aptitude for it...
User avatar
biostudent84
Site Admin
Site Admin
 
Posts: 974
Joined: Thu Nov 11, 2004 6:00 am
Location: Farmville, VA

The 64 codons

Postby cytochromeP » Tue Jun 14, 2005 3:56 am

Code: Select all
import sys

bases = ['a','g','c','t']
r = 3
codons = []

for x in range(0,len(bases)):
   for y in range(0,len(bases)):
      for z in range(0,len(bases)):
         codons.append(bases[x]+bases[y]+bases[z])

print len(codons)," possible codons"
print codons


a Python snippet which outputs
the 64 possible codons

Python - Howto
1) Install Python
2) Save above code under 'codons.py'
3) execute the code by typing the following command to the command prompt:
python codons.py
...and u shud have ur 64 codons on the screen
Know thyself.
User avatar
cytochromeP
Death Adder
Death Adder
 
Posts: 73
Joined: Wed Apr 06, 2005 2:17 pm
Location: Third Rock From The Sun

Re: The 64 codons

Postby biostudent84 » Tue Jun 14, 2005 3:57 am

cytochromeP wrote:
Code: Select all
import sys

bases = ['a','g','c','t']
r = 3
codons = []

for x in range(0,len(bases)):
   for y in range(0,len(bases)):
      for z in range(0,len(bases)):
         codons.append(bases[x]+bases[y]+bases[z])

print len(codons)," possible codons"
print codons


a Python snippet which outputs
the 64 possible codons

Python - Howto
1) Install Python
2) Save above code under 'codons.py'
3) execute the code by typing the following command to the command prompt:
python codons.py
...and u shud have ur 64 codons on the screen


Errrrr. Would it be possible for you to explain that in english? :shock: :lol:
User avatar
biostudent84
Site Admin
Site Admin
 
Posts: 974
Joined: Thu Nov 11, 2004 6:00 am
Location: Farmville, VA

?

Postby cytochromeP » Tue Jun 14, 2005 4:03 am

which part ...the code or the execution of the code ? :?:
Know thyself.
User avatar
cytochromeP
Death Adder
Death Adder
 
Posts: 73
Joined: Wed Apr 06, 2005 2:17 pm
Location: Third Rock From The Sun

Re: ?

Postby biostudent84 » Tue Jun 14, 2005 4:08 am

cytochromeP wrote:which part ...the code or the execution of the code ? :?:


There's two parts? LOL I couldn't even tell that much.....
User avatar
biostudent84
Site Admin
Site Admin
 
Posts: 974
Joined: Thu Nov 11, 2004 6:00 am
Location: Farmville, VA

prose

Postby cytochromeP » Tue Jun 14, 2005 4:13 am

lol...
Okay... here u go
follow these simple(?) steps:

1) Is Python installed on ur machine ? Do it.
2) Copy-paste the above 'code' in Notepad (or ur fav text editor)
3) Save the file as 'codons.py' in ur fav directory.
3) Open a command prompt (DOS prompt under MS) and cd to ur fav directory where u saved the file
4) Execute the codons.py code by typing the following command :
python codons.py

That's it we'r done.
Know thyself.
User avatar
cytochromeP
Death Adder
Death Adder
 
Posts: 73
Joined: Wed Apr 06, 2005 2:17 pm
Location: Third Rock From The Sun

Postby biostudent84 » Tue Jun 14, 2005 4:21 am

Can step 3 be done in the DOS "emulator" in windows XP?
User avatar
biostudent84
Site Admin
Site Admin
 
Posts: 974
Joined: Thu Nov 11, 2004 6:00 am
Location: Farmville, VA

?

Postby cytochromeP » Tue Jun 14, 2005 8:04 am

step 3 is 'saving' the file.
and it can be done in notepad itself

but for 'executing' the code u will need to use ur winXp emulator
to start this emulator: Clik on START->RUN
in this RUN dialog box type: cmd
this shud start the emulator

once this is done, issue the command: python codons.py
Know thyself.
User avatar
cytochromeP
Death Adder
Death Adder
 
Posts: 73
Joined: Wed Apr 06, 2005 2:17 pm
Location: Third Rock From The Sun

Postby Chris4 » Tue Jun 14, 2005 8:55 am

Thanks. I installed python a couple of weeks ago but didnt have time to do anything with it.
I ran the codon program by dragging and dropping the codon.py file onto the command prompt. Simple.
And theres my first python program :D

Its quite fun. you can easily add or delete bases etc. If you only had a,g and c as bases there are only 27 possyble codons.
3^3, 4^3, 5^3 (27, 64, 125,). - how you work out the numbers. 8)

I was going to learn python and now ive been reading about bioperl (perl). I'll learn a bit of both. And see which one i like best.
User avatar
Chris4
Coral
Coral
 
Posts: 286
Joined: Mon Mar 07, 2005 4:56 pm
Location: UK

PreviousNext

Return to Bioinformatics

Who is online

Users browsing this forum: No registered users and 0 guests