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;
Programmes
Started by prabhubct, Sep 10 2012 05:59 AM
3 replies to this topic
#1
Posted 10 September 2012 - 05:59 AM
“Those who mind don't matter, and those who matter don't mind.”
-- Bernard M. Baruch
-- Bernard M. Baruch
#2
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.
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
-- Bernard M. Baruch
#3
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.
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
python
ruby
downcase, oh ruby ...
scala
clojure
haskell (in repl)
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
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.
Thanks.
“Those who mind don't matter, and those who matter don't mind.”
-- Bernard M. Baruch
-- Bernard M. Baruch















