Documentation
¶
Index ¶
- Variables
- func GoldenBraidSummarySemigroup() S.Semigroup[GoldenBraidProcessingResult]
- func InventorySummarySemigroup() S.Semigroup[InventoryProcessingSummary]
- func LoadGeno(_ *cobra.Command, _ []string) error
- func LoadGoldenBraidCli(cmd *cli.Context) error
- func LoadGwdi(_ *cobra.Command, _ []string) error
- func LoadOrder(_ *cobra.Command, _ []string) error
- func LoadPheno(_ *cobra.Command, _ []string) error
- func LoadPlasmid(_ *cobra.Command, _ []string) error
- func LoadPlasmidInv(_ *cobra.Command, _ []string) error
- func LoadPlasmidOntologyCli(cmd *cli.Context) error
- func LoadStrain(_ *cobra.Command, _ []string) error
- func LoadStrainChar(_ *cobra.Command, _ []string) error
- func LoadStrainInv(_ *cobra.Command, _ []string) error
- func LoadStrainProp(_ *cobra.Command, _ []string) error
- func LoadStrainSynProp(_ *cobra.Command, _ []string) error
- func ProcessInventory(deps Deps, config InventoryLoaderConfig) IOE.IOEither[error, InventoryProcessingSummary]
- func ReleaseInventoryResources(config InventoryLoaderConfig, _ E.Either[error, InventoryProcessingSummary]) IOE.IOEither[error, any]
- func StatsSemigroup() S.Semigroup[OntologyUpdateStats]
- func TimestampProto(t time.Time) *timestamppb.Timestamp
- type AnnotationContext
- type DBBuildContext
- type Deps
- type GoldenBraidProcessingResult
- type GoldenBraidResult
- type InventoryLoaderConfig
- type InventoryLoaderIOE
- type InventoryProcessingSummary
- type LoaderConfig
- type LoaderContext
- type LookupContext
- type LookupTuple
- type OntologyUpdateStats
- type PipelineContext
- type PlasmidEnv
- type ProcessContext
- type Processing
- type ProcessingResult
- type Status
- type UpdateContext
- type WithAnnotator
- type WithGeneLookup
- type WithPubLookup
Constants ¶
This section is empty.
Variables ¶
var ( SetAnnotator = F.Curry2( func(annotator source.StockAnnotatorLookup, ctx LookupContext) WithAnnotator { return WithAnnotator{ LookupContext: ctx, Annotator: annotator, } }, ) SetPubLookup = F.Curry2( func(pubLookup source.StockPubLookup, ctx WithAnnotator) WithPubLookup { return WithPubLookup{ WithAnnotator: ctx, PubLookup: pubLookup, } }, ) SetGeneLookup = F.Curry2( func(geneLookup source.StockGeneLookup, ctx WithPubLookup) WithGeneLookup { return WithGeneLookup{ WithPubLookup: ctx, GeneLookup: geneLookup, } }, ) )
Curried setters for Do/Bind pattern
var ProcessingResultSemigroup = SG.MakeSemigroup( func(a, b ProcessingResult) ProcessingResult { return ProcessingResult{ Successes: append(a.Successes, b.Successes...), Errors: errors.Join(a.Errors, b.Errors), ErrorCount: a.ErrorCount + b.ErrorCount, } }, )
ProcessingResultSemigroup for combining results
Functions ¶
func GoldenBraidSummarySemigroup ¶
func GoldenBraidSummarySemigroup() S.Semigroup[GoldenBraidProcessingResult]
func InventorySummarySemigroup ¶
func InventorySummarySemigroup() S.Semigroup[InventoryProcessingSummary]
func LoadGoldenBraidCli ¶
LoadGoldenBraidCli is the main entry point for loading GoldenBraid CSV data
func LoadPlasmid ¶
LoadPlasmid is the main entry point for plasmid loading
func LoadPlasmidOntologyCli ¶
LoadPlasmidOntologyCli is the CLI entry point for ontology updates
func ProcessInventory ¶
func ProcessInventory( deps Deps, config InventoryLoaderConfig, ) IOE.IOEither[error, InventoryProcessingSummary]
func ReleaseInventoryResources ¶
func ReleaseInventoryResources( config InventoryLoaderConfig, _ E.Either[error, InventoryProcessingSummary], ) IOE.IOEither[error, any]
func StatsSemigroup ¶
func StatsSemigroup() S.Semigroup[OntologyUpdateStats]
StatsSemigroup creates a semigroup for combining stats
func TimestampProto ¶
func TimestampProto(t time.Time) *timestamppb.Timestamp
Types ¶
type AnnotationContext ¶
type AnnotationContext struct {
Client pb.TaggedAnnotationServiceClient
PlasmidID string
Tag string
Value string
}
type DBBuildContext ¶
type DBBuildContext struct {
Reader io.ReadCloser
GoldenBraidReader io.ReadCloser
Context context.Context
Builder *filesql.DBBuilder
}
DBBuildContext contains only the fields needed for building inventory database
type Deps ¶
type Deps struct {
StockClient stock.StockServiceClient
AnnotationClient pb.TaggedAnnotationServiceClient
Logger *slog.Logger
}
Deps holds dependencies for inventory processing
type GoldenBraidProcessingResult ¶
type GoldenBraidProcessingResult struct {
CreatedCount int // New plasmids created
SkippedCount int // Existing plasmids skipped (already exist)
Successes []string // All plasmid IDs (created + skipped)
Errors []error
ErrorCount int
}
GoldenBraidProcessingResult holds aggregate processing statistics
type GoldenBraidResult ¶
type GoldenBraidResult struct {
PlasmidID string
Created bool // true=created, false=skipped
Error error
}
Result of UPSERT operation
type InventoryLoaderConfig ¶
type InventoryLoaderConfig struct {
DB *sql.DB
Reader io.ReadCloser
GoldenBraidReader io.ReadCloser
Logger *slog.Logger
Cmd *cli.Context
}
type InventoryLoaderIOE ¶
type InventoryLoaderIOE = IOE.IOEither[error, InventoryLoaderConfig]
func InventoryBuilderFromFile ¶
func InventoryBuilderFromFile( cmd *cli.Context, logger *slog.Logger, ) InventoryLoaderIOE
type LoaderConfig ¶
type LoaderConfig struct {
LoaderContext
Cmd *cli.Context
Reader *csv.Reader
Closer io.Closer
Slogger *slog.Logger
}
LoaderConfig holds CLI context and CSV reader
type LookupTuple ¶
type LookupTuple struct {
Annotator source.StockAnnotatorLookup
PubLookup source.StockPubLookup
GeneLookup source.StockGeneLookup
}
LookupTuple holds all lookup instances
type OntologyUpdateStats ¶
type OntologyUpdateStats struct {
ProcessedCount int `json:"processed_count"` // Total plasmids examined
UpdatedCount int `json:"updated_count"` // Successfully updated
ErrorCount int `json:"error_count"` // Failed updates
Errors []error `json:"-"` // Error samples (first 5)
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
}
OntologyUpdateStats tracks update operation metrics
type PipelineContext ¶
type PipelineContext struct {
Deps Deps
PlasmidName string
Location string
PlasmidID string
Inventory *pb.TaggedAnnotationGroupCollection
InventoryDeleted bool
AnnotationIDs []string
GroupCreated bool
}
PipelineContext represents the complete state of inventory processing
type PlasmidEnv ¶
type PlasmidEnv struct {
Logger *logrus.Entry
APIClient pb.StockServiceClient
}
PlasmidEnv contains all dependencies for plasmid loading
type ProcessContext ¶
type ProcessContext struct {
Client stockpb.StockServiceClient
Term string
Plasmid *stockpb.PlasmidCollection_Data
}
ProcessContext - Context struct for processPlasmid (point-free, no lambda wrapper)
type Processing ¶
type Processing[A any] = RE.ReaderIOEither[Deps, error, A]
Processing is a ReaderIOEither that injects Deps
type ProcessingResult ¶
type ProcessingResult struct {
Successes []string // Successfully processed plasmid IDs
Errors error // All validation/processing errors
ErrorCount int // Number of errors (for accurate statistics)
}
ProcessingResult accumulates successes and errors
type Status ¶
type Status int
func NewOrReloadGeno ¶
func NewOrReloadGeno(client pb.TaggedAnnotationServiceClient, p *genoArgs) (Status, error)
type UpdateContext ¶
type UpdateContext struct {
Client stockpb.StockServiceClient
Term string
Plasmid *stockpb.Plasmid
}
UpdateContext - Context struct for updatePlasmidTerm (point-free, no lambda wrapper)
type WithAnnotator ¶
type WithAnnotator struct {
LookupContext
Annotator source.StockAnnotatorLookup
}
type WithGeneLookup ¶
type WithGeneLookup struct {
WithPubLookup
GeneLookup source.StockGeneLookup
}
type WithPubLookup ¶
type WithPubLookup struct {
WithAnnotator
PubLookup source.StockPubLookup
}