Skip to content

Commit 70c258a

Browse files
committed
readme updated
1 parent 122b70e commit 70c258a

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ Downloaded files are stored in `OUTDIR/DB_NAME` directory, which can be provided
143143
---
144144

145145
## Classification
146-
> [!NOTE] We commend running software like `fastp` or `fastplong` to remove adapters and low-quality reads before classification.
146+
> [!NOTE]
147+
> We commend running software like `fastp` or `fastplong` to remove adapters and low-quality reads before classification.
147148
```
148149
metabuli classify <i:FASTA/Q> <i:DBDIR> <o:OUTDIR> <Job ID> [options]
149150
- INPUT : FASTA/Q file of reads you want to classify. (gzip supported)
@@ -243,13 +244,15 @@ metabuli classifiedRefiner <i:read-by-read classification> <i:DBDIR> [options]
243244
244245
* Options
245246
--threads : The number of threads to utilize (all by default)
247+
--min-score : Remove classifications with score below this value
246248
--remove-unclassified : Remove unclassified reads
247-
--exclude-taxid : Remove list of taxids as well as its children (e.g., 1758,9685,1234)
248-
--select-taxid : Select list of taxids as well as its children (e.g., 1758,9685,1234)
249+
--exclude-taxid : Remove list of taxids as well as its children (e.g., 1758,9685)
250+
--select-taxid : Select list of taxids as well as its children (e.g., 1758,9685)
249251
--select-columns : Select list of columns with number and handle full lineage as 7 (generated if absent) (e.g., 2,5,7,3)
250-
--report : Write report of refined classification file
252+
--report : Write report of refined classification results
251253
--rank : Adjust classification to the specified rank
252-
--rank-file-type : Choose how to handle reads assigned to higher taxonomic ranks when using the --rank option. [0: exclude higher rank, 1: include higher rank, 2: make separate file for higher rank classification]
254+
--rank-file-type : Choose how to handle classifications at higher ranks when using --rank option.
255+
[0: exclude them, 1: include them, 2: make separate file for them]
253256
254257
```
255258
#### Output

src/commons/LocalParameters.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,7 @@ LocalParameters::LocalParameters() :
633633
classifiedRefiner.push_back(&RANK);
634634
classifiedRefiner.push_back(&HIGHER_RANK_FILE);
635635
classifiedRefiner.push_back(&PARAM_THREADS);
636+
classifiedRefiner.push_back(&MIN_SCORE);
636637

637638

638639
}

src/util/classifiedRefiner.cpp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,20 @@ ClassificationResult parseFields(const std::vector<std::string>& fields) {
4848
return result;
4949
}
5050

51+
void classifiedRefinerDefault(LocalParameters & par){
52+
par.removeUnclassified = false;
53+
par.excludeTaxid = "";
54+
par.selectTaxid = "";
55+
par.selectColumns = "";
56+
par.report = false;
57+
par.rank = "";
58+
par.higherRankFile = 0;
59+
par.minScore = 0.0;
60+
}
61+
5162
int classifiedRefiner(int argc, const char **argv, const Command &command) {
5263
LocalParameters &par = LocalParameters::getLocalInstance();
64+
classifiedRefinerDefault(par);
5365
par.parseParameters(argc, argv, command, true, Parameters::PARSE_ALLOW_EMPTY, 0);
5466
const string &classifiedFile = par.filenames[0];
5567
const string &taxonomyDir = par.filenames[1];
@@ -72,7 +84,7 @@ int classifiedRefiner(int argc, const char **argv, const Command &command) {
7284

7385
int classifiedRefiner(const string &classifiedFile, const string&taxonomyDir, const LocalParameters &par) {
7486
#ifdef OPENMP
75-
omp_set_num_threads(par.threads);
87+
omp_set_num_threads(par.threads);
7688
#endif
7789

7890
const string & nodesFile = taxonomyDir + "/nodes.dmp";
@@ -303,7 +315,8 @@ int classifiedRefiner(const string &classifiedFile, const string&taxonomyDir, co
303315
// remove unclassified
304316
if (!(par.removeUnclassified == true && data.isClassified == false) &&
305317
!(contamsTaxIds.size() > 0 && checktaxId(taxonomy, contamsTaxIds, data.taxonomyId)) &&
306-
!(targetsTaxIds.size() > 0 && !checktaxId(taxonomy, targetsTaxIds, data.taxonomyId))) {
318+
!(targetsTaxIds.size() > 0 && !checktaxId(taxonomy, targetsTaxIds, data.taxonomyId)) &&
319+
!(data.isClassified == true && par.minScore > data.dnaIdentityScore)) {
307320

308321
stringstream ss;
309322
stringstream tt;

0 commit comments

Comments
 (0)