diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a800b1..8ea56e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [unreleased] +### ... + +## [1.4.5] ### Fixed - Fixed issue with new interaction type labeling system. @@ -14,6 +17,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Changed - Separated curve calculation and fraction calculation to different functions. - Harmonized `melt_X.py` scripts output. +- Better fasta reading management: not kept in memory and considering sequences with same header as separate fasta items. ### Added - `plot_melt_curves_coupled.R` for single-oligo coupled melting curve plot. @@ -71,6 +75,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [1.0.0] * [unreleased] https://github.com/ggirelli/oligo-melting +* [1.4.5] https://github.com/ggirelli/oligo-melting/releases/tag/v1.4.5 * [1.4.4] https://github.com/ggirelli/oligo-melting/releases/tag/v1.4.4 * [1.4.3] https://github.com/ggirelli/oligo-melting/releases/tag/v1.4.3 * [1.4.2] https://github.com/ggirelli/oligo-melting/releases/tag/v1.4.2 diff --git a/lib/__pycache__/meltlib.cpython-36.pyc b/lib/__pycache__/meltlib.cpython-36.pyc index 2a20ffd..cc72a01 100644 Binary files a/lib/__pycache__/meltlib.cpython-36.pyc and b/lib/__pycache__/meltlib.cpython-36.pyc differ diff --git a/melt_duplex.py b/melt_duplex.py index 92ebe32..2e75b8a 100755 --- a/melt_duplex.py +++ b/melt_duplex.py @@ -227,28 +227,30 @@ data['seq'] = seq duMelt_calc(**data) else: - # Empty sequence dictionary - fastad = {} + if not is_verbose: + print("oligo_name\tdG\tdH\tdS\tTm\tSeq") # Input file case curr_head = "" + curr_seq = "" with open(seq) as fin: for row in fin: if ">" == row[0]: + if not 0 == len(curr_seq) and not 0 == len(curr_head): + # Calculate before moving to the next item + data['name'] = curr_head + data['seq'] = curr_seq + duMelt_calc(**data) + curr_head = row[1:].strip() + curr_seq = "" else: - if curr_head in fastad.keys(): - fastad[curr_head] = fastad[curr_head] + row.strip() - else: - fastad[curr_head] = row.strip() + curr_seq += row.strip() - # Calculate for each fasta item - if not is_verbose: - print("oligo_name\tdG\tdH\tdS\tTm\tSeq") - for (name, seq) in fastad.items(): - data['name'] = name - data['seq'] = seq - duMelt_calc(**data) + # Calculate for last item + data['name'] = curr_head + data['seq'] = curr_seq + duMelt_calc(**data) # END ==========================================================================