Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

- - - - -

Programmes


  • Please log in to reply
3 replies to this topic

#1 prabhubct

prabhubct

    Veteran

  • Active Members
  • PipPipPipPipPipPipPipPipPipPip
  • 230 posts

Posted 10 September 2012 - 05:59 AM

Try running this in padre by opening new file. We will discuss technical term then.

Example 4-1   Storing DNA in a variable, and printing it out



#!/usr/bin/perl -w
# Example 4-1   Storing DNA in a variable, and printing it out

# First we store the DNA in a variable called $DNA
$DNA = 'ACGGGAGGACGGGAAAATTACTACGGCATTAGC';

# Next, we print the DNA onto the screen
print $DNA;

# Finally, we'll specifically tell the program to exit.
exit;
“Those who mind don't matter, and those who matter don't mind.”
--  Bernard M. Baruch

#2 prabhubct

prabhubct

    Veteran

  • Active Members
  • PipPipPipPipPipPipPipPipPipPip
  • 230 posts

Posted 11 September 2012 - 07:35 AM

Working on windows,
Paste above program in padre, save it as Storing DNA in a variable, and printing it out.pl in separate folder.

press F5.

See in command prompt your first Bioinformatics program.
“Those who mind don't matter, and those who matter don't mind.”
--  Bernard M. Baruch

#3 DELETEMYACCOUNTPLEASE

DELETEMYACCOUNTPLEASE

    Y U NOT DELETE MY ACCOUNT?

  • Active Members
  • PipPipPipPipPip
  • 58 posts

Posted 13 September 2012 - 01:03 PM

Don't use capitals for variable names, use snake-case, unless you are defining constants. If you are going to do perl make sure you start using strict.

use strict;
my $dna = 'aaaaaatcgCCGGTTaaAT';
print "my DNA: ", $dna;

You don't need exit. I also can't remember print niceties for perl, I think perl allows variables to be embedded within double quotes....

you can:

perl
use strict;
my $dna = lc 'aaaaaatcgCCGGTTaaAT';
print "my DNA: $dna ";

python
dna = "ATCGACTCGAGTCAGCATCGA"
print "my dna:", dna.lower()

ruby
dna = "ATGAGATAGATGTC"
puts "my DNA: #{dna.downcase}"

downcase, oh ruby ...

scala
val dna = "ATGCGGCCGGG"
println("My DNA: " + dna.toLowerCase)

clojure
(use '[clojure.string :only [lower-case]])
(def dna "AGAGTCTGTC")
(println "My DNA:" (lower-case dna))

haskell (in repl)
import Data.Char
let dna = "ATATGATGAT"
"my dna: " ++ (map toLower dna)

Edited by perlmunky, 13 September 2012 - 01:25 PM.


#4 prabhubct

prabhubct

    Veteran

  • Active Members
  • PipPipPipPipPipPipPipPipPipPip
  • 230 posts

Posted 19 September 2012 - 07:42 AM

Does anybody know how to run program written in sublime Edit 2? I made perl programme file from previous post 1+. I saved it in folder as .pl file (.pl stands for perl executive file). But unlike in Padre where F5 key stands for running program. I could not find run key.
Thanks.
“Those who mind don't matter, and those who matter don't mind.”
--  Bernard M. Baruch




Home - About - Terms of Service - Privacy - Contact Us

©1999-2012 Protocol Online, All rights reserved.