Skip to content

Conversation

@falatfernando
Copy link

@falatfernando falatfernando commented Dec 4, 2025

Hi, I've been using ISMapper for a large-scale analysis and encountered a crash when running it on a fresh conda installation.

Summary Recent versions of Biopython (v1.80+) have removed the .strand shortcut attribute from SeqFeature objects, causing ISMapper to crash with an AttributeError. The strand information must now be accessed via .location.strand.

I've performed a test with the documentation test genomes and the pipeline and strand column is now correct.


Environment

ISMapper Version: Installed from the bioconda channel.

BioPython Version: >1.80 (Automatically installed with fresh environment).

The Error When create_output.py attempts to read the strand of flanking genes, it fails because the SeqFeature object no longer exposes .strand directly.

AttributeError: 'SeqFeature' object has no attribute 'strand'

Analysis
Initially, I attempted to patch this using getattr(feature, 'strand', None). While this prevented the crash, it resulted in data loss (all strand columns in the output table became None).

Further investigation confirmed that the attribute has been deprecated and moved. To maintain functionality and ensure correct output (1 for forward, -1 for reverse), the code must be updated to access the attribute from the feature's location.

Proposed Solution (Implemented)
I have updated create_output.py script to correctly access the strand information compatible with modern Biopython versions.

Original (Broken): self.left_strand = left_feature.strand

Fix: self.left_strand = left_feature.location.strand

This restores the correct 1 / -1 values in the final output table.

@falatfernando falatfernando marked this pull request as draft December 5, 2025 15:01
@falatfernando falatfernando changed the title Fix: Handle SeqFeature objects with no strand attribute, preventing script crash. Fix AttributeError: 'SeqFeature' object has no attribute 'strand' (Biopython >1.80 compatibility) Dec 5, 2025
@falatfernando falatfernando marked this pull request as ready for review December 5, 2025 15:43
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

Successfully merging this pull request may close these issues.

1 participant