normalize

package
v0.0.0-...-821f69b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2026 License: BSD-2-Clause Imports: 31 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package normalize converts create workbooks for phenotype annotation into reviewable CSV files. It does not call a stock or an annotation service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakesheetRequestLenses

func MakesheetRequestLenses() sheetRequestLenses

MakesheetRequestLenses creates a new [sheetRequestLenses] with [lenses] for all fields

[lenses]:__lens.Lens

func MakesheetRequestPrisms

func MakesheetRequestPrisms() sheetRequestPrisms

MakesheetRequestPrisms creates a new [sheetRequestPrisms] with [prisms] for all fields

[prisms]:__prism.Prism

func MakesheetRequestRefLenses

func MakesheetRequestRefLenses() sheetRequestRefLenses

MakesheetRequestRefLenses creates a new [sheetRequestRefLenses] with [lenses] for all fields

[lenses]:__lens.Lens

func MakesheetRequestRefPrisms

func MakesheetRequestRefPrisms() sheetRequestRefPrisms

MakesheetRequestRefPrisms creates a new [sheetRequestRefPrisms] with [prisms] for all fields

[prisms]:__prism.Prism

func PrintSummary

func PrintSummary(s State) IO.IO[State]

PrintSummary prints one summary line and returns the state.

func Publish

func Publish(s State) IOE.IOEither[error, State]

Publish checks the context, creates the destination folder when it is missing, and writes phenotype.csv and new-strain.csv into it.

func ReadFiles

func ReadFiles(s State) IOE.IOEither[error, Batch]

ReadFiles reads the selected workbooks one at a time, in order, and joins their batches.

func SelectFiles

func SelectFiles(s State) IOE.IOEither[error, []string]

SelectFiles returns the paths of the create workbooks in the folder. The paths are sorted by name. The folder is joined with the file name to form the path. It returns an error if the folder does not exist or is not a directory, or if there are no create workbooks in the folder.

func Valid

func Valid(s State) E.Either[error, State]

Valid checks the options before any file access. A folder or an output path of only spaces is not a path.

Types

type Batch

type Batch struct {
	Existing []Record
	New      []Record
}

Batch holds every accepted row of one run, split into existing-strain and new-strain records. fp-go:Lens

type BatchLenses

type BatchLenses struct {
	// mandatory fields
	Existing __lens.Lens[Batch, []Record]
	New      __lens.Lens[Batch, []Record]
}

BatchLenses provides [lenses] for accessing fields of Batch

[lenses]: __lens.Lens

func MakeBatchLenses

func MakeBatchLenses() BatchLenses

MakeBatchLenses creates a new BatchLenses with [lenses] for all fields

[lenses]:__lens.Lens

type BatchPrisms

type BatchPrisms struct {
	Existing __prism.Prism[Batch, []Record]
	New      __prism.Prism[Batch, []Record]
}

BatchPrisms provides [prisms] for accessing fields of Batch

[prisms]: __prism.Prism

func MakeBatchPrisms

func MakeBatchPrisms() BatchPrisms

MakeBatchPrisms creates a new BatchPrisms with [prisms] for all fields

[prisms]:__prism.Prism

type BatchRefLenses

type BatchRefLenses struct {
	// mandatory fields
	Existing __lens.Lens[*Batch, []Record]
	New      __lens.Lens[*Batch, []Record]
}

BatchRefLenses provides [lenses] for accessing fields of Batch via a reference to Batch

[lenses]: __lens.Lens

func MakeBatchRefLenses

func MakeBatchRefLenses() BatchRefLenses

MakeBatchRefLenses creates a new BatchRefLenses with [lenses] for all fields

[lenses]:__lens.Lens

type BatchRefPrisms

type BatchRefPrisms struct {
	Existing __prism.Prism[*Batch, []Record]
	New      __prism.Prism[*Batch, []Record]
}

BatchRefPrisms provides [prisms] for accessing fields of Batch via a reference to Batch

[prisms]: __prism.Prism

func MakeBatchRefPrisms

func MakeBatchRefPrisms() BatchRefPrisms

MakeBatchRefPrisms creates a new BatchRefPrisms with [prisms] for all fields

[prisms]:__prism.Prism

type Layout

type Layout int

Layout identifies one of the two accepted worksheet headers.

const (
	LayoutUnknown Layout = iota
	LayoutShort
	LayoutExtended
)

The accepted layouts. LayoutUnknown marks a header that is not accepted.

type Options

type Options struct {
	Folder string
	Sheet  string
	Out    string
}

Options holds the command options of one run. fp-go:Lens

type OptionsLenses

type OptionsLenses struct {
	// mandatory fields
	Folder __lens.Lens[Options, string]
	Sheet  __lens.Lens[Options, string]
	Out    __lens.Lens[Options, string]
	// optional fields
	FolderO __lens_option.LensO[Options, string]
	SheetO  __lens_option.LensO[Options, string]
	OutO    __lens_option.LensO[Options, string]
}

OptionsLenses provides [lenses] for accessing fields of Options

[lenses]: __lens.Lens

func MakeOptionsLenses

func MakeOptionsLenses() OptionsLenses

MakeOptionsLenses creates a new OptionsLenses with [lenses] for all fields

[lenses]:__lens.Lens

type OptionsPrisms

type OptionsPrisms struct {
	Folder __prism.Prism[Options, string]
	Sheet  __prism.Prism[Options, string]
	Out    __prism.Prism[Options, string]
}

OptionsPrisms provides [prisms] for accessing fields of Options

[prisms]: __prism.Prism

func MakeOptionsPrisms

func MakeOptionsPrisms() OptionsPrisms

MakeOptionsPrisms creates a new OptionsPrisms with [prisms] for all fields

[prisms]:__prism.Prism

type OptionsRefLenses

type OptionsRefLenses struct {
	// mandatory fields
	Folder __lens.Lens[*Options, string]
	Sheet  __lens.Lens[*Options, string]
	Out    __lens.Lens[*Options, string]
	// optional fields
	FolderO __lens_option.LensO[*Options, string]
	SheetO  __lens_option.LensO[*Options, string]
	OutO    __lens_option.LensO[*Options, string]
}

OptionsRefLenses provides [lenses] for accessing fields of Options via a reference to Options

[lenses]: __lens.Lens

func MakeOptionsRefLenses

func MakeOptionsRefLenses() OptionsRefLenses

MakeOptionsRefLenses creates a new OptionsRefLenses with [lenses] for all fields

[lenses]:__lens.Lens

type OptionsRefPrisms

type OptionsRefPrisms struct {
	Folder __prism.Prism[*Options, string]
	Sheet  __prism.Prism[*Options, string]
	Out    __prism.Prism[*Options, string]
}

OptionsRefPrisms provides [prisms] for accessing fields of Options via a reference to Options

[prisms]: __prism.Prism

func MakeOptionsRefPrisms

func MakeOptionsRefPrisms() OptionsRefPrisms

MakeOptionsRefPrisms creates a new OptionsRefPrisms with [prisms] for all fields

[prisms]:__prism.Prism

type Record

type Record struct {
	StrainID   string
	Descriptor string
	PhenoID    string
	AssayID    string
	EnvID      string
	Note       string
	PMID       string
	Deleted    string
	AssignedBy string
}

Record is one normalized row. Deleted is checked during filtering and omitted from the accepted CSV output. fp-go:Lens

type RecordLenses

type RecordLenses struct {
	// mandatory fields
	StrainID   __lens.Lens[Record, string]
	Descriptor __lens.Lens[Record, string]
	PhenoID    __lens.Lens[Record, string]
	AssayID    __lens.Lens[Record, string]
	EnvID      __lens.Lens[Record, string]
	Note       __lens.Lens[Record, string]
	PMID       __lens.Lens[Record, string]
	Deleted    __lens.Lens[Record, string]
	AssignedBy __lens.Lens[Record, string]
	// optional fields
	StrainIDO   __lens_option.LensO[Record, string]
	DescriptorO __lens_option.LensO[Record, string]
	PhenoIDO    __lens_option.LensO[Record, string]
	AssayIDO    __lens_option.LensO[Record, string]
	EnvIDO      __lens_option.LensO[Record, string]
	NoteO       __lens_option.LensO[Record, string]
	PMIDO       __lens_option.LensO[Record, string]
	DeletedO    __lens_option.LensO[Record, string]
	AssignedByO __lens_option.LensO[Record, string]
}

RecordLenses provides [lenses] for accessing fields of Record

[lenses]: __lens.Lens

func MakeRecordLenses

func MakeRecordLenses() RecordLenses

MakeRecordLenses creates a new RecordLenses with [lenses] for all fields

[lenses]:__lens.Lens

type RecordPrisms

type RecordPrisms struct {
	StrainID   __prism.Prism[Record, string]
	Descriptor __prism.Prism[Record, string]
	PhenoID    __prism.Prism[Record, string]
	AssayID    __prism.Prism[Record, string]
	EnvID      __prism.Prism[Record, string]
	Note       __prism.Prism[Record, string]
	PMID       __prism.Prism[Record, string]
	Deleted    __prism.Prism[Record, string]
	AssignedBy __prism.Prism[Record, string]
}

RecordPrisms provides [prisms] for accessing fields of Record

[prisms]: __prism.Prism

func MakeRecordPrisms

func MakeRecordPrisms() RecordPrisms

MakeRecordPrisms creates a new RecordPrisms with [prisms] for all fields

[prisms]:__prism.Prism

type RecordRefLenses

type RecordRefLenses struct {
	// mandatory fields
	StrainID   __lens.Lens[*Record, string]
	Descriptor __lens.Lens[*Record, string]
	PhenoID    __lens.Lens[*Record, string]
	AssayID    __lens.Lens[*Record, string]
	EnvID      __lens.Lens[*Record, string]
	Note       __lens.Lens[*Record, string]
	PMID       __lens.Lens[*Record, string]
	Deleted    __lens.Lens[*Record, string]
	AssignedBy __lens.Lens[*Record, string]
	// optional fields
	StrainIDO   __lens_option.LensO[*Record, string]
	DescriptorO __lens_option.LensO[*Record, string]
	PhenoIDO    __lens_option.LensO[*Record, string]
	AssayIDO    __lens_option.LensO[*Record, string]
	EnvIDO      __lens_option.LensO[*Record, string]
	NoteO       __lens_option.LensO[*Record, string]
	PMIDO       __lens_option.LensO[*Record, string]
	DeletedO    __lens_option.LensO[*Record, string]
	AssignedByO __lens_option.LensO[*Record, string]
}

RecordRefLenses provides [lenses] for accessing fields of Record via a reference to Record

[lenses]: __lens.Lens

func MakeRecordRefLenses

func MakeRecordRefLenses() RecordRefLenses

MakeRecordRefLenses creates a new RecordRefLenses with [lenses] for all fields

[lenses]:__lens.Lens

type RecordRefPrisms

type RecordRefPrisms struct {
	StrainID   __prism.Prism[*Record, string]
	Descriptor __prism.Prism[*Record, string]
	PhenoID    __prism.Prism[*Record, string]
	AssayID    __prism.Prism[*Record, string]
	EnvID      __prism.Prism[*Record, string]
	Note       __prism.Prism[*Record, string]
	PMID       __prism.Prism[*Record, string]
	Deleted    __prism.Prism[*Record, string]
	AssignedBy __prism.Prism[*Record, string]
}

RecordRefPrisms provides [prisms] for accessing fields of Record via a reference to Record

[prisms]: __prism.Prism

func MakeRecordRefPrisms

func MakeRecordRefPrisms() RecordRefPrisms

MakeRecordRefPrisms creates a new RecordRefPrisms with [prisms] for all fields

[prisms]:__prism.Prism

type State

type State struct {
	Context context.Context
	Options Options
	Files   []string
	Batch   Batch
}

State carries the options, the dependencies, and the results of one run. fp-go:Lens

type StateLenses

type StateLenses struct {
	// mandatory fields
	Context __lens.Lens[State, context.Context]
	Options __lens.Lens[State, Options]
	Files   __lens.Lens[State, []string]
	Batch   __lens.Lens[State, Batch]
	// optional fields
	ContextO __lens_option.LensO[State, context.Context]
	OptionsO __lens_option.LensO[State, Options]
}

StateLenses provides [lenses] for accessing fields of State

[lenses]: __lens.Lens

func MakeStateLenses

func MakeStateLenses() StateLenses

MakeStateLenses creates a new StateLenses with [lenses] for all fields

[lenses]:__lens.Lens

type StatePrisms

type StatePrisms struct {
	Context __prism.Prism[State, context.Context]
	Options __prism.Prism[State, Options]
	Files   __prism.Prism[State, []string]
	Batch   __prism.Prism[State, Batch]
}

StatePrisms provides [prisms] for accessing fields of State

[prisms]: __prism.Prism

func MakeStatePrisms

func MakeStatePrisms() StatePrisms

MakeStatePrisms creates a new StatePrisms with [prisms] for all fields

[prisms]:__prism.Prism

type StateRefLenses

type StateRefLenses struct {
	// mandatory fields
	Context __lens.Lens[*State, context.Context]
	Options __lens.Lens[*State, Options]
	Files   __lens.Lens[*State, []string]
	Batch   __lens.Lens[*State, Batch]
	// optional fields
	ContextO __lens_option.LensO[*State, context.Context]
	OptionsO __lens_option.LensO[*State, Options]
}

StateRefLenses provides [lenses] for accessing fields of State via a reference to State

[lenses]: __lens.Lens

func MakeStateRefLenses

func MakeStateRefLenses() StateRefLenses

MakeStateRefLenses creates a new StateRefLenses with [lenses] for all fields

[lenses]:__lens.Lens

type StateRefPrisms

type StateRefPrisms struct {
	Context __prism.Prism[*State, context.Context]
	Options __prism.Prism[*State, Options]
	Files   __prism.Prism[*State, []string]
	Batch   __prism.Prism[*State, Batch]
}

StateRefPrisms provides [prisms] for accessing fields of State via a reference to State

[prisms]: __prism.Prism

func MakeStateRefPrisms

func MakeStateRefPrisms() StateRefPrisms

MakeStateRefPrisms creates a new StateRefPrisms with [prisms] for all fields

[prisms]:__prism.Prism

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL