#use lib "/home/tisdall/MasteringPerlBio/development/lib"; use Restrictionmap; use Rebase; use SeqFileIO; use strict; use warnings; my $rebase = Rebase->new( dbmfile => 'BIONET', bionetfile => 'bionet.212', mode => 0666, ); my $restrict = Restrictionmap->new( rebase => $rebase, enzyme => 'EcoRI HindIII', # GAATTC # AAGCTT sequence => 'ACGAATTCCGGAATTCG', graphictype => 'text', ); print "Locations are ", join ' ', $restrict->get_enzyme_map('EcoRI'), "\n"; print $restrict->get_graphic; ## Some bigger sequence my $biggerseq = SeqFileIO->new; $biggerseq->read(filename => 'map.fasta'); #$biggerseq->read(filename => 'sampleecori.dna'); generateGraphic ( $biggerseq->get_sequence, 'png'); generateGraphic ( $biggerseq->get_sequence, 'jpg'); sub generateGraphic { my ($sequence, $graphicType) = @_; my $restrict2 = Restrictionmap->new( rebase => $rebase, enzyme => 'EcoRI HindIII', # GAATTC # AAGCTT sequence => $sequence, graphictype => $graphicType, ); my $OUTFILE = "restrictionMap.$graphicType"; print "\nStoring $graphicType graphic of map of the sequence in $OUTFILE....\n\n"; unless (open(MYOUT, ">$OUTFILE")) { die "Couldn't open $OUTFILE for output."; } print MYOUT $restrict2->get_graphic(); }