LoginSignup
1
0

More than 3 years have passed since last update.

Biopython Tutorial and Cookbook和訳(4.9)

Last updated at Posted at 2020-08-13

4.9 Reverse-complementing SeqRecord objects

4.8へ

One of the new features in Biopython 1.57 was the SeqRecord object’s reverse_complement method.
This tries to balance easy of use with worries about what to do with the annotation in the reverse complemented record.
Biopython 1.57に新機能reverse_complementメソッドを追加しました。
配列に対して反転、補完操作した後に、より簡単にannotationを修正するためです。

For the sequence, this uses the Seq object’s reverse complement method.
Any features are transferred with the location and strand recalculated.
Likewise any per-letter-annotation is also copied but reversed (which makes sense for typical examples like quality scores).
However, transfer of most annotation is problematical.
配列に対しいてreverse_complementメソッドを使います。
featuresはlocationにより変換され,strandも再計算されます。
同様にper-letter-annotationもコピーかつ反転されます。(クオリティスコアに特に有効)
しかし多くのannotation変換に問題が存在します。

For instance, if the record ID was an accession, that accession should not really apply to the reverse complemented sequence, and transferring the identifier by default could easily cause subtle data corruption in downstream analysis.
Therefore by default, the SeqRecord’s id, name, description, annotations and database cross references are all not transferred by default.
例として、record IDはaccession(登録番号)の場合、そのaccessionが反転、補完された配列に使われるべきではない、そしてidentifierをデフォルトで変換したら下流プロセス分析時のデータ損害を起こすかもしれないです。
そのゆえデフォルトではSeqRecord’s id, name, description, annotationsおよびdatabase cross referencesの変換を行わないです。

The SeqRecord object’s reverse_complement method takes a number of optional arguments corresponding to properties of the record.
Setting these arguments to True means copy the old values, while False means drop the old values and use the default value.
You can alternatively provide the new desired value instead.
reverse_complementメソッドはrecordの属性に対応する複数のオプション引数があります。
それらをTrue指定すると元の値をコピーします。Falseの場合はデフォルトの値で古い値と交換します。
もちろん自分で新しい値を指定することもできます。

Consider this example record:
簡単な例:

>>> from Bio import SeqIO
>>> record = SeqIO.read("NC_005816.gb", "genbank")
>>> print("%s %i %i %i %i" % (record.id, len(record), len(record.features), len(record.dbxrefs), len(record.annotations)))
NC_005816.1 9609 41 1 13

Here we take the reverse complement and specify a new identifier – but notice how most of the annotation is dropped (but not the features):
reverse_complementメソッドを使って新しいIDを指定します - 注意すべきなのは多くのannotationを失ったが、featuresは健在です。

>>> rc = record.reverse_complement(id="TESTING")
>>> print("%s %i %i %i %i" % (rc.id, len(rc), len(rc.features), len(rc.dbxrefs), len(rc.annotations)))
TESTING 9609 41 0 0

4.9へ

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0