#!/usr/bin/perl
# Author        :
# Date          : Tue Aug 14 04:02:09 PDT 2007
# Description   :
 
use strict;
use warnings;
use Data::Dump qw (dump);
 
my @row1 = ("Lenny", "Jaime", "Dan");
my @row2 = ("Jody", "Rich", "Rose");
my @row3 = ("Billy", "Ksenia");
 
my @seating_chart = (\@row1, \@row2, \@row3);
 
print "FRONT\n";
 
for (my $row=0; $row < scalar(@seating_chart); $row++){
    my $regular_count = $row+1;
    print "row $regular_count: @{$seating_chart[$row]}\n"
}
print "BACK\n";
dump (\@seating_chart);
__END__

#!/usr/bin/perl
# Author        :
# Date          : Tue Aug 14 04:02:09 PDT 2007
# Description   :
 
use strict;
use warnings;
use Data::Dump qw (dump);
 
my @row1 = ("Lenny", "Jaime", "Dan");
my @row2 = ("Jody", "Rich", "Rose");
my @row3 = ("Billy", "Ksenia");
 
my @seating_chart = (\@row1, \@row2, \@row3);
 
print "\nFRONT\n";
 
for (my $row=0; $row < scalar(@seating_chart); $row++){
    my $regular_count = $row+1;
    print "row $regular_count: @{$seating_chart[$row]}\n"
}
print "BACK\n";
 
 
@seating_chart = seating_shift(\@seating_chart);
 
print "\nFRONT\n";
 
for (my $row=0; $row < scalar(@seating_chart); $row++){
    my $regular_count = $row+1;
    print "row $regular_count: @{$seating_chart[$row]}\n"
}
print "BACK\n";
 
second_to_last(\@seating_chart);
 
@seating_chart = seating_shift(\@seating_chart);
 
print "\nFRONT\n";
 
for (my $row=0; $row < scalar(@seating_chart); $row++){
    my $regular_count = $row+1;
    print "row $regular_count: @{$seating_chart[$row]}\n"
}
print "BACK\n";
 
second_to_last(\@seating_chart);
 
 
###SUBROUTINES!
sub second_to_last{
    my ($original_chart_ref) = @_;
    my @original_chart = @$original_chart_ref;
    foreach my $row (@original_chart){
        print "$$row[-2], "
    }
}
 
sub seating_shift {
    my ($original_chart_ref) = @_;
    my @original_chart = @$original_chart_ref;
    for (my $i=0; $i< scalar(@original_chart); $i++){
        if ($i == scalar(@original_chart)-1){
             unshift @{$original_chart[0]}, (pop@{$original_chart[$i]});
        }
        else {
            unshift @{$original_chart[$i+1]}, (pop@{$original_chart[$i]});
        }
    }
    my @shifted_chart = @original_chart;
    return(@shifted_chart);
}
__END__

gff_to_matrix

#!/usr/bin/perl
# Author : James Fraser
# Date : Thu Jan 11 15:37:45 UTC 2007
# Description : A program to extract info out of GFF files
 
use strict;
use warnings;
use Data::Dump qw (dump);
 
my @results_files = @ARGV;
 
my @array_of_genes;
 
foreach my $file_name (@results_files) {
 open my $FILEHANDLE, "<", $file_name or die "you suck!";
 while ( my $file_line = <$FILEHANDLE> ) {
 chomp $file_line;
 if ( $file_line =~ m/^\#/ ) {
 }
 else {
 
 #parse the line into an array
 my @gff_record = split /\s+/, $file_line;
 if ( $gff_record[2] eq "gene" ) {
 push @array_of_genes, [@gff_record];
 }
 }
 }
}
 
print $array_of_genes[0][0],"\n";
print $array_of_genes[3][3],"\n";
print $array_of_genes[-1][4],"\n";
 
__END__
 
 

gff_to_matrix2.pl

#!/usr/bin/perl
# Author : James Fraser
# Date : Thu Jan 11 15:37:45 UTC 2007
# Description : Another program to extract info out of GFF files
 
use strict;
use warnings;
use Data::Dump qw (dump);
 
my @results_files = @ARGV;
 
my @array_of_genes;
 
foreach my $file_name (@results_files) {
 open my $FILEHANDLE, "<", $file_name or die "you suck!";
 while ( my $file_line = <$FILEHANDLE> ) {
 chomp $file_line;
 if ( $file_line =~ m/^\#/ ) {
 }
 else {
 
 #parse the line into an array
 my @gff_record = split /\s+/, $file_line;
 if ( $gff_record[2] eq "gene" ) {
 push @array_of_genes, [@gff_record];
 }
 }
 }
}
for ( my $result = 0; $result < scalar(@array_of_genes); $result++ ) {
 if ( ($array_of_genes[$result][4] - $array_of_genes[$result][3]) > 1000 ) {
 print "@{$array_of_genes[$result]}\n";
 }
}
 
__END__