in reply to Creating very long strings from text files (DNA sequences)
This would look something like this:
So you're only doing one read per sequence (so there's no need for string concatenation at all).local $/ = "\n>"; my %seqs_hash; while (my $line = <SEQS>) { chomp $line; $line =~ s/^\>?\s*(.+)+$\r?\n// or do { warn "Malformatted sequence\n"; next; }; $seq_name = $1; $line =~ s/\s//gs; $seqs_hash{$seq_name} = $line; }
------------ :Wq Not an editor command: Wq
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Creating very long strings from text files (DNA sequences)
by bobychan (Initiate) on Jun 26, 2004 at 17:04 UTC | |
by etcshadow (Priest) on Jun 26, 2004 at 19:42 UTC |