mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
some cleanning on the new tools
Former-commit-id: f265a3910d2872c56af81c9b873669f2cb627781
This commit is contained in:
@ -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 = "a365bb6"
|
||||
var _Commit = "8a1ed26"
|
||||
var _Version = "Release 4.2.0"
|
||||
|
||||
// Version returns the version of the obitools package.
|
||||
|
@ -26,8 +26,8 @@ func MakeSequenceFamilyGenusWorker(references obiseq.BioSequenceSlice) obiseq.Se
|
||||
family := make(map[int]*obiseq.BioSequenceSlice)
|
||||
|
||||
for _, ref := range references {
|
||||
g, ok := ref.GetIntAttribute("genus_taxid")
|
||||
f, ok := ref.GetIntAttribute("family_taxid")
|
||||
g, _ := ref.GetIntAttribute("genus_taxid")
|
||||
f, _ := ref.GetIntAttribute("family_taxid")
|
||||
|
||||
gs, ok := genus[g]
|
||||
if !ok {
|
||||
@ -47,6 +47,9 @@ func MakeSequenceFamilyGenusWorker(references obiseq.BioSequenceSlice) obiseq.Se
|
||||
}
|
||||
|
||||
f := func(sequence *obiseq.BioSequence) (obiseq.BioSequenceSlice, error) {
|
||||
sequence.SetAttribute("obicleandb_level", "none")
|
||||
pval := 0.0
|
||||
|
||||
g, _ := sequence.GetIntAttribute("genus_taxid")
|
||||
sequence.SetAttribute("obicleandb_level", "genus")
|
||||
|
||||
@ -61,8 +64,6 @@ func MakeSequenceFamilyGenusWorker(references obiseq.BioSequenceSlice) obiseq.Se
|
||||
}
|
||||
nindist := len(indist)
|
||||
|
||||
pval := 0.0
|
||||
|
||||
f, _ := sequence.GetIntAttribute("family_taxid")
|
||||
fs := family[f]
|
||||
|
||||
@ -87,7 +88,7 @@ func MakeSequenceFamilyGenusWorker(references obiseq.BioSequenceSlice) obiseq.Se
|
||||
next = 20
|
||||
}
|
||||
|
||||
outdist := make([]float64, 0, nindist)
|
||||
outdist := make([]float64, 0, next)
|
||||
p := rand.Perm(references.Len())
|
||||
i := 0
|
||||
for _, ir := range p {
|
||||
@ -110,13 +111,15 @@ func MakeSequenceFamilyGenusWorker(references obiseq.BioSequenceSlice) obiseq.Se
|
||||
pval = res.P
|
||||
}
|
||||
|
||||
level, _ := sequence.GetAttribute("obicleandb_level")
|
||||
log.Warnf("%s - level: %v", sequence.Id(), level)
|
||||
log.Warnf("%s - gdist: %v", sequence.Id(), indist)
|
||||
log.Warnf("%s - fdist: %v", sequence.Id(), outdist)
|
||||
log.Warnf("%s - pval: %f", sequence.Id(), pval)
|
||||
} else {
|
||||
sequence.SetAttribute("obicleandb_level", "none")
|
||||
// level, _ := sequence.GetAttribute("obicleandb_level")
|
||||
// log.Warnf("%s - level: %v", sequence.Id(), level)
|
||||
// log.Warnf("%s - gdist: %v", sequence.Id(), indist)
|
||||
// log.Warnf("%s - fdist: %v", sequence.Id(), outdist)
|
||||
// log.Warnf("%s - pval: %f", sequence.Id(), pval)
|
||||
}
|
||||
|
||||
if pval < 0.0 {
|
||||
pval = 0.0
|
||||
}
|
||||
|
||||
sequence.SetAttribute("obicleandb_trusted", pval)
|
||||
@ -265,10 +268,11 @@ func ICleanDB(itertator obiiter.IBioSequence) obiiter.IBioSequence {
|
||||
).MakeIWorker(taxonomy.MakeSetFamilyWorker(),
|
||||
false,
|
||||
obioptions.CLIParallelWorkers(),
|
||||
).MakeIWorker(SequenceTrust,
|
||||
false,
|
||||
obioptions.CLIParallelWorkers(),
|
||||
)
|
||||
// .MakeIWorker(SequenceTrust,
|
||||
// false,
|
||||
// obioptions.CLIParallelWorkers(),
|
||||
// )
|
||||
|
||||
references := annotated.Load()
|
||||
|
||||
|
Reference in New Issue
Block a user