User:ShawnDouglas

From FreeBio

Revision as of 04:32, 13 December 2005; view current revision
�Older revision | Newer revision→

ins-contig.pl - inserts 1 contig


get-contig.pl - gets 1 contig for specified id


get-all-contig.pl - gets all contigs in the table


ins-subst.pl - loops through insertions of substitutions


get-subst.pl - gets substitution by id


get-all-subst.pl - gets all substitutions




#!/usr/bin/perl -w
use strict;

open (FILE, "<DNA");
my $seq = <FILE>;
close(FILE);

chomp $seq;     # remove trailing newline

my $comp = reverse $seq;
$comp =~ tr/ATCG/TAGC/;

my $at = $seq;
$at =~ s/[AT]//g;
my $gc = 100 * length($at) / length($seq);

my $eco;
my $i = 0;
my $pos = 0;

for (;;) {
  $i = index($seq, "GAATTC", $pos);
  if ($i >= 0) {
    $pos = $i + 1;
    $eco .= " $i,";
  } else {
    last;
  }
}


print "original sequence:\t$seq\n";
print "reverse complement:\t$comp\n";
printf "GC content:\t\t%.3f%%\n", $gc;

if ($eco) {
  chop $eco;
  print "EcoRI site(s) at index:$eco\n";
} else {
  print "No EcoRI sites found.\n";
}


For info about me, here's a link to my website