[Bioperl-l] display ID fasta format

Hans-Rudolf Hotz hrh at fmi.ch
Fri May 20 07:45:57 UTC 2011


Hi 'joyeux2000'

Have you read:

http://www.bioperl.org/wiki/HOWTO:Beginners
http://www.bioperl.org/wiki/HOWTO:SeqIO



Regards, Hans


On 05/19/2011 11:48 PM, debutant.bioperl wrote:
>
> Hello all,
> I want to display the sequence ID in which case there is an occurrence of
> the motif. Please, is there a regular expression to display the ID for the
> fasta format, if not how can I do to display the first word line.
> excuse me for these questions, but really I'm still a beginner.
> cordially
>
> ................................................................................................................................
>
> #!/usr/bin/perl
> use strict;
> use warnings;
> use Bio::SeqIO;
>
> my $file = 'eee.txt';
> my $in  = Bio::SeqIO->new(-file =>  $file , '-format' =>  'fasta');
> while ( my $seq = $in->next_seq() ) {
>      my $seqstring = $seq->seq;
>      while ( $seqstring =~ m/(ATCGA)/g ) {
>          my $end = pos($seqstring);
>          my $start = $end - length($&) + 1;
>          print "ATCGA commence à la position $start\nse termine juste avant
> la position $end\n";
>      }
> }
>
>



More information about the Bioperl-l mailing list