small pod fix
[bioperl-live.git] / examples / liveseq / change_gene.pl
blobc0534e02d9a6af6d8cff561673113a2eb6a12a48
1 #!/usr/bin/perl
2 # $Id$
4 use strict;
5 use Bio::LiveSeq::IO::BioPerl;
6 use Bio::LiveSeq::Mutator;
7 use Bio::LiveSeq::Mutation;
8 use Bio::Variation::IO;
10 if ($#ARGV < 1) { # one argument input
11 print <<USAGE;
13 LiveSeq::Mutator example by Joseph Insana
15 Arguments: filename containing embl entry, gene_name
16 It will create that Bio::LiveSeq::Gene and print out some
17 basic informations about it.
18 It will then issue mutations and print results
20 Usage: change_gene.pl filename genename
22 Example: change_gene.pl ../../t/data/ar.embl AR
23 USAGE
24 exit;
25 } else {
27 my $filename=$ARGV[0];
28 my $loader=Bio::LiveSeq::IO::BioPerl->load(-file => "$filename");
30 my $gene_name=$ARGV[1];
31 my $gene=$loader->gene2liveseq(-gene_name => $gene_name,
32 -getswissprotinfo => 0);
34 print STDERR "Gene: ",$gene->name,"\n";
35 print STDERR " Moltype: ", $gene->get_DNA->alphabet, "\n";
36 print STDERR " Features:\n";
37 print STDERR $gene->printfeaturesnum();
38 print STDERR " Gene has boundaries ",$gene->upbound," - ",$gene->downbound,"\n";
39 print STDERR " Gene has maxtranscript with start ",$gene->maxtranscript->start,
40 " end ",$gene->maxtranscript->end," strand ",$gene->maxtranscript->strand,"\n";
41 print STDERR " DNA has boundaries ",$gene->get_DNA->start," - ",$gene->get_DNA->end,"\n";
42 print STDERR "\n";
44 print STDERR "Now issuing mutations to the gene....\n";
46 my $mutation = new Bio::LiveSeq::Mutation (-seq =>'A',
47 -pos => 64
49 my $mutate = Bio::LiveSeq::Mutator->new(-gene => $gene,
50 -numbering => "coding"
52 $mutate->add_Mutation($mutation);
53 my $results=$mutate->change_gene();
54 print "\n";
55 if ($results) {
56 my $out = Bio::Variation::IO->new( '-format' => 'flat');
57 $out->write($results);