Biopython
GFFparsing
#
Find similar titles
- 최초 작성자
Structured data
- Category
- Programming
Table of Contents
Biopython / GFF parsing #
Biopython에 GFF Parsing이란 ? #
Biopython은 GFF(GFF3, GFF2) 그리고 GTF format을 다룰 수 있는 GFF parser를 제공한다.
기본적인 GFF parsing 방법 #
일반적인 GFF Parser는 Biopython에 다른 parser들과 유사하다. GFF file을 다루기 위한 parse를 calling한 다음 SeqRecord object의 set로 돌려준다.
예제로
from BCBio import GFF
in_file = "your_file.gff"
in_handle = open(in_file)
for rec in GFF.parse(in_handle):
print rec
in_handle.close()
관심있는 대상만 parsing하는 방법 #
from BCBio import GFF
in_file = "your_file.gff"
limit_info = dict(
gff_id = ["chr1"],
gff_source = ["Coding_transcript"])
in_handle = open(in_file)
다른 file format을 GFF3로 전환하는 방법 #
from BCBio import GFF
from Bio import SeqIO
in_file = "your_file.gb"
out_file = "your_file.gff"
in_handle = open(in_file)
out_handle = open(out_file, "w")
GFF.write(SeqIO.parse(in_handle, "genbank"), out_handle)
in_handle.close()
out_handle.close()