B
BD
My script is :
use warnings;
use strict;
my $rs = $/;
$/='>';
$,="\t",$\="\n";
my $filename ="file.txt";
open my $file1,'<',$filename or die "Cannot open file $filename
\n $!";
while(<$file1>){
chomp;
next unless length $_;
my ($header,$seq)=split"\n",$_,2;
$seq =~s/\n//g;
print "$header\n";
$seq =~ /GO:[0-9]*/mg;
print " $&\n";
}
$/=$rs ;
close $file1;
my input data is:
GO:0000004 biological_process unknown P TAIR|gene:2133138~84.88~63
GO:0005554 molecular_function unknown F TIGR_Ath1|At4g21010~84.88~63
activity 1.3.3.4 F TAIR|gene:2077669~88.93~52
GO:0008131 amine oxidase activity F TAIR|gene:2077669~88.93~52
GO:0006779 porphyrin biosynthesis P TAIR|gene:2077669~88.93~52
GO:0015036 disulfide oxidoreductase
activity F TAIR|gene:2077669~88.93~52
polarity P TIGR_Ath1|At2g22640~97.78~74
GO:0005554 molecular_function unknown F TIGR_Ath1|At2g22640~97.78~74
Here I am trying to parse this fasta file and I getting the output also
what I want accept that what I am getting from regular expression ,it
prints only once though i am trying to print every time it matches like
in first data it has 2 GO value ..so I want it should print both values
but i am getting only first value.
where should I change in my script?
Thanks.
use warnings;
use strict;
my $rs = $/;
$/='>';
$,="\t",$\="\n";
my $filename ="file.txt";
open my $file1,'<',$filename or die "Cannot open file $filename
\n $!";
while(<$file1>){
chomp;
next unless length $_;
my ($header,$seq)=split"\n",$_,2;
$seq =~s/\n//g;
print "$header\n";
$seq =~ /GO:[0-9]*/mg;
print " $&\n";
}
$/=$rs ;
close $file1;
my input data is:
GO:0009507 chloroplast C TAIR|gene:2133138~84.88~63TC227001
GO:0000004 biological_process unknown P TAIR|gene:2133138~84.88~63
GO:0005554 molecular_function unknown F TIGR_Ath1|At4g21010~84.88~63
GO:0004033 aldo-keto reductase activity F TIGR_Ath1|At1g59960~78.66~50TC227002
GO:0008536 RAN protein binding F TIGR_Ath1|At3g26100~90.11~61TC227004
GO:0004729 protoporphyrinogen oxidaseTC227005
activity 1.3.3.4 F TAIR|gene:2077669~88.93~52
GO:0008131 amine oxidase activity F TAIR|gene:2077669~88.93~52
GO:0006779 porphyrin biosynthesis P TAIR|gene:2077669~88.93~52
GO:0015036 disulfide oxidoreductase
activity F TAIR|gene:2077669~88.93~52
GO:0007163 establishment and/or maintenance of cellTC219924
polarity P TIGR_Ath1|At2g22640~97.78~74
GO:0005554 molecular_function unknown F TIGR_Ath1|At2g22640~97.78~74
Here I am trying to parse this fasta file and I getting the output also
what I want accept that what I am getting from regular expression ,it
prints only once though i am trying to print every time it matches like
in first data it has 2 GO value ..so I want it should print both values
but i am getting only first value.
where should I change in my script?
Thanks.