Najlepiej przechowywać informacje o typie biologicznym (DNA, RNA, proteiny) oddzielnie od sekwencji, zamiast używać jawnego argumentu alfabetycznego. >>># This script creates a DNA sequence and performs some typical manipulations
>>>from Bio.Seq import Seq >>>dna_sequence = Seq("AGGCTTCTCGTA") >>>print(dna_sequence) Seq('AGGCTTCTCGTA')
>>>print(dna_sequence[2:7]) Seq('GCTTC')
>>>print(dna_sequence.reverse_complement()) Seq('TACGAGAAGCCT')
>>>rna_sequence = dna_sequence.transcribe() >>>print(rna_sequence) Seq('AGGCUUCUCGUA')
>>>print(rna_sequence.translate()) Seq('RLLV')
Opis sekwencji Klasa SeqRecord opisuje sekwencje wraz z informacjami takimi jak nazwa, opis i cechy w postaci obiektów SeqFeature. Każdy obiekt SeqFeature określa typ cechy i jej lokalizację. Położenie cech w sekwencji może być dokładne lub przybliżone. >>>#The script reads a GenBank file to extract and print the sequence’s name and description. It then accesses and displays detailed information about a specific annotated feature (e.g., a gene) within the sequence.
>>>from Bio import SeqIO >>>seq_record = SeqIO.read("sequence.gb", "genbank")
>>># Access metadata >>>print(seq_record.name) >>>print(seq_record.description) 'NC_005816' 'Yersinia pestis biovar Microtus str.