Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions seqkit/cmd/seq.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,19 +269,23 @@ var seqCmd = &cobra.Command{
}

if filterMinLen && len(record.Seq.Seq) < minLen {
log.Info("sequence '%s' too short (%d < %d)", record.Seq.Id, len(record.Seq.Seq), minLen)
continue
}

if filterMaxLen && len(record.Seq.Seq) > maxLen {
log.Info("sequence '%s' too long (%d > %d)", record.Seq.Id, len(record.Seq.Seq), maxLen)
continue
}

if filterMinQual || filterMaxQual {
avgQual := record.Seq.AvgQual(qBase)
if filterMinQual && avgQual < minQual {
log.Info("average quality of sequence '%s' too low (%d < %d)", record.Seq.Id, avgQual, minQual)
continue
}
if filterMaxQual && avgQual >= maxQual {
log.Info("average quality of sequence '%s' too high (%d > %d)", record.Seq.Id, avgQual, maxQual)
continue
}
}
Expand Down