B
BD
Hi All, I allredy asked this type of question in some thread before but
I am trying that same Program in another way, But I am not getting
output what I want...
I am trying to make program that has First Input file like
SHFFHGLFHDFHBVVBBVJGFJGDKG
HDSFHLIHFL
and second Inputfile like
PPPPPPPPPPPPPPRRRRRSSSSSS
now I wrote a script which take data from second Input file and match
motif with First Input file and where it match print that header
Like here it match at second Sequence so in Output it should print
seq2
here is my code :
use warnings;
use strict;
my $header;
my $seq;
my $filename ='file1.txt' ;
open my $file1,'<',$filename or die "Cannot open file $filename \n $!";
$/='>';
$,="\t",$\="\n";
while(<$file1>){
chomp;
next unless length $_;
($header,$seq)=split"\n",$_,2;
$seq =~s/\n//g;
print $header,$seq;
}
close $file1;
my $Input='file2.txt ' ;
open my $file2,'<',$Input or die "Cannot open file $Input \n $!";
<$file2>;
my $motif = <$file2>;
chomp $motif;
print "Motif- $motif";
if ($seq=$motif){
print "\nI Found It ! $header\n\n";
}
close $file2;
I am getting output frome this script that
I Found It ! >seq3
whatever will be last Header,it will print ,though I want that in
which sequence it will found motif,it should print that header.
help will be appriciate.
Thanks
I am trying that same Program in another way, But I am not getting
output what I want...
I am trying to make program that has First Input file like
DDDDDFGDSDSDRTGDGDGDGDHseq1 AAAAAAAAAAABBBBBBBBBBCCCCCCC
CCCCCCCCCCCCDDDDDDDD
DDDDDDDDEEEEEEEFFFFFFFFFFFFFFF
KKKKKKKKLLLLLLLLLMMMMMM
MMMMMMNNNNNNNOOOOOOOOOOOOO
OPPPPPPPPPPPPPPRRRRRSSSSSS
seq3
SHFFHGLFHDFHBVVBBVJGFJGDKG
HDSFHLIHFL
and second Inputfile like
KKKKKKKKLLLLLLLLLMMMMMMMMMMMMNNNNNNNOOOOOOOOOOOOOOseq1
PPPPPPPPPPPPPPRRRRRSSSSSS
now I wrote a script which take data from second Input file and match
motif with First Input file and where it match print that header
Like here it match at second Sequence so in Output it should print
seq2
here is my code :
use warnings;
use strict;
my $header;
my $seq;
my $filename ='file1.txt' ;
open my $file1,'<',$filename or die "Cannot open file $filename \n $!";
$/='>';
$,="\t",$\="\n";
while(<$file1>){
chomp;
next unless length $_;
($header,$seq)=split"\n",$_,2;
$seq =~s/\n//g;
print $header,$seq;
}
close $file1;
my $Input='file2.txt ' ;
open my $file2,'<',$Input or die "Cannot open file $Input \n $!";
<$file2>;
my $motif = <$file2>;
chomp $motif;
print "Motif- $motif";
if ($seq=$motif){
print "\nI Found It ! $header\n\n";
}
close $file2;
I am getting output frome this script that
I Found It ! >seq3
whatever will be last Header,it will print ,though I want that in
which sequence it will found motif,it should print that header.
help will be appriciate.
Thanks