## 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 ?

Perl
0
Java
1
33%
Awk
0
Python
2
67%
Other(plz Specify)
0

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

b_d_41501
King Cobra

Posts: 746
Joined: Mon Apr 25, 2005 9:55 pm
Location: Kentucky

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

biostudent84

Posts: 974
Joined: Thu Nov 11, 2004 6:00 am
Location: Farmville, VA

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

b_d_41501
King Cobra

Posts: 746
Joined: Mon Apr 25, 2005 9:55 pm
Location: Kentucky

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...

biostudent84

Posts: 974
Joined: Thu Nov 11, 2004 6:00 am
Location: Farmville, VA

### The 64 codons

Code: Select all
`import sysbases = ['a','g','c','t']r = 3codons = []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.

cytochromeP

Posts: 73
Joined: Wed Apr 06, 2005 2:17 pm
Location: Third Rock From The Sun

### Re: The 64 codons

cytochromeP wrote:
Code: Select all
`import sysbases = ['a','g','c','t']r = 3codons = []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?

biostudent84

Posts: 974
Joined: Thu Nov 11, 2004 6:00 am
Location: Farmville, VA

### ?

which part ...the code or the execution of the code ?
Know thyself.

cytochromeP

Posts: 73
Joined: Wed Apr 06, 2005 2:17 pm
Location: Third Rock From The Sun

### Re: ?

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

There's two parts? LOL I couldn't even tell that much.....

biostudent84

Posts: 974
Joined: Thu Nov 11, 2004 6:00 am
Location: Farmville, VA

### prose

lol...
Okay... here u go

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.

cytochromeP

Posts: 73
Joined: Wed Apr 06, 2005 2:17 pm
Location: Third Rock From The Sun

Can step 3 be done in the DOS "emulator" in windows XP?

biostudent84

Posts: 974
Joined: Thu Nov 11, 2004 6:00 am
Location: Farmville, VA

### ?

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.

cytochromeP

Posts: 73
Joined: Wed Apr 06, 2005 2:17 pm
Location: Third Rock From The Sun

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

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.

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.

Chris4
Coral

Posts: 286
Joined: Mon Mar 07, 2005 4:56 pm
Location: UK

PreviousNext