phenotype

package
v0.0.0-...-2b433ae Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package phenotype defines the structure and associated methods for handling phenotype annotations. Each annotation is represented by the PhenotypeAnnotation struct, which includes details like strain ID, phenotype ID, assay ID, environment ID, strain descriptor, notes, reference, assigned by, and flags for deletion and emptiness. The struct's methods provide accessors and checkers for the various fields.

Package phenotype provides functionality to read phenotype annotations from an Excel file. It defines the PhenotypeAnnotationReader struct with methods to create a new reader, iterate over rows of data, and retrieve phenotype annotations as structured data with validation. The reader is initialized with a file path, a specific sheet name, and a creation date, and it includes error handling for file and row reading. It uses the third-party libraries excelize for Excel file manipulation and go-playground/validator for data validation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PhenotypeAnnotation

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

PhenotypeAnnotation represents annotations related to a phenotype.

func (*PhenotypeAnnotation) AssayId

func (pha *PhenotypeAnnotation) AssayId() string

AssayId returns the assay ID associated with the phenotype annotation.

func (*PhenotypeAnnotation) AssignedBy

func (pha *PhenotypeAnnotation) AssignedBy() string

AssignedBy returns the identifier of the entity that assigned the phenotype annotation.

func (*PhenotypeAnnotation) CreatedOn

func (pha *PhenotypeAnnotation) CreatedOn() time.Time

func (*PhenotypeAnnotation) EnvironmentId

func (pha *PhenotypeAnnotation) EnvironmentId() string

EnvironmentId returns the environment ID associated with the phenotype annotation.

func (*PhenotypeAnnotation) HasAssayId

func (pha *PhenotypeAnnotation) HasAssayId() bool

HasAssayId checks whether an assay ID is associated with the phenotype annotation. It returns true if the assay ID is set.

func (*PhenotypeAnnotation) HasEnvironmentId

func (pha *PhenotypeAnnotation) HasEnvironmentId() bool

HasEnvironmentId checks whether an environment ID is associated with the phenotype annotation. It returns true if the environment ID is set.

func (*PhenotypeAnnotation) HasNotes

func (pha *PhenotypeAnnotation) HasNotes() bool

func (*PhenotypeAnnotation) HasStrainDescriptor

func (pha *PhenotypeAnnotation) HasStrainDescriptor() bool

HasStrainDescriptor checks if the PhenotypeAnnotation instance has a strainDescriptor defined. It returns true if the strainDescriptor is not empty, otherwise false.

func (*PhenotypeAnnotation) HasStrainId

func (pha *PhenotypeAnnotation) HasStrainId() bool

HasStrainId checks whether a strain ID is associated with the phenotype annotation. It returns true if the strain ID is set.

func (*PhenotypeAnnotation) IsEmpty

func (pha *PhenotypeAnnotation) IsEmpty() bool

IsEmpty checks if the phenotype annotation is marked as empty. It returns true if the annotation is considered empty.

func (*PhenotypeAnnotation) Notes

func (pha *PhenotypeAnnotation) Notes() string

Notes returns any notes associated with the phenotype annotation.

func (*PhenotypeAnnotation) PhenotypeId

func (pha *PhenotypeAnnotation) PhenotypeId() string

PhenotypeId returns the phenotype ID associated with the phenotype annotation.

func (*PhenotypeAnnotation) Reference

func (pha *PhenotypeAnnotation) Reference() string

Reference returns the reference associated with the phenotype annotation.

func (*PhenotypeAnnotation) StrainDescriptor

func (pha *PhenotypeAnnotation) StrainDescriptor() string

StrainDescriptor returns the strain descriptor associated with the PhenotypeAnnotation.

func (*PhenotypeAnnotation) StrainId

func (pha *PhenotypeAnnotation) StrainId() string

StrainId returns the strain ID associated with the phenotype annotation.

type PhenotypeAnnotationReader

type PhenotypeAnnotationReader struct {
	*xls.XlsReader
}

PhenotypeAnnotationReader is responsible for reading phenotype annotations from an Excel file

func NewPhenotypeAnnotationReader

func NewPhenotypeAnnotationReader(
	file, sheet string, date time.Time,
) (*PhenotypeAnnotationReader, error)

NewPhenotypeAnnotationReader creates a new reader for phenotype annotations from an Excel file. It initializes the reader for the specified sheet in the file and sets the creation date for the annotations. The function also sets up a data validator for structural validation of the annotations. If the function encounters an error while opening the file or reading the rows, it returns the reader object created up to that point along with the error.

Parameters: - file: The path to the Excel file to be read. - sheet: The name of the sheet within the Excel file which contains the phenotype annotations. - date: The creation date to be associated with the annotations being read.

func (*PhenotypeAnnotationReader) Value

Value retrieves the current phenotype annotation from the reader. Before calling Value, Next should be used to advance the reader to the desired row. Value decodes the current row into a PhenotypeAnnotation struct and performs data validation. If the validation fails or an error occurs while reading the columns, it returns an error.

Jump to

Keyboard shortcuts

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