The Computer Language
24.11 Benchmarks Game

reverse-complement Perl #3 program

source code

# The Computer Language Benchmarks Game
# https://salsa.debian.org/benchmarksgame-team/benchmarksgame/
#
# Contributed by David Eccles (gringer)

use strict;
use feature 'say';

local $/ = ">";
while (my $entry = <STDIN>) {
   chomp $entry;

   my ($header, $seq) = split /\n/, $entry, 2;
   next unless $header;

   {
      local $/ = "\n";
      say ">", $header;

      $seq =  reverse $seq;
      $seq =~ tr{wsatugcyrkmbdhvnATUGCYRKMBDHV\n}
              {WSTAACGRYMKVHDBNTAACGRYMKVHDB}d;

		for(my $pos = 0; $pos < length($seq); $pos += 60){
			say substr($seq, $pos, 60);
		}
   }
}

    

notes, command-line, and program output

NOTES:
64-bit Ubuntu quad core
This is perl 5, version 40
subversion 0 (v5.40.0)
x86_64-linux-thread-multi


 Mon, 10 Jun 2024 19:32:46 GMT

COMMAND LINE:
 /opt/src/perl-5.40.0/bin/perl revcomp.perl-3.perl 0 < revcomp-input100000001.txt

(TRUNCATED) PROGRAM OUTPUT:
>ONE Homo sapiens alu
CTGGGATTACAGGCGTGAGCCACCGCGCCCGGCCTTTTTGAGACGGAGTCTCGCTCTGTC
GCCCAGGCTGGAGTGCAGTGGCGCGATCTCGGCTCACTGCAACCTCCGCCTCCCGGGTTC
AAGCGATTCTCCTGCCTCAGCCTCCCGAGTAGCTGGGATTACAGGCGCGCGCCACCACGC
CCGGCTAATTTTTGTATTTTTAGTAGAGACGGGGTTTCACCATGTTGGCCAGGCTGGTCT
CGAACTCCTGACCTCAGGTGATCCGCCCGCCTCGGCCTCCCAAAGTGCTGGGATTACAGG
CGTGAGCCACCGCGCCCGGCCTTTTTGAGACGGAGTCTCGCTCTGTCGCCCAGGCTGGAG
TGCAGTGGCGCGATCTCGGCTCACTGCAACCTCCGCCTCCCGGGTTCAAGCGATTCTCCT
GCCTCAGCCTCCCGAGTAGCTGGGATTACAGGCGCGCGCCACCACGCCCGGCTAATTTTT
GTATTTTTAGTAGAGACGGGGTTTCACCATGTT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