Skip to content

Commit

Permalink
profile: early quick when no target detected
Browse files Browse the repository at this point in the history
  • Loading branch information
shenwei356 committed Sep 2, 2023
1 parent 4b2231a commit a57cc96
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- `kmcp profile`:
- fix log of "xx% (yy/zz) reads matched", the numerator should be the number of matched reads instead of reads belonging to references.
- early quick when no target detected.

### v0.9.3 - 2023-07-16

Expand Down
5 changes: 5 additions & 0 deletions docs/tutorial/profiling/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,14 @@ Mapping and removing mapped reads:

index=~/ws/db/bowtie2/chm13v2.0

# paired-end reads
bowtie2 --threads 32 -x $index -1 in_1.fq.gz -2 in_2.fq.gz \
| samtools fastq -f 4 -o sample.fq.gz -

# unpaired reads
bowtie2 --threads 32 -x $index -U in.fq.gz \
| samtools fastq -f 4 | pigz -c > sample.fq.gz

### Step 3. Searching

**Reads can be searched against multiple databases which can be built with different parameters**,
Expand Down
18 changes: 18 additions & 0 deletions kmcp/cmd/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -1100,6 +1100,12 @@ Examples:

if opt.Verbose || opt.Log2File {
log.Infof(" number of estimated references: %d", len(profile))
}
if len(profile) == 0 {
log.Warningf(" no target found, please adjust parameters")
return
}
if opt.Verbose || opt.Log2File {
if len(profile) >= 1000 && !noAmbCorr {
log.Warningf(" too many candidates detected, the next stage would be very slow")
log.Warningf(" the flag --no-amb-corr is recommended to disable ambiguous reads correction which has very little effect on the results")
Expand Down Expand Up @@ -1887,6 +1893,12 @@ Examples:

if opt.Verbose || opt.Log2File {
log.Infof(" number of estimated references: %d", len(profile2))
}
if len(profile) == 0 {
log.Warningf(" no target found, please adjust parameters")
return
}
if opt.Verbose || opt.Log2File {
log.Infof(" elapsed time: %s", time.Since(timeStart1))
log.Info()
}
Expand Down Expand Up @@ -2559,6 +2571,12 @@ Examples:

if opt.Verbose || opt.Log2File {
log.Infof(" number of estimated references: %d", len(targets))
}
if len(profile) == 0 {
log.Warningf(" no target found, please adjust parameters")
return
}
if opt.Verbose || opt.Log2File {
log.Infof(" elapsed time: %s", time.Since(timeStart1))
log.Info()
if total > 0 {
Expand Down

0 comments on commit a57cc96

Please sign in to comment.