mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
Adds a --transpose option to obimatrix
Former-commit-id: b2ee47c15441dca971b20f583003a3788a96da23
This commit is contained in:
@ -137,7 +137,9 @@ func CLIWriteCSVToStdout(matrix *MatrixData) {
|
||||
navalue := CLINaValue()
|
||||
csvwriter := csv.NewWriter(os.Stdout)
|
||||
|
||||
if CLITranspose() {
|
||||
matrix = matrix.TransposeMatrixData()
|
||||
}
|
||||
|
||||
samples := obiutils.NewSet[string]()
|
||||
|
||||
|
@ -10,6 +10,7 @@ import (
|
||||
)
|
||||
|
||||
var __threeColumns__ = false
|
||||
var __transpose__ = true
|
||||
var __mapAttribute__ = "merged_sample"
|
||||
var __valueName__ = "count"
|
||||
var __sampleName__ = "sample"
|
||||
@ -19,6 +20,9 @@ func MatrixOptionSet(options *getoptions.GetOpt) {
|
||||
options.BoolVar(&__threeColumns__, "three-columns", false,
|
||||
options.Description("Printouts the matrix in tree column format."))
|
||||
|
||||
options.BoolVar(&__transpose__, "transpose", __transpose__,
|
||||
options.Description("Printouts the transposed matrix."))
|
||||
|
||||
options.StringVar(&__mapAttribute__, "map", __mapAttribute__,
|
||||
options.Description("Which attribute is usd to produce th matrix."))
|
||||
|
||||
@ -60,3 +64,7 @@ func CLINaValue() string {
|
||||
func CLIMapAttribute() string {
|
||||
return __mapAttribute__
|
||||
}
|
||||
|
||||
func CLITranspose() bool {
|
||||
return __transpose__
|
||||
}
|
||||
|
Reference in New Issue
Block a user