Skip to content

Commit b6af8db

Browse files
committed
get AA sequence from DB instead of MSA file
1 parent 99e71ac commit b6af8db

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/strucclustutils/msa2lddt.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,14 +339,17 @@ void parseFasta(
339339
seq3Di.pop_back();
340340
lengths.push_back(seqAA.length());
341341

342-
std::vector<Instruction2> cigar_aa = contract(entry.sequence.s);
342+
std::vector<Instruction2> base = contract(entry.sequence.s);
343+
std::vector<Instruction2> cigar_aa;
343344
std::vector<Instruction2> cigar_ss;
344345
int index = 0;
345-
for (Instruction2 ins : cigar_aa) {
346+
for (Instruction2 ins : base) {
346347
if (ins.isSeq()) {
348+
cigar_aa.emplace_back(seqAA[index]);
347349
cigar_ss.emplace_back(seq3Di[index]);
348350
index++;
349351
} else {
352+
cigar_aa.emplace_back(static_cast<int>(ins.bits.count));
350353
cigar_ss.emplace_back(static_cast<int>(ins.bits.count));
351354
}
352355
}
@@ -417,6 +420,8 @@ int msa2lddt(int argc, const char **argv, const Command& command) {
417420

418421
std::tie(perColumnScore, perColumnCount, lddtScore) = calculate_lddt(cigars_aa, subset, indices, lengths, &seqDbrCA, par.pairThreshold);
419422

423+
// TODO common core = columns w/ no gaps, no distances >4 angstrom to reference (structure w/ longest non-gap alignment)
424+
420425
std::cout << "Average MSA LDDT: " << lddtScore << std::endl;
421426

422427
// Write clustal format MSA HTML
@@ -425,7 +430,8 @@ int msa2lddt(int argc, const char **argv, const Command& command) {
425430
std::string lddtHtmlIdx = par.lddtHtml + ".index";
426431
DBWriter resultWriter(par.lddtHtml.c_str(), lddtHtmlIdx.c_str(), static_cast<unsigned int>(par.threads), par.compressed, Parameters::DBTYPE_OMIT_FILE);
427432
resultWriter.open();
428-
/*
433+
434+
/*
429435
// Read in template and write to .html
430436
size_t dstSize = ZSTD_findDecompressedSize(msa_html_zst, msa_html_zst_len);
431437
char* dst = (char*)malloc(sizeof(char) * dstSize);

0 commit comments

Comments
 (0)