Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_roundtrip fails: test_roundtrip #233

Open
yurivict opened this issue Jun 16, 2024 · 1 comment
Open

test_roundtrip fails: test_roundtrip #233

yurivict opened this issue Jun 16, 2024 · 1 comment

Comments

@yurivict
Copy link

______________________________________________________________________________________ test_roundtrip _______________________________________________________________________________________

    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)

gffutils/test/test_biopython_integration.py:15: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

feature = <Feature gene (chr1:4763287-4775820[-]) at 0xbc359633390>

    def to_seqfeature(feature):
        """
        Converts a gffutils.Feature object to a Bio.SeqFeature object.
    
        The GFF fields `source`, `score`, `seqid`, and `frame` are stored as
        qualifiers.  GFF `attributes` are also stored as qualifiers.
    
        Parameters
        ----------
        feature : Feature object, or string
            If string, assume it is a GFF or GTF-format line; otherwise just use
            the provided feature directly.
        """
        if isinstance(feature, str):
            feature = feature_from_line(feature)
    
        qualifiers = {
            "source": [feature.source],
            "score": [feature.score],
            "seqid": [feature.seqid],
            "frame": [feature.frame],
        }
        qualifiers.update(feature.attributes)
>       return SeqFeature(
            # Convert from GFF 1-based to standard Python 0-based indexing used by
            # BioPython
            FeatureLocation(
                feature.start - 1, feature.stop, strand=_biopython_strand[feature.strand]
            ),
            id=feature.id,
            type=feature.featuretype,
            qualifiers=qualifiers,
        )
E       NameError: name 'SeqFeature' is not defined

gffutils/biopython_integration.py:46: NameError

Version: 0.13
Python-3.11
FreeBSD 14.1

@mschubert
Copy link

I can confirm for gffutils=0.13, python=3.12 on Gentoo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants