Make obiconsensus using the count of the sequences

Former-commit-id: 7fc5292aeb225843a86cd85591a5405e35125e3d
This commit is contained in:
Eric Coissac
2024-04-03 12:58:32 +02:00
parent d68210ef94
commit 3d1d9f32df
3 changed files with 19 additions and 8 deletions

View File

@@ -99,9 +99,19 @@ func BuildConsensus(seqs obiseq.BioSequenceSlice,
}
}
seq, err := graph.LongestConsensus(seqs[0].Source())
id := seqs[0].Source()
if id == "" {
id = seqs[0].Id()
}
seq, err := graph.LongestConsensus(id)
seq.SetCount(len(seqs))
sumCount := 0
for _, s := range seqs {
sumCount += s.Count()
}
seq.SetCount(sumCount)
seq.SetAttribute("seq_length", seq.Len())
seq.SetAttribute("kmer_size", kmer_size)
seq.SetAttribute("kmer_min_occur", threshold)