Created
November 5, 2009 16:14
-
-
Save rbuels/227164 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/perl | |
| my $new_seq = Bio::Seq::RichSeq->new(); | |
| my $searchio = Bio::SearchIO->new( -format => 'blastxml', | |
| -file => 'blastout.xml' ); | |
| while ( my $result = $searchio->next_result() ) { | |
| while( my $hit = $result->next_hit ) { | |
| # process the Bio::Search::Hit::HitI object | |
| while( my $hsp = $hit->next_hsp ) { | |
| # process the Bio::Search::HSP::HSPI object | |
| # tweak the dna seq | |
| $new_seq->seq( 'AACTGCGCTAGCTACGATCACA' ); | |
| # make a new feature and attach it | |
| my $feat = Bio::SeqFeature::Generic->new( -start => 5, | |
| -end => 523, | |
| ... | |
| ); | |
| $new_seq->annotations->add_Annotation($feat); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment