Biopython Tutorial und Kochbuch Japanische Übersetzung (4.6)

4.6 The format method Bis 4.5 The format() method of the SeqRecord class gives a string containing your record formatted using one of the output file formats supported by Bio.SeqIO, such as FASTA: ** Das SeqRecord-Format () kann einen Datensatz (eine Sequenz) in eine von Bio.SeqIO unterstützte Zeichenfolge konvertieren, z. B. FASTA **

from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio.Alphabet import generic_protein

record = SeqRecord(
    Seq(
        "MMYQQGCFAGGTVLRLAKDLAENNRGARVLVVCSEITAVTFRGPSETHLDSMVGQALFGD"
        "GAGAVIVGSDPDLSVERPLYELVWTGATLLPDSEGAIDGHLREVGLTFHLLKDVPGLISK"
        "NIEKSLKEAFTPLGISDWNSTFWIAHPGGPAILDQVEAKLGLKEEKMRATREVLSEYGNM"
        "SSAC",
        generic_protein,
    ),
    id="gi|14150838|gb|AAK54648.1|AF376133_1",
    description="chalcone synthase [Cucumis sativus]",
)

print(record.format("fasta"))

which should give:

>gi|14150838|gb|AAK54648.1|AF376133_1 chalcone synthase [Cucumis sativus]
MMYQQGCFAGGTVLRLAKDLAENNRGARVLVVCSEITAVTFRGPSETHLDSMVGQALFGD
GAGAVIVGSDPDLSVERPLYELVWTGATLLPDSEGAIDGHLREVGLTFHLLKDVPGLISK
NIEKSLKEAFTPLGISDWNSTFWIAHPGGPAILDQVEAKLGLKEEKMRATREVLSEYGNM
SSAC

This format method takes a single mandatory argument, a lower case string which is supported by Bio.SeqIO as an output format (see Chapter 5). However, some of the file formats Bio.SeqIO can write to require more than one record (typically the case for multiple sequence alignment formats), and thus won’t work via this format() method. See also Section 5.5.4. *** Formatmethode erfordert ein Argument, ist das von Bio.SeqIO unterstützte Format der Ausgabe (untere Zeichenfolge). Wenn Sie jedoch mehrere Arrays haben, können Sie die format () -Methode nicht verwenden. Siehe 5.5.4. *** ***

Recommended Posts

Biopython Tutorial und Kochbuch Japanische Übersetzung (4.3)
Biopython Tutorial und Kochbuch Japanische Übersetzung (4.5)
Biopython Tutorial und Kochbuch Japanische Übersetzung (4.8)
Biopython Tutorial und Kochbuch Japanische Übersetzung (4.7)
Biopython Tutorial und Kochbuch Japanische Übersetzung (4.9)
Biopython Tutorial und Kochbuch Japanische Übersetzung (4.6)
Biopython Tutorial und Kochbuch Japanische Übersetzung (4.2)
Biopython Tutorial und Kochbuch Japanische Übersetzung (4.4)
Biopython Tutorial und Kochbuch Japanische Übersetzung (Kapitel 1, 2)
Streamlit Tutorial Japanische Übersetzung
sosreport Japanische Übersetzung
[Übersetzung] Hyperopt-Tutorial
stromlinienförmige Erklärung japanische Übersetzung
man systemd.service Japanische Übersetzung
man nftables Japanische Übersetzung
Dockerfile Reference Japanische Übersetzung
docker-compose --help japanische Übersetzung
Docker helfen japanische Übersetzung
SymPy Tutorial Japanische Notizen
[PyTorch] Tutorial (japanische Version) ② ~ AUTOGRAD ~
Docker Build - Hilfe japanische Übersetzung
Chainer, RNN und maschinelle Übersetzung
[PyTorch] Tutorial (japanische Version) ① ~ Tensol ~
Japanische Übersetzung des Linux-Handbuchs
Docker run --help japanische Übersetzung
Pandas Benutzerhandbuch "Tabellenformatierung und Pivot-Tabelle" (offizielles Dokument Japanische Übersetzung)