diff --git a/pkg/obitools/obimatrix/obimatrix.go b/pkg/obitools/obimatrix/obimatrix.go index 4b5ee6b..831d5f8 100644 --- a/pkg/obitools/obimatrix/obimatrix.go +++ b/pkg/obitools/obimatrix/obimatrix.go @@ -137,7 +137,9 @@ func CLIWriteCSVToStdout(matrix *MatrixData) { navalue := CLINaValue() csvwriter := csv.NewWriter(os.Stdout) - matrix = matrix.TransposeMatrixData() + if CLITranspose() { + matrix = matrix.TransposeMatrixData() + } samples := obiutils.NewSet[string]() diff --git a/pkg/obitools/obimatrix/options.go b/pkg/obitools/obimatrix/options.go index e91ccb3..da4c766 100644 --- a/pkg/obitools/obimatrix/options.go +++ b/pkg/obitools/obimatrix/options.go @@ -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__ +}