correction of bug and format in obisplit

Former-commit-id: d600713a5f48c8d682971be9b8a09a1c021be28c
This commit is contained in:
Eric Coissac
2024-06-05 17:18:44 +02:00
parent 87a7219ab4
commit 985c91452a
3 changed files with 26 additions and 4 deletions

View File

@ -7,7 +7,7 @@ import (
// TODO: The version number is extracted from git. This induces that the version
// corresponds to the last commit, and not the one when the file will be
// commited
var _Commit = "5affee2"
var _Commit = "0e9a136"
var _Version = "Release 4.2.0"
// Version returns the version of the obitools package.

View File

@ -168,6 +168,11 @@ func SplitPattern(sequence *obiseq.BioSequence,
if from.name == to.name {
sub.SetAttribute("obisplit_group", from.name)
if from.name == "extremity" {
sub.SetAttribute("obisplit_set", "NA")
} else {
sub.SetAttribute("obisplit_set", from.name)
}
} else {
fname := from.name
tname := to.name
@ -179,6 +184,11 @@ func SplitPattern(sequence *obiseq.BioSequence,
}
}
sub.SetAttribute("obisplit_group", fmt.Sprintf("%s-%s", fname, tname))
if fname == "extremity" {
sub.SetAttribute("obisplit_set", tname)
} else {
sub.SetAttribute("obisplit_set", "NA")
}
}
sub.SetAttribute("obisplit_location", fmt.Sprintf("%d..%d", start+1, end))
@ -226,6 +236,12 @@ func SplitPattern(sequence *obiseq.BioSequence,
sub.SetAttribute("obisplit_frg", nfrag)
if from.name == to.name {
sub.SetAttribute("obisplit_group", from.name)
if from.name == "extremity" {
sub.SetAttribute("obisplit_set", "NA")
} else {
sub.SetAttribute("obisplit_set", from.name)
}
} else {
fname := from.name
tname := to.name
@ -236,7 +252,13 @@ func SplitPattern(sequence *obiseq.BioSequence,
fname, tname = tname, fname
}
}
sub.SetAttribute("obisplit_group", fmt.Sprintf("%s-%s", fname, tname))
if fname == "extremity" {
sub.SetAttribute("obisplit_set", tname)
} else {
sub.SetAttribute("obisplit_set", "NA")
}
}
sub.SetAttribute("obisplit_location", fmt.Sprintf("%d..%d", start+1, end))

View File

@ -76,11 +76,11 @@ func CLIConfig() []SplitSequence {
header := records[0]
pattern_idx := slices.Index(header, "T-tag")
pattern_idx := slices.Index(header, "tag")
pool_idx := slices.Index(header, "pcr_pool")
if pattern_idx == -1 {
log.Fatalf("Config file %s doesn't contain `T-tag`column", CLIConfigFile())
log.Fatalf("Config file %s doesn't contain `tag`column", CLIConfigFile())
}
if pool_idx == -1 {
@ -128,7 +128,7 @@ func CLIAskConfigTemplate() bool {
}
func CLIConfigTemplate() string {
return `T-tag,pcr_pool
return `tag,pcr_pool
CGGCACCTGTTACGCAGCCACTATCGGCT,pool_1
CGGCAAGACCCTATTGCATTGGCGCGGCT,pool_2
`