Skip to content

Commit

Permalink
Bump embedded FAMSA to v2.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
althonos committed Sep 19, 2024
1 parent 99f1e9e commit 0bf8fcb
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 58 deletions.
66 changes: 19 additions & 47 deletions patches/sequence.cpp.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
@@ -19,6 +19,18 @@


diff --git a/src/core/sequence.cpp b/src/core/sequence.cpp
index 54401be..83d0f2f 100644
--- a/src/core/sequence.cpp
+++ b/src/core/sequence.cpp
@@ -19,6 +19,18 @@ char CGappedSequence::mapping_table[25] = "ARNDCQEGHILKMFPSTWYVBZX*";


// *******************************************************************
+CSequence::CSequence()
+ :
Expand All @@ -15,12 +19,12 @@
+{}
+
CSequence::CSequence(const string& _id, const string& seq, int sequence_no, memory_monotonic_safe* mma)
:
length(0),
@@ -79,6 +91,39 @@
:
length(0),
@@ -79,6 +91,39 @@ CSequence::CSequence(const string& _id, const string& seq, int sequence_no, memo
}
}

+// *******************************************************************
+CSequence::CSequence(const CSequence& x)
+{
Expand Down Expand Up @@ -55,57 +59,25 @@
+}
+
// *******************************************************************
CSequence::CSequence(CSequence&& x) noexcept
CSequence::CSequence(CSequence&& x) noexcept
:
@@ -105,10 +150,11 @@


@@ -105,10 +150,10 @@ CSequence::CSequence(CSequence&& x) noexcept
// *******************************************************************
-/*
+
CSequence& CSequence::operator=(CSequence&& x) noexcept
{
this->sequence_no = move(x.sequence_no);
+ this->original_no = move(x.original_no);
this->length = move(x.length);
this->id = move(x.id);

@@ -127,7 +173,7 @@

@@ -127,7 +172,6 @@ CSequence& CSequence::operator=(CSequence&& x) noexcept
return *this;
}
-*/
+


// *******************************************************************
CSequence::~CSequence()
@@ -231,6 +277,7 @@
symbols=(symbol_t*)mma->allocate(symbols_size + 1);}
else {
symbols=new symbol_t[symbols_size +1];}
+ *symbols = GUARD;
}
else {
symbols=nullptr;
@@ -255,10 +302,10 @@
char* q = find(mapping_table, mapping_table + 25, c);
if (q == mapping_table + 25) {
extra_symbols.emplace_back(is, c); // save non-standard symbol
- symbols[is] = (symbol_t)UNKNOWN_SYMBOL;
+ symbols[is+1] = (symbol_t)UNKNOWN_SYMBOL;
}
else {
- symbols[is] = (symbol_t)(q - mapping_table);
+ symbols[is+1] = (symbol_t)(q - mapping_table);
}

++is;
@@ -313,7 +360,7 @@
symbols = new symbol_t[symbols_size + 1];


- copy_n(_gapped_sequence.symbols, symbols_size, symbols);
+ copy_n(_gapped_sequence.symbols, symbols_size + 1, symbols);

n_gaps = _gapped_sequence.n_gaps;
dps = _gapped_sequence.dps;
17 changes: 13 additions & 4 deletions patches/sequence.h.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
@@ -35,1 +35,1 @@
diff --git a/src/core/sequence.h b/src/core/sequence.h
index ac37942..e17620e 100644
--- a/src/core/sequence.h
+++ b/src/core/sequence.h
@@ -32,7 +32,7 @@ public:
bit_vec_t *p_bit_masks;
uint32_t p_bv_len;

- const int original_no;
+ int original_no;
@@ -42,15 +42,15 @@
int sequence_no;
string id;

@@ -42,15 +42,15 @@ public:
vector<std::pair<int, char>> extra_symbols;

public:
Expand All @@ -12,8 +22,7 @@
// sequences are not copyable
- CSequence(const CSequence& x) noexcept = delete;
+ CSequence(const CSequence& x);
- CSequence& operator=(const CSequence& x) noexcept = delete;
+ // CSequence& operator=(const CSequence& x) noexcept;
CSequence& operator=(const CSequence& x) noexcept = delete;

CSequence(CSequence&& x) noexcept;
- CSequence& operator=(CSequence&& x) noexcept = delete;
Expand Down
4 changes: 2 additions & 2 deletions pyfamsa/_famsa.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ def famsa_info():
Example:
>>> info = famsa_info()
>>> info.version
'2.2.2'
'2.2.3'
>>> info.date
datetime.date(2022, 10, 9)
datetime.date(2024, 9, 17)
"""
_VersionInfo = collections.namedtuple("_VersionInfo", ["major", "minor", "micro"])
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def _detect_target_system(platform):

# --- Utils ------------------------------------------------------------------

_HEADER_PATTERN = re.compile(r"^@@ -(\d+),?(\d+)? \+(\d+),?(\d+)? @@$")
_HEADER_PATTERN = re.compile(r"^@@ -(\d+),?(\d+)? \+(\d+),?(\d+)? @@")


def _eprint(*args, **kwargs):
Expand Down Expand Up @@ -102,7 +102,7 @@ def _apply_patch(s,patch,revert=False):
i = 0
sl = 0
midx, sign = (1,'+') if not revert else (3,'-')
while i < len(p) and p[i].startswith(("---","+++")):
while i < len(p) and not p[i].startswith("@@"):
i += 1 # skip header lines

while i < len(p):
Expand Down Expand Up @@ -781,7 +781,7 @@ def run(self):
os.path.join(SETUP_FOLDER, "vendor", "FAMSA", "src", "core", "profile_seq.cpp"),
os.path.join(SETUP_FOLDER, "vendor", "FAMSA", "src", "core", "sequence.cpp"),
os.path.join(SETUP_FOLDER, "vendor", "FAMSA", "src", "core", "queues.cpp"),
os.path.join(SETUP_FOLDER, "vendor", "FAMSA", "libs", "mimalloc", "static.cpp"),
os.path.join(SETUP_FOLDER, "vendor", "FAMSA", "libs", "mimalloc", "src", "static.c"),
# LCS_OBJS
os.path.join(SETUP_FOLDER, "vendor", "FAMSA", "src", "lcs", "lcsbp.cpp"),
os.path.join(SETUP_FOLDER, "vendor", "FAMSA", "src", "lcs", "lcsbp_classic.cpp"),
Expand All @@ -792,7 +792,7 @@ def run(self):
os.path.join(SETUP_FOLDER, "vendor", "FAMSA", "src", "tree"),
os.path.join(SETUP_FOLDER, "vendor", "FAMSA", "src", "utils"),
os.path.join(SETUP_FOLDER, "vendor", "FAMSA", "src"),
os.path.join(SETUP_FOLDER, "vendor", "FAMSA", "libs", "mimalloc"),
os.path.join(SETUP_FOLDER, "vendor", "FAMSA", "libs", "mimalloc", "include"),
os.path.join(SETUP_FOLDER, "vendor", "FAMSA", "libs"),
os.path.join(SETUP_FOLDER, "include"),
],
Expand Down
2 changes: 1 addition & 1 deletion vendor/FAMSA
Submodule FAMSA updated 110 files

0 comments on commit 0bf8fcb

Please sign in to comment.