CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate: HELP! he cant find my word?!: Edit Log



andreiareis
Novice

Oct 26, 2012, 11:42 AM


Views: 1830
HELP! he cant find my word?!

Hi guys :)

so i have another question for you ... im doing another script ...


Code
 
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)
Attachments: teste.gbk (32.7 KB)


Edit Log:
Post edited by andreiareis (Novice) on Oct 26, 2012, 11:46 AM
Post edited by andreiareis (Novice) on Oct 26, 2012, 6:20 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives