Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Reverse Complement of DNA Sequences | DNA and Sequence Analysis
Python for Biologists

bookReverse Complement of DNA Sequences

The concept of the reverse complement is central to DNA sequence analysis. DNA is composed of two complementary strands that run in opposite directions, held together by specific base pairing: adenine (A) pairs with thymine (T), and cytosine (C) pairs with guanine (G). The reverse complement of a DNA sequence is formed by first reversing the sequence and then replacing each nucleotide with its complement: A with T, T with A, C with G, and G with C. This operation is biologically significant because, in many molecular biology techniques, such as PCR (polymerase chain reaction), you often need to know the sequence of both DNA strands. The reverse complement is also used when designing primers, analyzing genes, or searching for motifs on the opposite strand.

1234567
def reverse_complement(dna): # Create translation table: A <-> T, C <-> G complement_table = str.maketrans("ATCGatcg", "TAGCtagc") # Translate to complement complement = dna.translate(complement_table) # Reverse the complemented string return complement[::-1]
copy

Let’s break down how the reverse_complement function works. First, a translation table is created using str.maketrans, mapping each nucleotide to its complement (A to T, T to A, C to G, G to C). This mapping also covers lowercase letters for flexibility. The translate method applies this mapping to the entire DNA sequence, producing the complement. Finally, the complemented sequence is reversed using slicing with [::-1], yielding the reverse complement. This process ensures that the resulting sequence accurately represents the sequence found on the opposite DNA strand, in the correct orientation for biological applications.

12345
# Example usage: dna_seq = "ATGCCGTA" rev_comp = reverse_complement(dna_seq) print("Original:", dna_seq) print("Reverse complement:", rev_comp)
copy

1. What is the reverse complement of the DNA sequence 'ATGC'?

2. Fill in the blank: To get the reverse complement, first _____ the sequence, then replace each nucleotide with its complement.

3. Why is the reverse complement important in PCR primer design?

question mark

What is the reverse complement of the DNA sequence 'ATGC'?

Select the correct answer

question-icon

Fill in the blank: To get the reverse complement, first _____ the sequence, then replace each nucleotide with its complement.

question mark

Why is the reverse complement important in PCR primer design?

Select the correct answer

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 1. Kapitel 6

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

bookReverse Complement of DNA Sequences

Swipe um das Menü anzuzeigen

The concept of the reverse complement is central to DNA sequence analysis. DNA is composed of two complementary strands that run in opposite directions, held together by specific base pairing: adenine (A) pairs with thymine (T), and cytosine (C) pairs with guanine (G). The reverse complement of a DNA sequence is formed by first reversing the sequence and then replacing each nucleotide with its complement: A with T, T with A, C with G, and G with C. This operation is biologically significant because, in many molecular biology techniques, such as PCR (polymerase chain reaction), you often need to know the sequence of both DNA strands. The reverse complement is also used when designing primers, analyzing genes, or searching for motifs on the opposite strand.

1234567
def reverse_complement(dna): # Create translation table: A <-> T, C <-> G complement_table = str.maketrans("ATCGatcg", "TAGCtagc") # Translate to complement complement = dna.translate(complement_table) # Reverse the complemented string return complement[::-1]
copy

Let’s break down how the reverse_complement function works. First, a translation table is created using str.maketrans, mapping each nucleotide to its complement (A to T, T to A, C to G, G to C). This mapping also covers lowercase letters for flexibility. The translate method applies this mapping to the entire DNA sequence, producing the complement. Finally, the complemented sequence is reversed using slicing with [::-1], yielding the reverse complement. This process ensures that the resulting sequence accurately represents the sequence found on the opposite DNA strand, in the correct orientation for biological applications.

12345
# Example usage: dna_seq = "ATGCCGTA" rev_comp = reverse_complement(dna_seq) print("Original:", dna_seq) print("Reverse complement:", rev_comp)
copy

1. What is the reverse complement of the DNA sequence 'ATGC'?

2. Fill in the blank: To get the reverse complement, first _____ the sequence, then replace each nucleotide with its complement.

3. Why is the reverse complement important in PCR primer design?

question mark

What is the reverse complement of the DNA sequence 'ATGC'?

Select the correct answer

question-icon

Fill in the blank: To get the reverse complement, first _____ the sequence, then replace each nucleotide with its complement.

question mark

Why is the reverse complement important in PCR primer design?

Select the correct answer

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 1. Kapitel 6
some-alt