use Bio::Seq; my $seqobj = Bio::Seq->new( -seq => "ACTGTGTGTCC", -id => "Chlorella sorokiniana", -accession_number => "CAA41635" ); use Data::Dumper; Dumper($seqobj); $seqobj->seq(); $seqobj->subseq(5,10); $seqobj->accession_number(); $seqobj->alphabet(); $seqobj->version(); $seqobj->length(); $seqobj->desc(); $seqobj->primary_id(); $seqobj->display_id(); $trunc_seq_obj = $seqobj->trunc(5,10); print $seqobj->seq(),"\n"; print $trunc_seq_obj->seq(),"\n"; $revcom_seq_obj=$seqobj->revcom; print $seqobj->seq(),"\n"; print $revcom_seq_obj->seq(),"\n"; $translated_seq_obj=$seqobj->translate; print $seqobj->seq(),"\n"; print $translated_seq_obj->seq(),"\n"; $string = "ATTGCTTT"; print $seqobj->validate_seq($string),"\n"; $string = "TTT53FFF"; print $seqobj->validate_seq($string),"\n"; $seq = $seqobj->seq(); print "$seq\n"; $length = $seqobj->length(); print "$length\n"; $subseq = $seqobj->subseq(int($length/2), $length); print "$subseq\n"; $new_seq = $seq.$subseq; if($seqobj->validate_seq($new_seq)){ $seqobj->seq($new_seq); } print $seqobj->seq()," ", $seqobj->length(), "\n" $translated_obj = $seq; if( $seqobj->alphabet() == 'dna'){ $translated_obj = $seqobj->translate(); } print $translated_obj->seq(),"\n"; use Bio::Tools::SeqStats; $seq_stats = Bio::Tools::SeqStats->new(-seq => $seqobj); $hash_ref = $seq_stats->count_monomers(); Dumper($hash_ref); $hash_ref = Bio::Tools::SeqStats->count_codons($seqobj); Dumper($hash_ref); $weight = Bio::Tools::SeqStats->get_mol_wt($seqobj); Dumper($weight); Bio::Tools::SeqStats->hydropathicity($seqobj); use Bio::SeqIO; my $seqio_obj = Bio::SeqIO->new(-file => '>sequence.fasta', -format => 'fasta' ); Dumper($seqio_obj ); use Bio::SeqIO; use Bio::Seq; my $seqio_obj = Bio::SeqIO->new(-file => '>sequence.fasta', -format => 'fasta' ); my $seqobj = Bio::Seq->new( -seq => "ACTGTGTGTCC", -id => "Chlorella sorokiniana" ); $seqio_obj->write_seq($seqobj); my $seqobj = Bio::Seq->new( -seq => "ACTGTGTGTCCTGTGTCC", -id => "Modified Chlorella sorokiniana" ); $seqio_obj->write_seq($seqobj); use Bio::SeqIO; $seqio_obj = Bio::SeqIO->new(-file => "sequence.fasta", -format => "fasta" ); while ($seq_obj = $seqio_obj->next_seq){ print $seq_obj->seq,"\n"; } use Bio::DB::GenBank; $db_obj = Bio::DB::GenBank->new; Dumper($db_obj); use Bio::DB::GenBank; use Bio::Seq; $db_obj = Bio::DB::GenBank->new; $seq_obj = $db_obj->get_Seq_by_id(2); print $seq_obj->display_id(),"\n"; use Bio::DB::GenBank; use Bio::DB::Query::GenBank; $query = "Arabidopsis[ORGN] AND topoisomerase[TITL] and 0:3000[SLEN]"; $query_obj = Bio::DB::Query::GenBank->new(-db => 'nucleotide', -query => $query ); $gb_obj = Bio::DB::GenBank->new; $stream_obj = $gb_obj->get_Stream_by_query($query_obj); while ($seq_obj = $stream_obj->next_seq) { print $seq_obj->display_id, "\t", $seq_obj->length, "\n"; } use Bio::SearchIO; my $in = new Bio::SearchIO( -format => "blast", -file => "files/report.bls"); while(my $result = $in->next_result){ while(my $hit = $result->next_hit){ while(my $hsp = $hit->next_hsp){ print "Query=", $result->query_name, " Hit=", $hit->name, " Length=", $hsp->length('total'), " Percent_id=", $hsp->percent_identity, "\n"; } } }