Add the -D (--delta) option to obipcr

Former-commit-id: 753079807faaddb23e03fd6350125bfa67f98c7f
This commit is contained in:
2023-10-13 17:04:10 +02:00
parent 157c26cdc7
commit ddf0f2cede
4 changed files with 74 additions and 8 deletions

View File

@@ -17,6 +17,7 @@ var _AllowedMismatch = 0
var _MinimumLength = 0
var _MaximumLength = -1
var _Fragmented = false
var _Delta = -1
// PCROptionSet defines every options related to a simulated PCR.
//
@@ -54,6 +55,9 @@ func PCROptionSet(options *getoptions.GetOpt) {
options.Alias("L"),
options.Required("You must indicate the maximum size of the amplicon (excluded primer length)"),
options.Description("Maximum length of the barcode (primers excluded)."))
options.IntVar(&_Delta, "delta", -1,
options.Alias("D"),
options.Description("Lenght of the sequence fragment to be added to the barcode extremities."))
}
// OptionSet adds to the basic option set every options declared for
@@ -119,3 +123,11 @@ func CLIMaxLength() int {
func CLIFragmented() bool {
return _Fragmented
}
func CLIWithExtension() bool {
return _Delta >= 0
}
func CLIExtension() int {
return _Delta
}

View File

@@ -30,6 +30,10 @@ func CLIPCR(iterator obiiter.IBioSequence) (obiiter.IBioSequence, error) {
opts = append(opts, obiapat.OptionMinLength(CLIMinLength()))
}
if CLIWithExtension() {
opts = append(opts, obiapat.OptionWithExtension(CLIExtension()))
}
opts = append(opts, obiapat.OptionMaxLength(CLIMaxLength()))
if CLICircular() {