Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/perl
use strict;
require "getopts.pl";
use vars qw ($opt_f $opt_p $opt_q $opt_s $opt_t $opt_l $opt_m $opt_F $opt_Q $opt_L $opt_M $opt_c $opt_o $opt_h $opt_H);
&Getopts('f:p:q:l:s:t:m:F:Q:L:M:c:o:hH:');
my $executable = "merge.basedOn.column.pl";
@sashaphanes
sashaphanes / tableJoin.pl
Created October 10, 2012 20:21
work in progress...
#!/usr/bin/perl
use strict;
#use warnings;
require "getopts.pl";
use vars qw ($opt_f $opt_s $opt_h $opt_H);
&Getopts('f:s:hH:');
@sashaphanes
sashaphanes / variableTransposer.pl
Created October 9, 2012 15:22
flexible transposer
#!/usr/bin/perl
use strict;
#use warnings;
require "getopts.pl";
use vars qw ($opt_f $opt_s $opt_h $opt_H);
&Getopts('f:s:hH:');
@sashaphanes
sashaphanes / transpose.pl
Created October 9, 2012 00:06
Read a whitespace-delimeted text file of columnar data, parse into a matrix, tranpose, and print the result
#!/usr/bin/perl
use warnings;
open FILE, 'practice.txt';
my @content = <FILE>;
print "raw content:\n @content\n\n";
my $line;
@sashaphanes
sashaphanes / motifFinder.pl
Created October 2, 2012 17:32
Open a text file and find a motif in the truncated text found inside
#!/usr/bin/perl
use strict;
use warnings;
my $DNAfilename = 'exampleSequence.txt';
unless (open(DNAFILE, $DNAfilename)) {
print "Could not open file $DNAfilename\n\n";
exit;
@sashaphanes
sashaphanes / guesspasswordpoops.pl
Created October 2, 2012 17:27
Guess a silly password
#!user/bin/perl
use strict;
use warnings;
my $password = 'poops!';
print "Please enter your guess:\n";
my $guess = <STDIN>;
chomp $guess;
@sashaphanes
sashaphanes / wholeShebang.pl
Created September 28, 2012 15:19
Get user to specify sequence file and print out orginal strand sequence and reverse complementary DNA and RNA
#!/usr/bin/perl
use strict;
use warnings;
print "Which file would you like to use?\n";
my $DNAfilename = <>;
open(DNAfile, $DNAfilename);
#!/usr/bin/perl
use strict;
use warnings;
print "Which sequence would you like to view?\n\n";
my $DNAfilename = <>;
open(DNAfile, $DNAfilename);
@sashaphanes
sashaphanes / openDNAfile.pl
Created September 28, 2012 14:42
openDNAsequence
#!/usr/bin/perl -sw
my $DNAfilename = 'exampleSequence.txt';
open(DNAfile, $DNAfilename);
my $DNA = <DNAfile>;
close DNAfile;
@sashaphanes
sashaphanes / revcomp.pl
Created September 27, 2012 19:53
reversecomplement
my $DNA1 = 'AAATTTTGGGGCCCCaaaaatttttcccccggggg';
my $rev = reverse($DNA1);
my $DNA2 = $DNA1;
$DNA2 =~ tr /atcgATCG/tagcTAGC/;
print "$rev\n";
exit;