Skip to content

Commit c6fad7d

Browse files
authored
Document assembly assumptions: exact-match and monotonic coverage (#158)
Add module docstrings to assembly.py and variant_sequence.py documenting that the assembly requires exact sequence matches (breaks with long-read error rates) and that coverage trimming assumes monotonic decay (breaks with splice-junction reads). Add a note to README's Sequencing Recommendations section. Fixes #150
1 parent cd3e05c commit c6fad7d

4 files changed

Lines changed: 42 additions & 1 deletion

File tree

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,3 +389,11 @@ considers reads that overlap a variant. With 100bp reads you will be able to ass
389389
at most 199bp of sequence around a somatic single nucleotide variant, and consequently
390390
only be to determine 66 amino acids from the protein sequence. If you disable the cDNA
391391
assembly algorithm then a 100bp read will only be able to determine 33 amino acids.
392+
393+
**Note on long-read and error-prone data:** Isovar's cDNA assembly algorithm requires
394+
exact sequence matches when detecting overlaps between reads. This is well-suited for
395+
Illumina short reads (~0.1% error rate) but will produce fragmented or incomplete
396+
assemblies with long-read technologies (PacBio, Oxford Nanopore) that have higher
397+
indel error rates. The coverage-trimming step also assumes that read coverage decreases
398+
monotonically away from the variant locus, which may not hold for reads spanning
399+
splice junctions.

isovar/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# See the License for the specific language governing permissions and
1111
# limitations under the License.
1212

13-
__version__ = "1.4.14"
13+
__version__ = "1.4.15"
1414

1515

1616
from .allele_read import AlleleRead

isovar/assembly.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,26 @@
1010
# See the License for the specific language governing permissions and
1111
# limitations under the License.
1212

13+
"""
14+
Greedy overlap assembly of VariantSequence objects.
15+
16+
This module assembles short cDNA sequences (centered on a variant locus) into
17+
longer contiguous sequences by iteratively merging pairs with the largest
18+
overlaps.
19+
20+
Assumptions / limitations:
21+
22+
- **Exact sequence match**: overlap detection requires exact prefix/suffix
23+
containment (str.endswith / str.startswith). A single sequencing error in
24+
the flanking sequence prevents a merge. This is suitable for Illumina
25+
short reads (~0.1% error rate) but will produce fragmented assemblies
26+
with long-read technologies (PacBio/ONT, ~5-10% indel error rate).
27+
28+
- **Shared alt allele**: all input VariantSequence objects must carry the
29+
same alt allele string. Reads with different alleles at the variant locus
30+
should be separated before assembly.
31+
"""
32+
1333
from collections import defaultdict
1434

1535
from .default_parameters import MIN_VARIANT_SEQUENCE_ASSEMBLY_OVERLAP_SIZE

isovar/variant_sequence.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@
1010
# See the License for the specific language governing permissions and
1111
# limitations under the License.
1212

13+
"""
14+
VariantSequence represents an assembled cDNA sequence containing a mutation.
15+
16+
Note on coverage trimming: trim_by_coverage() assumes that read coverage
17+
drops off monotonically away from the variant locus. This is generally true
18+
for short Illumina reads centered on a variant, but can be violated by
19+
reads spanning splice junctions or by uneven fragment sizes, which may
20+
create coverage "valleys". When the assumption fails, the trimmed interval
21+
may include positions with sub-threshold coverage (if the valley is
22+
interior) or the entire sequence may be discarded (if a variant base falls
23+
below the threshold).
24+
"""
25+
1326
import numpy as np
1427

1528

0 commit comments

Comments
 (0)