Peter Keystrokes has asked for the wisdom of the Perl Monks concerning the following question:
Any pointers will be well appreciated.my %id2seq = (); my $id = ''; open File,"human_hg19_circRNAs_putative_spliced_sequence.fa",or die $! +; while(<File>){ chomp; if($_ =~ /^>(.+)/){ $id = $1; }else{ $id2seq{$id} .= $_; } } my $filename = "'$id'"; open (my $fh, '>', $filename) or die "Could not open '$filename' $!"; + foreach $id (keys %id2seq){ print $fh ($id."\n",$id2seq{$id}, "\n"); } close File; close $fh;
|
|---|