Skip to content

Commit

Permalink
Add parameter for taxonomy report in easy-search (#389)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaebeom-kim authored Dec 2, 2024
1 parent 3cad136 commit 3310337
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions data/easystructuresearch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ if notExists "${TMP_PATH}/alis.dbtype"; then
|| fail "Convert Alignments died"
fi

if [ -n "${TAXONOMY}" ]; then
# shellcheck disable=SC2086
"$MMSEQS" taxonomyreport "${TARGET}${INDEXEXT}" "${INTERMEDIATE}" "${RESULTS}_report" ${TAXONOMYREPORT_PAR} \
|| fail "taxonomyreport died"
fi

if [ -n "${REMOVE_TMP}" ]; then
if [ -n "${GREEDY_BEST_HITS}" ]; then
# shellcheck disable=SC2086
Expand Down
1 change: 1 addition & 0 deletions src/commons/LocalParameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ LocalParameters::LocalParameters() :

easystructuresearchworkflow = combineList(structuresearchworkflow, structurecreatedb);
easystructuresearchworkflow = combineList(easystructuresearchworkflow, convertalignments);
easystructuresearchworkflow = combineList(easystructuresearchworkflow, taxonomyreport);
easystructuresearchworkflow.push_back(&PARAM_GREEDY_BEST_HITS);

structureclusterworkflow = combineList(prefilter, structurealign);
Expand Down
10 changes: 10 additions & 0 deletions src/workflow/EasyStructureSearch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ void setEasyStructureSearchDefaults(Parameters *p) {
p->gapExtend = 1;
p->alignmentMode = Parameters::ALIGNMENT_MODE_SCORE_COV_SEQID;
p->removeTmpFiles = true;
p->reportMode = 2;
}
void setEasyStructureSearchMustPassAlong(Parameters *p) {
p->PARAM_K.wasSet = true;
Expand Down Expand Up @@ -50,6 +51,8 @@ int easystructuresearch(int argc, const char **argv, const Command &command) {
par.PARAM_THREADS.removeCategory(MMseqsParameter::COMMAND_EXPERT);
par.PARAM_V.removeCategory(MMseqsParameter::COMMAND_EXPERT);

par.overrideParameterDescription(par.PARAM_REPORT_MODE, "Taxonomy report mode 0: Kraken 1: Krona 2: Skip taxonomy report", "^[0-2]{1}$", 0);

setEasyStructureSearchDefaults(&par);
par.parseParameters(argc, argv, command, true, Parameters::PARSE_VARIADIC, 0);
setEasyStructureSearchMustPassAlong(&par);
Expand All @@ -69,6 +72,10 @@ int easystructuresearch(int argc, const char **argv, const Command &command) {
bool needLDDT = false;
LocalParameters::getOutputFormat(par.formatAlignmentMode, par.outfmt, needSequenceDB, needBacktrace, needFullHeaders,
needLookup, needSource, needTaxonomyMapping, needTaxonomy, needQCA, needTCA, needTMalign, needLDDT);
if (par.reportMode != 2) {
needTaxonomy = true;
needTaxonomyMapping = true;
}
}

if (par.formatAlignmentMode == Parameters::FORMAT_ALIGNMENT_SAM ||
Expand Down Expand Up @@ -129,6 +136,9 @@ int easystructuresearch(int argc, const char **argv, const Command &command) {
cmd.addVariable("CONVERT_PAR", par.createParameterString(par.convertalignments).c_str());
cmd.addVariable("SUMMARIZE_PAR", par.createParameterString(par.summarizeresult).c_str());

cmd.addVariable("TAXONOMY", needTaxonomy && needTaxonomyMapping && par.reportMode != 2 ? "TRUE" : NULL);
cmd.addVariable("TAXONOMYREPORT_PAR", par.createParameterString(par.taxonomyreport).c_str());

std::string program = tmpDir + "/easystructuresearch.sh";
FileUtil::writeFile(program, easystructuresearch_sh, easystructuresearch_sh_len);
cmd.execProgram(program.c_str(), par.filenames);
Expand Down

0 comments on commit 3310337

Please sign in to comment.