Adds a --transpose option to obimatrix

Former-commit-id: b2ee47c15441dca971b20f583003a3788a96da23
This commit is contained in:
2023-11-22 07:05:22 +01:00
parent 9384876416
commit ff51cc7393
2 changed files with 11 additions and 1 deletions

View File

@ -137,7 +137,9 @@ func CLIWriteCSVToStdout(matrix *MatrixData) {
navalue := CLINaValue()
csvwriter := csv.NewWriter(os.Stdout)
if CLITranspose() {
matrix = matrix.TransposeMatrixData()
}
samples := obiutils.NewSet[string]()

View File

@ -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__
}