2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[Biopython]GenBank形式ファイルの一部を切り出す

2
Last updated at Posted at 2022-12-31

動機

GenBank形式ファイルからある遺伝子の部分だけを切り出したかったのだが、Biopythonでできることに気付いた。

crop_genbank.py

Requirements

Usage

$ ./crop_genbank.py
usage: crop_genbank.py [-h] -i INPUT --output FILE -s START -e END

Crop genbank file.

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        Genbank/DDBJ flatfile (required)
  --output FILE, -o FILE, --out FILE, --output FILE
                        output Genbank file
  -s START, --start START
                        start position
  -e END, --end END     end position
$ ./crop_genbank.py -i NC_003225.3.gb -s 199621 -e 230880 -o NC_003225_199621-230880.gb
  • 単一エントリにしか対応していない今後修正する
  • メタデータが消失するので今後修正する
  • 始点または終点に被ったfeatureは消失する
2
1
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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?