File: test_biopython_integration.py

package info (click to toggle)
python-gffutils 0.13-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,164 kB
  • sloc: python: 5,557; makefile: 62; sh: 13
file content (20 lines) | stat: -rw-r--r-- 650 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from gffutils import example_filename
import gffutils
import gffutils.biopython_integration as bp


def test_roundtrip():
    """
    Feature -> SeqFeature -> Feature should be invariant.
    """
    db_fname = gffutils.example_filename("gff_example1.gff3")
    db = gffutils.create_db(db_fname, ":memory:")
    feature = db["ENSMUSG00000033845"]
    feature.keep_order = True
    dialect = feature.dialect
    s = bp.to_seqfeature(feature)
    assert s.location.start == feature.start - 1
    assert s.location.end == feature.stop
    assert s.id == feature.id
    f = bp.from_seqfeature(s, dialect=dialect, keep_order=True)
    assert feature == f