Sie sind auf Seite 1von 5

EX .1 #! /usr/bin/perl -w # use strict; use Bio::SeqIO; my $in=Bio::SeqIO->newFh (-file=>'<seqs.sp', -format=>'swiss'); my $out=Bio::SeqIO->newFh (-file=>'>archie1.fasta',-format=>'fasta'); print $out $_ while <$in>; EX .

2 use Bio::SeqIO; my $inform=shift@ARGV; my $outform=shift@ARGV; my $infile=shift@ARGV; my $outfile=shift@ARGV; if(!defined $outfile) { $outfile=$infile; $outfile=~ s/\..*$// if $outfile=~/\./; $outfile.=".".$outform; } my $in=Bio::SeqIO->newFh (-file=>$infile,-format=>$inform); my $out=Bio::SeqIO->newFh (-file=>">$outfile",-format=>$outform); print $out $_ while <$in>; EX .3 use Bio::DB::SwissProt; my $database=new Bio::DB::SwissProt; my $seq=$database->get_Seq_by_id('BACR_HALHA'); print "Seq :",$seq->accession_number(),"\n_",$seq->desc(),"\n"; EX. 4 use Bio::PrimarySeq; my $seq=new Bio::PrimarySeq(-seq=>"GCATCACCGGGACGACGACGCC", -diaplay_id=>"example1"); print ("length of sequence is :", $seq->length, "\n");

print ("Seq. Translated into protein code :", $seq->translate()->seq,"\n");

EX .5 use Bio::PrimarySeq; $seqobj=Bio::PrimarySeq->new (-seq=>'gctagacgagtgtgtacactatcatc', -id=>'Gene Fragment-12', -accession_number=>'X78121', -alphabet=>'dna',-is_circular=>1); print "Sequence ID", $seqobj->id(), "with accession number : ", $seqobj>accession_number, "\n"; print "Sequence : ",$seqobj->seq; EX.6 use Bio::Seq; use Bio::SeqIO; $inputstream=Bio::SeqIO->new(-file=>"archie.fasta",-format=>'Fasta'); while(($seqobj=$inputstream->next_seq())) { $did=$seqobj->display_id; print "Seen Sequence :" , $did, "\n"; print "start of sequence :", substr($seqobj->seq,1,10), "\n"; $seq1=$seqobj->seq(); } my $seq=new Bio::Seq(-seq=>$seq1, -display_id=>$did); print ("Length of the sequence is :", $seq->length, "\n"); print ("Sequence translated into amino acis: \n", $seq->translate()->seq(), "\n" ); EX.7 use Bio::AlignIO; my $in=new Bio::AlignIO(-file=>, $ARGV[0], -format=>'clustalw'); my $aln=$in->next_aln(); print "Same length of all the sequences : ", $aln->is_flush()? "yes":"no", "\n";

print "Alignment length : " , $aln->length(), "\n"; printf "identity % : %.2f%% \n", $aln->percentage_identity(); printf "Identity of conserved columns : %.2f%% \n", $aln->overall_percentage_ide ntity(); EX .7 use Bio::AlignIO; $str=Bio::AlignIO->new ('-file'=>'venks1.pfam'); $aln=$str->next_aln(); print $aln->length, "\n"; print $aln->no_residues, "\n"; print $aln->is_flush, "\n"; print $aln->no_sequences, "\n"; print $aln->percentage_identity, "\n"; print $aln->consensus_string(50), "\n"; $pos=$aln->column_from_residue_number('TASM_BFDV',14); print $pos; foreach $seq($aln->each_seq) { $res=$seq->subseq($pos,$pos); $count=($res)++; } foreach $res(keys %count) { printf "Res : %s Count : %2d \n", $res, $count,($res); } EX 8. use Bio::AlignIO; # reads the alignment from the emboss program using Smith Waterman Algorithm my $in=new Bio::AlignIO(-format=>'emboss', -file=>'seqs_a.water'); print "Alignment :", $in->write_aln(); EX 9.

use Bio::Seq; use Bio::SeqIO; $seqin = Bio::SeqIO->new( -format => 'EMBL' , -file => 'jen.embl'); $seqout= Bio::SeqIO->new( -format => 'Fasta', -file => '>venks.fa'); while((my $seqobj = $seqin->next_seq())) { print "Seen sequence ",$seqobj->display_id,", start of seq ", substr($seqobj->seq,1,10),"\n"; if( $seqobj->moltype eq 'dna') { $rev = $seqobj->revcom; $id = $seqobj->display_id(); $id = "$id.rev"; $rev->display_id($id); $seqout->write_seq($rev); } foreach $feat ( $seqobj->top_SeqFeatures() ) { if( $feat->primary_tag eq 'exon' ) { print STDOUT "Location ",$feat->start,":", $feat->end," GFF[",$feat->gff_string,"]\n"; } } } EX 10. use Bio::SeqIO; use Bio::Tools::Run::StandAloneBlast; my $Seq_in = Bio::SeqIO->new (-file => $ARGV[0], -format => 'fasta'); my $query = $Seq_in->next_seq(); my $factory = Bio::Tools::Run::StandAloneBlast->new('program' => 'blastp', 'dat abase' => 'swissprot', _READMETHOD => "Blast" ); my $blast_report = $factory->blastall($query); my $result = $blast_report->next_result; while( my $hit = $result->next_hit()) { print "\thit name: ", $hit->name(), " significance: ", $hit->significance(), "\n";} EX 11. use Bio::SeqIO; use Bio::Tools::Run::StandAloneBlast; use Bio::AlignIO; #Get 2 sequences $str = Bio::SeqIO->new(-file=>'seqp.fasta' , '-format' => 'Fasta'); my $seq3 = $str->next_seq(); my $seq4 = $str->next_seq(); # Run bl2seq on them $factory = Bio::Tools::Run::StandAloneBlast->new('program' => 'blastp', 'outfile' => 'bl2seq.out'); my $bl2seq_report = $factory->bl2seq($seq3, $seq4); # Use AlignIO.pm to create a SimpleAlign object from the bl2seq report

$str = Bio::AlignIO->new(-file=> 'bl2seq.out','-format' => 'bl2seq'); $aln = $str->next_aln(); print $aln->length, "\n"; print $aln->no_residues, "\n"; print $aln->is_flush, "\n"; print $aln->no_sequences, "\n"; print $aln->percentage_identity, "\n";

Das könnte Ihnen auch gefallen