#!/usr/bin/perl -w # Calculating the complement of a strand of DNA # The DNA $strand1 = ACGGGAGGACGGGAAAATTACTACGGCATTAGC ; print strand1: $strand1\n ; # Copy strand1 into strand2 $strand2 = $strand1; # Replace all bases by their complements: A->T, T->A, G->C, C->G # tr replaces each char in first part with char in second part $strand2 =~ tr/ATGC/TACG/; print strand2: $strand2 \n ; exit; % complement2 strand1: ACGGGAGGACGGGAAAATTACTACGGCATTAGC strand2: TGCCCTCCTGCCCTTTTAATGATGCCGTAATCG Come è stato eliminato il baco.
{}