Você está na página 1de 4

Usage of the modules in Perl program:

1. BioPerl module for Bio::AlignIO

use Bio::AlignIO;

$inputfilename = "testaln.fasta";
$in = Bio::AlignIO->new(-file => $inputfilename ,
-format => 'fasta');
$out = Bio::AlignIO->new(-file => ">out.aln.pfam" ,
-format => 'pfam');

while ( my $aln = $in->next_aln() ) {


$out->write_aln($aln);
}

2. BioPerl module for Bio::SeqIO

use Bio::SeqIO;

$in = Bio::SeqIO->new(-file => "inputfilename" ,


-format => 'Fasta');
$out = Bio::SeqIO->new(-file => ">outputfilename" ,
-format => 'EMBL');

while ( my $seq = $in->next_seq() ) {


$out->write_seq($seq);
}

3. Bio::DB::GenBank

Use Bio::DB::GenBank
get_seq_by_id(‘ROA1_HUMAN’);
get_string_by_gi($gi1,$gi2);

use Bio::SeqIO;
use Bio::DB::GenBank;

my $gb=Bio::DB::GenBank-> new();
my $out= Bio::SeqIO-> new (-file=> ‘filename’
-format=>’GenBank’);
My $seqio=$gb-> get_Stream_by_gi([‘AAYS4435’,’AA48440’])

While(my $seq=$seqIO->next_seq())
{
$out->write_seq($seq);
}
4. Bio::Annotation::AnnotationFactory

package Bio::Annotation::AnnotationFactory;
use strict;

use base qw(Bio::Root::Root Bio::Factory::ObjectFactoryI);

=head

Title : new
Usage : my $obj = Bio::Annotation::AnnotationFactory->new();
Function: Builds a new Bio::Annotation::AnnotationFactory object
Returns : Bio::Annotation::AnnotationFactory
Args : -type => string, name of a L<Bio::AnnotationI> derived class.

If type is not set the module guesses it based on arguments passed to


method L<create_object>.

=cut

5. Bio::Ontology::Term

package Bio::Ontology::Term;
use strict;
use Bio::Ontology::Ontology;
use Bio::Ontology::OntologyStore;
use Bio::Annotation::DBLink;
use Data::Dumper;

use constant TRUE => 1;


use constant FALSE => 0;

use base qw(Bio::Root::Root Bio::Ontology::TermI Bio::IdentifiableI Bio::DescribableI);

=head new

Title : new
Usage : $term = Bio::Ontology::Term->new(
-identifier => "16847",
-name => "1-aminocyclopropane-1-carboxylate synthase",
-definition => "Catalysis of ...",
-is_obsolete => 0,
-comment => "" );
Function: Creates a new Bio::Ontology::Term.
Returns : A new Bio::Ontology::Term object.
Args : -identifier => the identifier of this term [scalar]
-name => the name of this term [scalar]
-definition => the definition of this term [scalar]
-ontology => the ontology this term lives in
(a Bio::Ontology::OntologyI object)
-version => version information [scalar]
-is_obsolete => the obsoleteness of this term [0 or 1]
-comment => a comment [scalar]
-dblinks => Bio::Annotation::DBLink objects
[reference to array]
-references => Bio::Annotation::Reference objects
[reference to array]
See L<Bio::Ontology::OntologyI>, L<Bio::Annotation::Reference>,
L<Bio::Annotation::DBLink>.
=cut

6. Bio::Taxonomy::Factory

package Bio::Taxonomy::FactoryI;
use strict;

use base qw(Bio::Root::Root);

=head2 fetch

Title: fetch
Usage: my $taxonomy = $factory->fetch(-taxon_id => 9605);
my $taxonomy = $factory->fetch(-common_name => 'mammals');
Fuctnion: Fetch taxonomy by taxon_id, common name or scientific name.
Returns: an instance of Bio::Taxonomy
Args: -taxon_id => NCBI taxonomy ID
-common_name => comon name, such as 'human', 'mammals'
-scientifc_name => specitic name, such as 'sapiens', 'Mammalia'

=cut

7. Bio::Annotation::DBLink

package Bio::Annotation::DBLink;
use strict;

use base qw(Bio::Root::Root Bio::AnnotationI Bio::IdentifiableI);


sub new {
my($class,@args) = @_;

my $self = $class->SUPER::new(@args);

my ($database,$primary_id,$optional_id,$comment,$tag,$type,$ns,$auth,$v,$url) =
$self->_rearrange([qw(DATABASE
PRIMARY_ID
OPTIONAL_ID
COMMENT
TAGNAME
TYPE
NAMESPACE
AUTHORITY
VERSION
URL
)], @args);

$database && $self->database($database);


$primary_id && $self->primary_id($primary_id);
$optional_id && $self->optional_id($optional_id);
$comment && $self->comment($comment);
$tag && $self->tagname($tag);
$type && $self->type($type);
# Bio::IdentifiableI parameters:
$ns && $self->namespace($ns); # this will override $database
$auth && $self->authority($auth);
defined($v) && $self->version($v);
defined($url) && $self->url($url);

return $self;
}
1;

8. Bio::Map::CytoMap

package Bio::Map::CytoMap;
use vars qw($MAPCOUNT);
use strict;
use base qw(Bio::Map::SimpleMap);
BEGIN { $MAPCOUNT = 1; }
sub new {
my ($class, @args) = @_;
my $self = $class->SUPER::new(@args);
$self->{'_uid'} = $MAPCOUNT++;
my ($uid) = $self->_rearrange([qw(UID)], @args);
defined $uid && $self->unique_id($uid);
return $self;
}
sub type {
return 'cyto';
}
sub length {
return 0;
}
1;