Skip to content

Commit

Permalink
Merge pull request #330 from stromjm/interface_v2.0
Browse files Browse the repository at this point in the history
Addition of createdb "--db-extraction-mode" (chain or interface)
  • Loading branch information
sooyoung-cha authored Oct 22, 2024
2 parents e1f38a1 + 4e514a2 commit d2d09b5
Show file tree
Hide file tree
Showing 6 changed files with 385 additions and 84 deletions.
7 changes: 7 additions & 0 deletions lib/mmseqs/src/commons/MathUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,13 @@ class MathUtil {
return sum;
}

static float squareDist(const float xx, const float xy, const float xz,
const float yx, const float yy, const float yz){
float d1 = xx - yx;
float d2 = xy - yy;
float d3 = xz - yz;
return (d1 * d1 + d2 * d2 + d3 * d3);
}

};

Expand Down
6 changes: 6 additions & 0 deletions src/commons/LocalParameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ LocalParameters::LocalParameters() :
PARAM_PDB_OUTPUT_MODE(PARAM_PDB_OUTPUT_MODE_ID, "--pdb-output-mode", "PDB output mode", "PDB output mode:\n0: Single multi-model PDB file\n1: One PDB file per chain\n2: One PDB file per complex", typeid(int), (void *) &pdbOutputMode, "^[0-2]{1}$", MMseqsParameter::COMMAND_MISC),
PARAM_PROSTT5_MODEL(PARAM_PROSTT5_MODEL_ID, "--prostt5-model", "Path to ProstT5", "Path to ProstT5 model", typeid(std::string), (void *) &prostt5Model, "^.*$", MMseqsParameter::COMMAND_COMMON),
PARAM_GPU(PARAM_GPU_ID, "--gpu", "Use GPU", "Use GPU (CUDA) if possible", typeid(int), (void *) &gpu, "^[0-1]{1}$", MMseqsParameter::COMMAND_COMMON),
PARAM_DB_EXTRACTION_MODE(PARAM_DB_EXTRACTION_MODE_ID, "--db-extraction-mode", "Createdb extraction mode", "createdb extraction mode: 0: chain 1: interface", typeid(int), (void *) &dbExtractionMode, "^[0-1]{1}$"),
PARAM_DISTANCE_THRESHOLD(PARAM_DISTANCE_THRESHOLD_ID, "--distance-threshold", "Interface distance threshold", "Residues with C-beta below this threshold will be part of interface", typeid(float), (void *) &distanceThreshold, "^[0-9]*(\\.[0-9]+)?$"),
PARAM_MULTIMER_TM_THRESHOLD(PARAM_MULTIMER_TM_THRESHOLD_ID,"--multimer-tm-threshold", "TMscore threshold for filtermultimer", "accept alignments with a tmsore > thr [0.0,1.0]",typeid(float), (void *) &filtMultimerTmThr, "^0(\\.[0-9]+)?|1(\\.0+)?$"),
PARAM_CHAIN_TM_THRESHOLD(PARAM_CHAIN_TM_THRESHOLD_ID,"--chain-tm-threshold", "chain TMscore threshold for filtermultimer", "accept alignments with a tmsore > thr [0.0,1.0]",typeid(float), (void *) &filtChainTmThr, "^0(\\.[0-9]+)?|1(\\.0+)?$"),
PARAM_INTERFACE_LDDT_THRESHOLD(PARAM_INTERFACE_LDDT_THRESHOLD_ID,"--interface-lddt-threshold", "Interface LDDT threshold", "accept alignments with a lddt > thr [0.0,1.0]",typeid(float), (void *) &filtInterfaceLddtThr, "^0(\\.[0-9]+)?|1(\\.0+)?$")
Expand Down Expand Up @@ -88,6 +90,8 @@ LocalParameters::LocalParameters() :
#endif
structurecreatedb.push_back(&PARAM_PROSTT5_MODEL);
structurecreatedb.push_back(&PARAM_CHAIN_NAME_MODE);
structurecreatedb.push_back(&PARAM_DB_EXTRACTION_MODE);
structurecreatedb.push_back(&PARAM_DISTANCE_THRESHOLD);
structurecreatedb.push_back(&PARAM_WRITE_MAPPING);
structurecreatedb.push_back(&PARAM_MASK_BFACTOR_THRESHOLD);
structurecreatedb.push_back(&PARAM_COORD_STORE_MODE);
Expand Down Expand Up @@ -272,6 +276,8 @@ LocalParameters::LocalParameters() :
eValueThrExpandMultimer = 10000.0;
prostt5Model = "";
gpu = 0;
dbExtractionMode = DB_EXTRACT_MODE_CHAIN;
distanceThreshold = 8.0;
filtMultimerTmThr = 0.0;
filtChainTmThr = 0.0;
filtInterfaceLddtThr = 0.0;
Expand Down
7 changes: 7 additions & 0 deletions src/commons/LocalParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ class LocalParameters : public Parameters {
static const int OUTFMT_COMPLEX_U = 56;
static const int OUTFMT_COMPLEX_T = 57;

static const int DB_EXTRACT_MODE_CHAIN = 0;
static const int DB_EXTRACT_MODE_INTERFACE = 1;

static const int COORD_STORE_MODE_CA_FLOAT = 1;
static const int COORD_STORE_MODE_CA_DIFF = 2;
static const int COORD_STORE_MODE_CA_PLAIN_TEXT = 3;
Expand Down Expand Up @@ -143,6 +146,8 @@ class LocalParameters : public Parameters {
PARAMETER(PARAM_PDB_OUTPUT_MODE)
PARAMETER(PARAM_PROSTT5_MODEL)
PARAMETER(PARAM_GPU)
PARAMETER(PARAM_DB_EXTRACTION_MODE)
PARAMETER(PARAM_DISTANCE_THRESHOLD)
PARAMETER(PARAM_MULTIMER_TM_THRESHOLD)
PARAMETER(PARAM_CHAIN_TM_THRESHOLD)
PARAMETER(PARAM_INTERFACE_LDDT_THRESHOLD)
Expand Down Expand Up @@ -176,6 +181,8 @@ class LocalParameters : public Parameters {
float filtInterfaceLddtThr;
std::string prostt5Model;
int gpu;
int dbExtractionMode;
float distanceThreshold;

static std::vector<int> getOutputFormat(int formatMode, const std::string &outformat, bool &needSequences, bool &needBacktrace, bool &needFullHeaders,
bool &needLookup, bool &needSource, bool &needTaxonomyMapping, bool &needTaxonomy, bool &needQCa, bool &needTCa, bool &needTMaligner,
Expand Down
3 changes: 2 additions & 1 deletion src/strucclustutils/GemmiWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ bool GemmiWrapper::loadFoldcompStructure(std::istream& stream, const std::string
if (coordinates.size() == 0) {
return false;
}

seq3di.clear();
taxIds.clear();
title.clear();
chain.clear();
names.clear();
Expand Down
1 change: 1 addition & 0 deletions src/strucclustutils/GemmiWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class GemmiWrapper {
std::vector<Vec3> c;
std::vector<Vec3> cb;
std::vector<char> ami;
std::vector<char> seq3di;
std::vector<std::string> names;
std::vector<std::string> chainNames;
std::vector<unsigned int> modelIndices;
Expand Down
Loading

0 comments on commit d2d09b5

Please sign in to comment.