cli

package
v0.0.0-...-e4bf1e1 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: BSD-2-Clause Imports: 46 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Default worker pool sizes for concurrent processing
	DefaultWorkers               = 4
	DefaultBatchSize             = 100
	DefaultPubmedWorkers         = 4
	DefaultGRPCWorkers           = 8
	DefaultProcessingWorkers     = 4
	DefaultLegacyWorkers         = 4
	DefaultSynonymGRPCWorkers    = 4
	DefaultValidationWorkers     = 5
	DefaultCSVBatchSize          = 40
	DefaultCSVWorkers            = 4
	DefaultValidationTimeoutSecs = 30
)
View Source
const (

	// GeneProductQuery is the AQL query for fetching gene products
	GeneProductQuery = `` /* 350-byte string literal not displayed */

	ListActiveGenesQ = `` /* 591-byte string literal not displayed */

	ListPubmedsByFeature = `` /* 184-byte string literal not displayed */

	ListSynonyms = `` /* 1457-byte string literal not displayed */

)
View Source
const DefaultAQLQuery = `` /* 742-byte string literal not displayed */

DefaultAQLQuery is the default query to fetch gene data from ArangoDB. Exported for use in flag.go

View Source
const (
	// DefaultUserName is the default creator/updater for annotations
	DefaultUserName = "dcr@dictycr.org"
)
View Source
const (
	GeneProductTag = "gene product"
)

Constants for gene product processing

Variables

View Source
var AnnMap = map[string]string{
	"CGM_DDB_PASC": "pgaudet@northwestern.edu",
	"CGM_DDB_PFEY": "pfey@northwestern.edu",
	"CGM_DDB_BOBD": "robert-dodson@northwestern.edu",
	"CGM_DDB_KPIL": "kpilchar@northwestern.edu",
	"CGM_DDB":      "dictybase@northwestern.edu",
}

AnnMap maps legacy creator usernames to their email addresses.

Functions

func GeneDescriptionFromCsvFlag

func GeneDescriptionFromCsvFlag() []cli.Flag

GeneDescriptionFromCsvFlag returns all flags required for loading gene descriptions from CSV files. It combines gene description specific flags with gRPC connection flags.

func GeneProductFromCsvFlag

func GeneProductFromCsvFlag() []cli.Flag

GeneProductFromCsvFlag returns all flags required for loading gene products from CSV files. It combines gene product specific flags with gRPC connection flags.

func GeneProductUpdaterFlags

func GeneProductUpdaterFlags() []cli.Flag

GeneProductUpdaterFlags returns flags for gene product updater

func GeneUpdaterFlags

func GeneUpdaterFlags() []cli.Flag

GeneUpdaterFlags returns all flags required for the gene updater command.

func LoadCSVToArangodb

func LoadCSVToArangodb(cltx *cli.Context) error

func LoadCSVToArangodbFlag

func LoadCSVToArangodbFlag() []cli.Flag

LoadCSVToArangodbFlag returns all flags required for loading CSV data to ArangoDB. It combines ArangoDB connection flags with CSV processing specific flags.

func LoadFeatureAnnotationFlag

func LoadFeatureAnnotationFlag() []cli.Flag

LoadFeatureAnnotationFlag returns all flags required for loading feature annotations. It combines ArangoDB connection flags, gRPC flags, and pubmed/grpc worker configuration.

func LoadGeneDescription

func LoadGeneDescription(c *cli.Context) error

LoadGeneDescription loads gene descriptions from a CSV file into the feature annotation service. It validates input parameters, processes the CSV file concurrently, and reports results.

func LoadGeneDescriptionFlag

func LoadGeneDescriptionFlag() []cli.Flag

LoadGeneDescriptionFlag returns flags specific to gene description loading operations. Input validation is performed during command execution to ensure the file exists and user email is properly formatted.

func LoadGeneProduct

func LoadGeneProduct(c *cli.Context) error

func LoadGeneProductFlag

func LoadGeneProductFlag() []cli.Flag

LoadGeneProductFlag returns flags specific to gene product loading operations. Input validation is performed during command execution to ensure files exist and user email is properly formatted.

func LoadHypotheticalGeneProducts

func LoadHypotheticalGeneProducts(c *cli.Context) error

LoadHypotheticalGeneProducts is the main action handler for the command

func LoadHypotheticalGeneProductsFlags

func LoadHypotheticalGeneProductsFlags() []cli.Flag

LoadHypotheticalGeneProductsFlags returns flags for loading hypothetical gene products from a text file. It combines input file flag, user flag, and gRPC connection flags.

func NewGraphQLClient

func NewGraphQLClient(
	graphqlURL string,
	opts ...GraphQLClientOption,
) *graphql.Client

NewGraphQLClient creates a new GraphQL client with the given options

func ParseUnknowmeData

func ParseUnknowmeData(cliCtx *cli.Context) error

ParseUnknowmeData processes HTML files containing gene data tables and extracts DDB_G entries with their corresponding gene product and description information

func ParseUnknowmeDataFlags

func ParseUnknowmeDataFlags() []cli.Flag

ParseUnknowmeDataFlags returns flags for parsing unknowme HTML data to CSV files. Input validation is performed during command execution to ensure files exist.

func RunFeatureAnnotationLoader

func RunFeatureAnnotationLoader(cltx *cli.Context) error

func RunGeneProductUpdater

func RunGeneProductUpdater(cltx *cli.Context) error

RunGeneProductUpdater is the main entry point for the gene product updater

func RunGeneUpdater

func RunGeneUpdater(cltx *cli.Context) error

func RunSynonymLoader

func RunSynonymLoader(cltx *cli.Context) error

RunSynonymLoader is the main entry point for the synonym loader.

func SynonymLoaderFlags

func SynonymLoaderFlags() []cli.Flag

SynonymLoaderFlags returns all flags required for the synonym loader command.

func ValidateGeneData

func ValidateGeneData(c *cli.Context) error

ValidateGeneData is the main action function for gene data validation

func ValidateGeneDataFlags

func ValidateGeneDataFlags() []cli.Flag

ValidateGeneDataFlags returns flags for the gene data validation command. Enhanced with security validations and constraints for file size and URL schemes.

func ValidateStruct

func ValidateStruct(s any) error

ValidateStruct validates a struct and returns a formatted error if validation fails

Types

type AppConfig

type AppConfig struct {
	AQLQuery             string
	ArangoUser           string // For authorship in gRPC updates
	NumProcessingWorkers int
	NumGrpcWorkers       int
	Logger               *logrus.Entry
	Metrics              *ProcessingMetrics // Add this field
}

AppConfig holds all configuration for the application.

type ArangoProperty

type ArangoProperty struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

ArangoProperty represents a single property object from ArangoDB.

type ArangoResultDoc

type ArangoResultDoc struct {
	ID    string           `json:"id"` // This is dbx.accession, likely the feature_id
	Props []ArangoProperty `json:"props"`
}

ArangoResultDoc represents the structure of a document from ArangoDB.

type BatchGeneProductJob

type BatchGeneProductJob struct {
	GeneProducts []ProcessedGeneProduct
}

BatchGeneProductJob holds a slice of gene products for batch processing

type BatchGeneProductResult

type BatchGeneProductResult struct {
	GeneID         string
	Success        bool
	Message        string
	Error          error
	ProcessedCount int
	SkippedCount   int
}

BatchGeneProductResult holds the result of batch gene product processing

type CSVFileConstraints

type CSVFileConstraints struct {
	MaxFileSizeBytes int64
	MaxRecords       int
}

CSVFileConstraints defines file size and content limits

type CSVRecordWriter

type CSVRecordWriter interface {
	WriteRecord(record GeneDataRecord) error
	ShouldSkip(record GeneDataRecord) bool
	Close() error
}

CSVRecordWriter defines a common interface for writing gene data records to CSV

type CSVWriterCreationParams

type CSVWriterCreationParams struct {
	GeneProductOutputFile     string `validate:"required,min=1" json:"gene_product_output_file"`
	GeneDescriptionOutputFile string `validate:"required,min=1" json:"gene_description_output_file"`
}

CSVWriterCreationParams contains parameters for creating CSV writers

type CellTextExtractor

type CellTextExtractor func(*goquery.Selection) O.Option[string]

CellTextExtractor represents a function that extracts text from a single cell

type ConcurrentValidationParams

type ConcurrentValidationParams struct {
	ValidationParams GeneValidationParams
	Records          [][]string
	Context          context.Context
}

ConcurrentValidationParams contains parameters for concurrent validation

type FeatureAnnotationAppConfig

type FeatureAnnotationAppConfig struct {
	Ctx              context.Context
	NumPubmedWorkers int
	NumGrpcWorkers   int
	Logger           *logrus.Entry
	Metrics          *FeatureAnnotationMetrics
}

type FeatureAnnotationMetrics

type FeatureAnnotationMetrics struct {
	TotalProcessed int64
	SuccessCount   int64
	ErrorCount     int64
	StartTime      time.Time

	TotalFetchedFromArango      int64
	AllArangoDocsFetched        bool
	JobsSubmittedToPubmedPool   int64
	JobsCompletedFromPubmedPool int64
	JobsSubmittedToGrpcPool     int64
	JobsCompletedFromGrpcPool   int64
	// contains filtered or unexported fields
}

func (*FeatureAnnotationMetrics) IsComplete

func (m *FeatureAnnotationMetrics) IsComplete() bool

type FileContext

type FileContext struct {
	Setup  SetupConfig
	File   *os.File
	Reader *csv.Reader
	Error  error // To propagate errors
}

Stage 2: File Processing

type Gene

type Gene struct {
	FeatureID int    `json:"feature_id"`
	GeneID    string `json:"gene_id"`
	Name      string `json:"name"`
	CreatedBy string `json:"created_by"`
}

type GeneDataRecord

type GeneDataRecord struct {
	GeneID      string `validate:"required,min=1" json:"gene_id"`
	GeneProduct string `                          json:"gene_product"`
	Description string `                          json:"description"`
}

GeneDataRecord represents a single gene data record

type GeneDescription

type GeneDescription struct {
	GeneID      string `validate:"required,min=1"`
	Description string `validate:"required,min=1"`
}

GeneDescription represents a gene with its description for loading operations.

type GeneDescriptionCSVWriter

type GeneDescriptionCSVWriter struct {
	// contains filtered or unexported fields
}

GeneDescriptionCSVWriter writes gene description data to CSV format

func NewGeneDescriptionCSVWriter

func NewGeneDescriptionCSVWriter(
	filename string,
) (*GeneDescriptionCSVWriter, error)

NewGeneDescriptionCSVWriter creates a new CSV writer for gene descriptions

func NewGeneDescriptionCSVWriterWithParams

func NewGeneDescriptionCSVWriterWithParams(
	params GeneDescriptionCSVWriterParams,
) (*GeneDescriptionCSVWriter, error)

NewGeneDescriptionCSVWriterWithParams creates a new CSV writer for gene descriptions with validated parameters

func (*GeneDescriptionCSVWriter) Close

func (w *GeneDescriptionCSVWriter) Close() error

func (*GeneDescriptionCSVWriter) ShouldSkip

func (w *GeneDescriptionCSVWriter) ShouldSkip(record GeneDataRecord) bool

func (*GeneDescriptionCSVWriter) WriteRecord

func (w *GeneDescriptionCSVWriter) WriteRecord(record GeneDataRecord) error

type GeneDescriptionCSVWriterParams

type GeneDescriptionCSVWriterParams struct {
	Filename string `validate:"required,min=1" json:"filename"`
}

GeneDescriptionCSVWriterParams contains parameters for creating a gene description CSV writer

type GeneDescriptionRequest

type GeneDescriptionRequest struct {
	GeneID      string `validate:"required,min=1"`
	Description string `validate:"required,min=1"`
	User        string `validate:"required,email"`
}

GeneDescriptionRequest holds validated data for a single gene description

type GeneGeneralInformationQuery

type GeneGeneralInformationQuery struct {
	GeneGeneralInformation *struct {
		ID          string `graphql:"id"`
		Description string `graphql:"description"`
	} `graphql:"geneGeneralInformation(gene: $gene)"`
}

GeneGeneralInformationQuery represents the GraphQL query structure for retrieving gene information including ID and description fields.

type GeneInfo

type GeneInfo struct {
	Name      string `json:"name"`
	GeneID    string `json:"gene_id"`
	FeatureID int64  `json:"feature_id"`
	CreatedBy string `json:"created_by"`
}

GeneInfo holds gene information from ArangoDB

type GeneProcessingAction

type GeneProcessingAction int

GeneProcessingAction represents the action taken for a gene

const (
	// HypotheticalProteinProduct is the product name for hypothetical proteins
	HypotheticalProteinProduct = "conserved hypothetical protein"
	// GeneCreated indicates a new annotation was created
	GeneCreated GeneProcessingAction = iota
	// GeneUpdated indicates a product tag was added to existing annotation
	GeneUpdated
	// GeneSkipped indicates the annotation already had the product tag
	GeneSkipped
)

type GeneProcessingContext

type GeneProcessingContext struct {
	Config ProcessingConfig
	GeneID string
}

GeneProcessingContext holds initial processing context

type GeneProcessingResult

type GeneProcessingResult struct {
	GeneID string
	Action GeneProcessingAction
}

GeneProcessingResult represents successful processing of a single gene

type GeneProduct

type GeneProduct struct {
	GeneID  string
	Product string
}

type GeneProductAppConfig

type GeneProductAppConfig struct {
	Ctx              context.Context
	LegacyDatabase   string
	NumLegacyWorkers int
	NumGrpcWorkers   int
	Logger           *logrus.Entry
	Metrics          *GeneProductMetrics
}

GeneProductAppConfig holds configuration

type GeneProductCSVWriter

type GeneProductCSVWriter struct {
	// contains filtered or unexported fields
}

GeneProductCSVWriter writes gene product data to CSV format

func NewGeneProductCSVWriter

func NewGeneProductCSVWriter(filename string) (*GeneProductCSVWriter, error)

NewGeneProductCSVWriter creates a new CSV writer for gene products

func NewGeneProductCSVWriterWithParams

func NewGeneProductCSVWriterWithParams(
	params GeneProductCSVWriterParams,
) (*GeneProductCSVWriter, error)

NewGeneProductCSVWriterWithParams creates a new CSV writer for gene products with validated parameters

func (*GeneProductCSVWriter) Close

func (w *GeneProductCSVWriter) Close() error

func (*GeneProductCSVWriter) ShouldSkip

func (w *GeneProductCSVWriter) ShouldSkip(record GeneDataRecord) bool

func (*GeneProductCSVWriter) WriteRecord

func (w *GeneProductCSVWriter) WriteRecord(record GeneDataRecord) error

type GeneProductCSVWriterParams

type GeneProductCSVWriterParams struct {
	Filename string `validate:"required,min=1" json:"filename"`
}

GeneProductCSVWriterParams contains parameters for creating a gene product CSV writer

type GeneProductMetrics

type GeneProductMetrics struct {
	TotalProcessed int64
	SuccessCount   int64
	ErrorCount     int64
	SkippedCount   int64
	StartTime      time.Time

	TotalFetchedFromArango      int64
	AllArangoDocsFetched        bool
	JobsSubmittedToLegacyPool   int64
	JobsCompletedFromLegacyPool int64
	JobsSubmittedToGrpcPool     int64
	JobsCompletedFromGrpcPool   int64
	// contains filtered or unexported fields
}

GeneProductMetrics holds processing metrics

func (*GeneProductMetrics) IsComplete

func (m *GeneProductMetrics) IsComplete() bool

IsComplete checks if all processing is finished

type GeneProductResult

type GeneProductResult struct {
	GeneProduct string     `json:"gene_product"`
	CreatedBy   string     `json:"created_by"`
	CreatedOn   LegacyTime `json:"created_on"`
}

GeneProductResult holds gene product query result

type GeneValidationParams

type GeneValidationParams struct {
	InputFile    string `validate:"required,file_exists,max_file_size"`
	OutputReport string `validate:"required,endswith=.json"`
	GraphQLURL   string `validate:"required,url,startswith=https"`
	Timeout      int    `validate:"gte=10,lte=300"`
	Workers      int    `validate:"gte=1,lte=20"`
}

GeneValidationParams contains all parameters needed for gene validation

type GeneWithPubmed

type GeneWithPubmed struct {
	Gene
	Pubmeds    []string
	Skip       bool
	SkipReason string
}

type GraphQLClientConfig

type GraphQLClientConfig struct {
	URL        string
	HTTPClient *http.Client
	Headers    map[string]string
}

GraphQLClientConfig holds configuration options for creating a GraphQL client, including URL, HTTP client, and custom headers.

type GraphQLClientOption

type GraphQLClientOption func(*GraphQLClientConfig)

GraphQLClientOption is a functional option for configuring GraphQL client

func WithHTTPClient

func WithHTTPClient(client *http.Client) GraphQLClientOption

WithHTTPClient sets the HTTP client for GraphQL operations

func WithHeaders

func WithHeaders(headers map[string]string) GraphQLClientOption

WithHeaders sets custom headers for GraphQL requests

func WithTimeout

func WithTimeout(timeout time.Duration) GraphQLClientOption

WithTimeout sets the timeout for HTTP requests

type GrpcAnnotationResult

type GrpcAnnotationResult struct {
	GeneID  string
	Success bool
	Skipped bool
	Message string
	Error   error
}

type GrpcSynonymResult

type GrpcSynonymResult struct {
	GeneID  string
	Success bool
	Message string
	Error   error
}

GrpcSynonymResult holds the result of a gRPC update operation for synonyms.

type GrpcUpdateResult

type GrpcUpdateResult struct {
	GeneID  string
	Success bool
	Message string
	Error   error
}

GrpcUpdateResult holds the result of a gRPC update operation.

type LegacyTime

type LegacyTime struct {
	time.Time
}

LegacyTime handles Oracle date format "DD-MON-YY" from legacy database

func (*LegacyTime) UnmarshalJSON

func (lt *LegacyTime) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler for Oracle date format

type LoadGeneDescriptionParams

type LoadGeneDescriptionParams struct {
	InputFile string `validate:"required,file"`
	Workers   int    `validate:"gte=1,lte=50"`
	BatchSize int    `validate:"gte=1,lte=1000"`
	User      string `validate:"required,email"`
}

LoadGeneDescriptionParams holds validated parameters for loading gene descriptions

type LoadGeneProductParams

type LoadGeneProductParams struct {
	InputFiles []string `validate:"required,dive,file"`
	Workers    int      `validate:"gte=1,lte=50"`
	BatchSize  int      `validate:"gte=1,lte=1000"`
	User       string   `validate:"required,email"`
}

LoadGeneProductParams holds validated parameters for loading gene products

type LoadHypotheticalGeneProductsParams

type LoadHypotheticalGeneProductsParams struct {
	User   string
	Client pb.FeatureAnnotationServiceClient
}

LoadHypotheticalGeneProductsParams holds parameters for loading hypothetical gene products

type ParseUnknowmeDataParams

type ParseUnknowmeDataParams struct {
	InputFiles            []string `validate:"required,min=1,dive,file" json:"input_files"`
	GeneProductOutput     string   `validate:"required,min=1"           json:"gene_product_output"`
	GeneDescriptionOutput string   `validate:"required,min=1"           json:"gene_description_output"`
}

ParseUnknowmeDataParams contains all parameters for the ParseUnknowmeData function

type ParsingConfig

type ParsingConfig struct {
	// contains filtered or unexported fields
}

ParsingConfig holds configuration for parsing operations

func NewParsingConfig

func NewParsingConfig(opts ...ParsingOption) *ParsingConfig

NewParsingConfig creates a new ParsingConfig with default values and applies options

type ParsingOption

type ParsingOption func(*ParsingConfig)

ParsingOption is a function that configures ParsingConfig

func WithGeneProductColumnRange

func WithGeneProductColumnRange(startCol, endCol int) ParsingOption

WithGeneProductColumnRange sets the column range for searching gene products

func WithSkipEmptyDescription

func WithSkipEmptyDescription(skip bool) ParsingOption

WithSkipEmptyDescription controls whether to skip records with empty descriptions

func WithSkipEmptyProduct

func WithSkipEmptyProduct(skip bool) ParsingOption

WithSkipEmptyProduct controls whether to skip records with empty gene products

type PipelineResult

type PipelineResult struct {
	File        *os.File
	Setup       SetupConfig
	UpdateCount int
	Error       error
}

Stage 4: Data Processing / Final Pipeline Result

type ProcessSingleRecordParams

type ProcessSingleRecordParams struct {
	Record             []string
	FeaturePropIDIndex int
	ValueIndex         int
	RowNumForLogging   int // Actual row number in the CSV file for logging
	Logger             *logrus.Entry
}

ProcessSingleRecordParams holds the parameters for the processSingleRecordAndValidate function.

type ProcessedGeneData

type ProcessedGeneData struct {
	GeneID            string
	StrippedPropsText []StrippedProperty
}

ProcessedGeneData holds the gene ID and its list of HTML-stripped property values.

type ProcessedGeneProduct

type ProcessedGeneProduct struct {
	GeneID      string
	GeneName    string
	GeneProduct string
	CreatedBy   string
	CreatedOn   time.Time
}

ProcessedGeneProduct holds processed gene with product

type ProcessingConfig

type ProcessingConfig struct {
	GeneIDs []string
	User    string
	Client  pb.FeatureAnnotationServiceClient
}

ProcessingConfig holds immutable configuration for processing gene IDs

type ProcessingContext

type ProcessingContext struct {
	FileContext
	FeaturePropIDIndex int
	ValueIndex         int
}

Stage 3: Header Validation

type ProcessingMetrics

type ProcessingMetrics struct {
	TotalProcessed int64
	SuccessCount   int64
	ErrorCount     int64
	StartTime      time.Time

	// TotalFetchedFromArango stores the total number of items fetched by queryArango.
	// This field is set by queryArango once the total count is known.
	TotalFetchedFromArango int64
	// AllArangoDocsFetched is a flag set to true by queryArango after all documents
	// have been fetched and sent to the processing pipeline.
	AllArangoDocsFetched bool
	// Intermediate tracking counters for detailed pipeline monitoring
	JobsSubmittedToHTMLPool   int64
	JobsCompletedFromHTMLPool int64
	JobsSubmittedToGrpcPool   int64
	JobsCompletedFromGrpcPool int64
	// contains filtered or unexported fields
}

ProcessingMetrics holds counters for tracking progress.

type ProcessingResult

type ProcessingResult struct {
	TotalRecordsProcessed     int
	GeneProductRecordsWritten int
	DescriptionRecordsWritten int
}

ProcessingResult contains the results of processing gene data records

type ProcessingStats

type ProcessingStats struct {
	Created int
	Updated int
	Skipped int
	Total   int
}

ProcessingStats holds aggregate processing statistics

type SetupConfig

type SetupConfig struct {
	Logger         *logrus.Entry
	DBH            *arangomanager.Database
	CSVFilePath    string
	CollectionName string
	BatchSize      int
	Delimiter      string
	Workers        int
}

Stage 1: Setup

type SingleGeneValidationParams

type SingleGeneValidationParams struct {
	Client  *graphql.Client
	Record  []string
	Context context.Context
}

SingleGeneValidationParams contains parameters for validating a single gene

type StrippedProperty

type StrippedProperty struct {
	OriginalName string
	StrippedText string
}

StrippedProperty holds the original property name and its stripped text.

type SubmitBatchAndLogParams

type SubmitBatchAndLogParams struct {
	Setup            *SetupConfig
	Docs             []map[string]string
	Logger           *logrus.Entry
	BatchDescription string
}

SubmitBatchAndLogParams holds the parameters for the submitBatchAndLog function.

type SynonymAppConfig

type SynonymAppConfig struct {
	Ctx            context.Context
	NumGrpcWorkers int
	Logger         *logrus.Entry
	Metrics        *SynonymMetrics
}

SynonymAppConfig holds configuration for the synonym loader application.

type SynonymData

type SynonymData struct {
	Name     string   `json:"name"`
	GeneID   string   `json:"gene_id"`
	Synonyms []string `json:"synonyms"`
}

SynonymData holds gene synonym information from ArangoDB

type SynonymMetrics

type SynonymMetrics struct {
	TotalProcessed int64
	SuccessCount   int64
	NotFoundCount  int64
	ErrorCount     int64
	StartTime      time.Time

	TotalFetchedFromArango    int64
	AllArangoDocsFetched      bool
	JobsSubmittedToGrpcPool   int64
	JobsCompletedFromGrpcPool int64
	// contains filtered or unexported fields
}

SynonymMetrics holds processing metrics for the synonym loader.

func (*SynonymMetrics) IsComplete

func (m *SynonymMetrics) IsComplete() bool

IsComplete checks if all processing is finished.

type ValidationError

type ValidationError struct {
	Errors validator.ValidationErrors
}

ValidationError wraps multiple validation errors from go-playground/validator

func (*ValidationError) Error

func (e *ValidationError) Error() string

type ValidationReport

type ValidationReport struct {
	TotalGenes    int                `json:"total_genes"`
	MatchCount    int                `json:"match_count"`
	MismatchCount int                `json:"mismatch_count"`
	ErrorCount    int                `json:"error_count"`
	Results       []ValidationResult `json:"results"`
	GeneratedAt   time.Time          `json:"generated_at"`
}

ValidationReport contains the complete validation report

type ValidationResult

type ValidationResult struct {
	GeneID         string `json:"gene_id"`
	CSVDescription string `json:"csv_description"`
	GQLDescription string `json:"gql_description"`
	Match          bool   `json:"match"`
	Error          string `json:"error,omitempty"`
}

ValidationResult represents the result of validating a single gene

type WithAction

type WithAction struct {
	WithAnnotation
	Action GeneProcessingAction
}

WithAction holds context with determined action

type WithAnnotation

type WithAnnotation struct {
	GeneProcessingContext
	Annotation O.Option[*pb.FeatureAnnotation]
}

WithAnnotation holds context with fetched annotation

Jump to

Keyboard shortcuts

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