
andreiareis
Novice
Oct 26, 2012, 11:42 AM
Post #1 of 3
(4097 views)
|
HELP! he cant find my word?!
|
Can't Post
|
|
Hi guys :) so i have another question for you ... im doing another script ...
sub WriteFasta { my $hash_string = $_[0]; my $outfile = $_[1]; my $dna = ""; my $sp = ""; my $id = ""; open (OUTFILE , ">>$outfile") or die ("Cannot open outfile fasta: $outfile. $!\n"); foreach my $string (keys $hash_string) { if ($string =~ m/LOCUS (\s+)((\D+)\_(\d+)).+/o){ $id = $2; } if ($string =~ m/\tORGANISM(.+)/o) { print $2; # $sp = $3; } if ($string =~ m/^ORIGIN/) { print "x"; while ($string =~ (/.+/)) { my $dna .= $string; } print $dna; $dna =~ s/[\s0-9]//g; } print OUTFILE ">" , $id , ' ' , "[", $sp , "]", "\n" , $dna; } close OUTFILE; return; } this only one of my subroutine the other its only for read the file and its working ... i check it! and the problem its the first if ... he cant find that match or word ORGANISM ... i checked if is write correctly .. it is ... i dont know ... the for loop in back is working! And file input is from genbank file (teste.gbk) Thanks :)
(This post was edited by andreiareis on Oct 26, 2012, 6:20 PM)
|