cleve

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: GPL-3.0 Imports: 28 Imported by: 0

README

cleve — sequencing run database

Where does the name come from?

The name cleve is a tribute to what many consider to be the first female librarian in Sweden, Cecilia Cleve.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LastRelease string = "v0.3.0" // x-release-please-version
View Source
var ValidRunStates = map[string]RunState{
	"new":      New,
	"ready":    Ready,
	"pending":  Pending,
	"complete": Complete,
	"error":    Error,
	"moved":    Moved,
	"unknown":  Unknown,
}
View Source
var Version string

Functions

func GetAPIDoc

func GetAPIDoc() []byte

func GetAssetFS

func GetAssetFS() (fs.FS, error)

func GetTemplateFS

func GetTemplateFS() (fs.FS, error)

func GetVersion added in v0.2.0

func GetVersion() string

func MostRecentSamplesheet

func MostRecentSamplesheet(path string) (string, error)

Find the SampleSheet with the most recent modification time in a directory. The file name must be on the format `SampleSheet*.csv`.

Types

type APIKey

type APIKey struct {
	Key     string
	User    string
	Created time.Time
}

func NewAPIKey

func NewAPIKey(user string) *APIKey

type Analysis

type Analysis struct {
	AnalysisId string           `bson:"analysis_id" json:"analysis_id"`
	Path       string           `bson:"path" json:"path"`
	State      RunState         `bson:"state" json:"state"`
	Summary    *AnalysisSummary `bson:"summary" json:"summary"`
}

func NewAnalysis

func NewAnalysis(path string, state RunState, data []byte) (Analysis, error)

type AnalysisSummary

type AnalysisSummary struct {
	RunID           string `bson:"run_id" json:"run_id"`
	Result          string `bson:"result" json:"result"`
	SoftwareVersion string `bson:"software_version" json:"software_version"`
	Workflows       []struct {
		WorkflowName      string `bson:"workflow_name" json:"workflow_name"`
		ReportAggregation string `bson:"report_aggregation" json:"report_aggregation"`
		Samples           []struct {
			SampleID          string `bson:"sample_id" json:"sample_id"`
			BclToFastq        string `bson:"bcl_to_fastq" json:"bcl_to_fastq"`
			OraCompression    string `bson:"ora_compression" json:"ora_compression"`
			SecondaryAnalysis string `bson:"secondary_analysis" json:"secondary_analysis"`
			ReportGeneration  string `bson:"report_generation" json:"report_generation"`
		} `bson:"samples" json:"samples"`
	} `bson:"workflows" json:"workflows"`
}

func ParseAnalysisSummary

func ParseAnalysisSummary(data []byte) (AnalysisSummary, error)

type CustomTime

type CustomTime time.Time

func (*CustomTime) Format

func (c *CustomTime) Format(layout string) string

func (CustomTime) Local

func (c CustomTime) Local() time.Time

func (CustomTime) MarshalBSONValue

func (c CustomTime) MarshalBSONValue() (bsontype.Type, []byte, error)

func (CustomTime) MarshalJSON

func (c CustomTime) MarshalJSON() ([]byte, error)

func (*CustomTime) String

func (c *CustomTime) String() string

func (*CustomTime) UnmarshalBSONValue

func (c *CustomTime) UnmarshalBSONValue(t bsontype.Type, b []byte) error

func (*CustomTime) UnmarshalXML

func (c *CustomTime) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type ImagingRecord

type ImagingRecord struct {
	Lane  int `bson:"lane" json:"lane"`
	Tile  int `bson:"tile" json:"tile"`
	Cycle int `bson:"cycle" json:"cycle"`
	Read  int `bson:"read" json:"read"`

	PercentOccupied float64 `bson:"percent_occupied" json:"percent_occupied"`
	PercentPF       float64 `bson:"percent_pf" json:"percent_pf"`
}

type ImagingTable

type ImagingTable struct {
	Records []ImagingRecord
}

func GenerateImagingTable

func GenerateImagingTable(runId string, runDirectory string) (*ImagingTable, error)

func ParseImagingTable

func ParseImagingTable(r *bufio.Reader) (*ImagingTable, error)

func (ImagingTable) LaneTileSummary

func (t ImagingTable) LaneTileSummary() []TileSummary

type ImagingTableParser

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

type InteropFile

type InteropFile interface {
	GetVersion() uint8
	GetRecordSize() uint8
}

type InteropHeader

type InteropHeader struct {
	Version    uint8
	RecordSize uint8
}

func (InteropHeader) GetRecordSize

func (h InteropHeader) GetRecordSize() uint8

func (InteropHeader) GetVersion

func (h InteropHeader) GetVersion() uint8

func (*InteropHeader) Parse

func (h *InteropHeader) Parse(r io.Reader) error

type InteropQC

type InteropQC struct {
	RunID          string          `bson:"run_id" json:"run_id"`
	InteropSummary *InteropSummary `bson:"summary" json:"summary"`
	TileSummary    []TileSummary   `bson:"imaging" json:"imaging"`
}

type InteropRecord

type InteropRecord interface {
	Type() string
}

type InteropRecordHolder

type InteropRecordHolder interface {
	Records() []InteropRecord
}

type InteropSummary

type InteropSummary struct {
	Version       string                   `bson:"version" json:"version"`
	RunDirectory  string                   `bson:"run_directory" json:"run_directory"`
	RunSummary    map[string]RunSummary    `bson:"run_summmary" json:"run_summary"`
	ReadSummaries map[string][]ReadSummary `bson:"read_summary" json:"read_summary"`
}

func GenerateSummary

func GenerateSummary(runDirectory string) (*InteropSummary, error)

func ParseInteropSummary

func ParseInteropSummary(r *bufio.Reader) (*InteropSummary, error)

type JsonFloat

type JsonFloat float64

func (JsonFloat) MarshalJSON

func (x JsonFloat) MarshalJSON() ([]byte, error)

type MeanSd

type MeanSd struct {
	Mean JsonFloat `bson:"mean" json:"mean"`
	SD   JsonFloat `bson:"sd" json:"sd"`
}

type NextSeqParameters

type NextSeqParameters struct {
	RunParametersVersion string `xml:"RunParametersVersion"`
	Setup                struct {
		SupportMultipleSurfacesInUI string `xml:"SupportMultipleSurfacesInUI"`
		ApplicationVersion          string `xml:"ApplicationVersion"`
		ApplicationName             string `xml:"ApplicationName"`
		NumTilesPerSwath            int    `xml:"NumTilesPerSwath"`
		NumSwaths                   int    `xml:"NumSwaths"`
		NumLanes                    int    `xml:"NumLanes"`
		Read1                       int    `xml:"Read1"`
		Read2                       int    `xml:"Read2"`
		Index1Read                  int    `xml:"Index1Read"`
		Index2Read                  int    `xml:"Index2Read"`
		SectionPerLane              int    `xml:"SectionPerLane"`
		LanePerSection              int    `xml:"LanePerSection"`
	} `xml:"Setup"`
	RunID                  string `xml:"RunID"`
	CopyServiceRunId       string `xml:"CopyServiceRunId"`
	InstrumentID           string `xml:"InstrumentID"`
	RunNumber              int    `xml:"RunNumber"`
	RTAVersion             string `xml:"RTAVersion"`
	SystemSuiteVersion     string `xml:"SystemSuiteVersion"`
	LocalRunManagerVersion string `xml:"LocalRunManagerVersion"`
	RecipeVersion          string `xml:"RecipeVersion"`
	FirmwareVersion        string `xml:"FirmwareVersion"`
	FlowCellRfidTag        struct {
		SerialNumber   string     `xml:"SerialNumber"`
		PartNumber     string     `xml:"PartNumber"`
		LotNumber      string     `xml:"LotNumber"`
		ExpirationDate CustomTime `xml:"ExpirationDate"`
	} `xml:"FlowCellRfidTag"`
	PR2BottleRfidTag struct {
		SerialNumber   string     `xml:"SerialNumber"`
		PartNumber     string     `xml:"PartNumber"`
		LotNumber      string     `xml:"LotNumber"`
		ExpirationDate CustomTime `xml:"ExpirationDate"`
	} `xml:"PR2BottleRfidTag"`
	ReagentKitRfidTag struct {
		SerialNumber   string     `xml:"SerialNumber"`
		PartNumber     string     `xml:"PartNumber"`
		LotNumber      string     `xml:"LotNumber"`
		ExpirationDate CustomTime `xml:"ExpirationDate"`
	} `xml:"ReagentKitRfidTag"`
	FlowCellSerial                        string `xml:"FlowCellSerial"`
	PR2BottleSerial                       string `xml:"PR2BottleSerial"`
	ReagentKitSerial                      string `xml:"ReagentKitSerial"`
	ReagentKitSerialWasEnteredInBaseSpace string `xml:"ReagentKitSerialWasEnteredInBaseSpace"`
	ExperimentName                        string `xml:"ExperimentName"`
	LibraryID                             string `xml:"LibraryID"`
	StateDescription                      string `xml:"StateDescription"`
	Chemistry                             string `xml:"Chemistry"`
	ChemistryVersion                      string `xml:"ChemistryVersion"`
	SelectedTiles                         struct {
		Tile []string `xml:"Tile,text"`
	} `xml:"SelectedTiles"`
	RunFolder                        string `xml:"RunFolder"`
	RTALogsFolder                    string `xml:"RTALogsFolder"`
	PreRunFolderRoot                 string `xml:"PreRunFolderRoot"`
	PreRunFolder                     string `xml:"PreRunFolder"`
	OutputFolder                     string `xml:"OutputFolder"`
	RecipeFolder                     string `xml:"RecipeFolder"`
	SimulationFolder                 string `xml:"SimulationFolder"`
	RunStartDate                     string `xml:"RunStartDate"`
	BaseSpaceUserName                string `xml:"BaseSpaceUserName"`
	LocalRunManagerUserName          string `xml:"LocalRunManagerUserName"`
	FocusMethod                      string `xml:"FocusMethod"`
	SurfaceToScan                    string `xml:"SurfaceToScan"`
	SaveFocusImages                  string `xml:"SaveFocusImages"`
	SaveScanImages                   string `xml:"SaveScanImages"`
	SelectiveSave                    string `xml:"SelectiveSave"`
	IsPairedEnd                      string `xml:"IsPairedEnd"`
	AnalysisWorkflowType             string `xml:"AnalysisWorkflowType"`
	CustomReadOnePrimer              string `xml:"CustomReadOnePrimer"`
	CustomReadTwoPrimer              string `xml:"CustomReadTwoPrimer"`
	CustomIndexOnePrimer             string `xml:"CustomIndexOnePrimer"`
	CustomIndexTwoPrimer             string `xml:"CustomIndexTwoPrimer"`
	UsesCustomReadOnePrimer          string `xml:"UsesCustomReadOnePrimer"`
	UsesCustomReadTwoPrimer          string `xml:"UsesCustomReadTwoPrimer"`
	UsesCustomIndexPrimer            string `xml:"UsesCustomIndexPrimer"`
	UsesCustomIndexTwoPrimer         string `xml:"UsesCustomIndexTwoPrimer"`
	BaseSpaceRunId                   string `xml:"BaseSpaceRunId"`
	LocalRunManagerRunId             string `xml:"LocalRunManagerRunId"`
	RunSetupType                     string `xml:"RunSetupType"`
	RunMode                          string `xml:"RunMode"`
	ComputerName                     string `xml:"ComputerName"`
	SequencingStarted                string `xml:"SequencingStarted"`
	PlannedRead1Cycles               string `xml:"PlannedRead1Cycles"`
	PlannedRead2Cycles               string `xml:"PlannedRead2Cycles"`
	PlannedIndex1ReadCycles          string `xml:"PlannedIndex1ReadCycles"`
	PlannedIndex2ReadCycles          string `xml:"PlannedIndex2ReadCycles"`
	IsRehyb                          string `xml:"IsRehyb"`
	PurgeConsumables                 string `xml:"PurgeConsumables"`
	MaxCyclesSupportedByReagentKit   string `xml:"MaxCyclesSupportedByReagentKit"`
	ExtraCyclesSupportedByReagentKit string `xml:"ExtraCyclesSupportedByReagentKit"`
	ModuleName                       string `xml:"ModuleName"`
	ModuleVersion                    string `xml:"ModuleVersion"`
	IncludedFile                     string `xml:"IncludedFile"`
}

func ParseNextSeqRunParameters

func ParseNextSeqRunParameters(d []byte) NextSeqParameters

func (NextSeqParameters) Flowcell

func (p NextSeqParameters) Flowcell() string

func (NextSeqParameters) GetExperimentName

func (p NextSeqParameters) GetExperimentName() string

func (NextSeqParameters) GetRunID

func (p NextSeqParameters) GetRunID() string

func (NextSeqParameters) IsValid

func (p NextSeqParameters) IsValid() bool

func (NextSeqParameters) Platform

func (p NextSeqParameters) Platform() string

type NovaSeqParameters

type NovaSeqParameters struct {
	Side                   string `xml:"Side"`
	Application            string `xml:"Application"`
	SystemSuiteVersion     string `xml:"SystemSuiteVersion"`
	OutputFolder           string `xml:"OutputFolder"`
	CloudUploadMode        string `xml:"CloudUploadMode"`
	RunSetupMode           string `xml:"RunSetupMode"`
	SecondaryAnalysisMode  string `xml:"SecondaryAnalysisMode"`
	InstrumentType         string `xml:"InstrumentType"`
	InstrumentSerialNumber string `xml:"InstrumentSerialNumber"`
	RunId                  string `xml:"RunId"`
	RunCounter             int    `xml:"RunCounter"`
	RecipeName             string `xml:"RecipeName"`
	RecipeVersion          string `xml:"RecipeVersion"`
	ExperimentName         string `xml:"ExperimentName"`
	FlowCellName           string `xml:"FlowCellName"`
	FlowCellType           string `xml:"FlowCellType"`
	ConsumableInfo         []struct {
		SerialNumber   string     `xml:"SerialNumber"`
		LotNumber      string     `xml:"LotNumber"`
		PartNumber     string     `xml:"PartNumber"`
		ExpirationDate CustomTime `xml:"ExpirationDate"`
		Type           string     `xml:"Type"`
		Mode           string     `xml:"Mode"`
		Version        string     `xml:"Version"`
		Name           string     `xml:"Name"`
	} `xml:"ConsumableInfo>ConsumableInfo"`
	PlannedReads struct {
		Read []struct {
			ReadName string `xml:"ReadName,attr"`
			Cycles   int    `xml:"Cycles,attr"`
		} `xml:"Read"`
	} `xml:"PlannedReads"`
	SecondaryAnalysisInfo struct {
		SecondaryAnalysisPlatformVersion string   `xml:"SecondaryAnalysisPlatformVersion"`
		SecondaryAnalysisWorkflow        []string `xml:"SecondaryAnalysisWorkflow>string"`
	} `xml:"SecondaryAnalysisInfo>SecondaryAnalysisInfo"`
	DisableBclCopy string `xml:"DisableBclCopy"`
}

func ParseNovaSeqRunParameters

func ParseNovaSeqRunParameters(d []byte) NovaSeqParameters

func (NovaSeqParameters) Flowcell

func (p NovaSeqParameters) Flowcell() string

func (NovaSeqParameters) GetExperimentName

func (p NovaSeqParameters) GetExperimentName() string

func (NovaSeqParameters) GetRunID

func (p NovaSeqParameters) GetRunID() string

func (NovaSeqParameters) IsValid

func (p NovaSeqParameters) IsValid() bool

func (NovaSeqParameters) Platform

func (p NovaSeqParameters) Platform() string

type PaginationFilter added in v0.3.0

type PaginationFilter struct {
	Page     int `form:"page,default=1"`
	PageSize int `form:"page_size,default=10"`
}

Pagination filtering.

func (PaginationFilter) Validate added in v0.3.0

func (f PaginationFilter) Validate() error

type PaginationMetadata

type PaginationMetadata struct {
	TotalCount int `bson:"total_count" json:"total_count"`
	Count      int `bson:"count" json:"count"`
	Page       int `bson:"page" json:"page"`
	PageSize   int `bson:"page_size" json:"page_size"`
	TotalPages int `bson:"total_pages" json:"total_pages"`
}

type Pipeline added in v0.3.0

type Pipeline struct {
	Name    string `bson:"name" json:"name"`
	Version string `bson:"version" json:"version"`
	URL     string `bson:"url" json:"url"`
}

Pipeline represents an analysis pipeline.

type Platform

type Platform struct {
	Name         string `bson:"name" json:"name" binding:"required"`
	SerialTag    string `bson:"serial_tag" json:"serial_tag" binding:"required"`
	SerialPrefix string `bson:"serial_prefix" json:"serial_prefix" binding:"required"`
	ReadyMarker  string `bson:"ready_marker" json:"ready_marker"`
}

func NewPlatform

func NewPlatform(name, serialTag, serialPrefix, readyMarker string) *Platform

type QcFilter

type QcFilter struct {
	RunID     string
	Platform  string
	StartDate time.Time
	EndDate   time.Time
	PaginationFilter
}

QC filtering.

func (QcFilter) UrlParams

func (f QcFilter) UrlParams() string

type QcResult

type QcResult struct {
	PaginationMetadata `bson:"metadata" json:"metadata"`
	Qc                 []QcResultItem `bson:"qc" json:"qc"`
}

type QcResultItem

type QcResultItem struct {
	InteropQC `bson:",inline" json:",inline"`
	Run       Run `bson:"run" json:"run"`
}

type Range

type Range struct {
	Start int `bson:"start" json:"start"`
	End   int `bson:"end" json:"end"`
}

type ReadConfig

type ReadConfig struct {
	ReadLengths map[int]int
}

func (ReadConfig) CycleToRead

func (r ReadConfig) CycleToRead(cycle int) int

type ReadSummary

type ReadSummary struct {
	Lane             int       `bson:"lane" json:"lane"`
	Tiles            int       `bson:"tiles" json:"tiles"`
	Density          MeanSd    `bson:"density" json:"density"`
	ClusterPF        MeanSd    `bson:"cluster_pf" json:"cluster_pf"`
	PhasingRate      JsonFloat `bson:"phasing_rate" json:"phasing_rate"`
	PrephasingRate   JsonFloat `bson:"prephasing_rate" json:"prephasing_rate"`
	PhasingSlope     JsonFloat `bson:"phasing_slope" json:"phasing_slope"`
	PhasingOffset    JsonFloat `bson:"phasing_offset" json:"phasing_offset"`
	PrephasingSlope  JsonFloat `bson:"prephasing_slope" json:"prephasing_slope"`
	PrephasingOffset JsonFloat `bson:"prephasing_offset" json:"prephasing_offset"`
	Reads            int       `bson:"reads" json:"reads"`
	ReadsPF          int       `bson:"reads_pf" json:"reads_pf"`
	PercentQ30       JsonFloat `bson:"percent_q30" json:"percent_q30"`
	Yield            int       `bson:"yield" json:"yield"`
	CyclesError      Range     `bson:"cycles_error" json:"cycles_error"`
	PercentAligned   MeanSd    `bson:"percent_aligned" json:"percent_aligned"`
	Error            MeanSd    `bson:"error" json:"error"`
	Error35          MeanSd    `bson:"error35" json:"error35"`
	Error75          MeanSd    `bson:"error75" json:"error75"`
	Error100         MeanSd    `bson:"error100" json:"error100"`
	PercentOccupied  MeanSd    `bson:"percent_occupied" json:"percent_occupied"`
	IntensityC1      MeanSd    `bson:"intensity_c1" json:"intensity_c1"`
}

func ParseReadSummary

func ParseReadSummary(r *bufio.Reader) (string, []ReadSummary, error)

type Run

type Run struct {
	ID               primitive.ObjectID `bson:"_id" json:"id"`
	RunID            string             `bson:"run_id" json:"run_id"`
	ExperimentName   string             `bson:"experiment_name" json:"experiment_name"`
	Path             string             `bson:"path" json:"path"`
	Platform         string             `bson:"platform" json:"platform"`
	Created          time.Time          `bson:"created" json:"created"`
	StateHistory     []TimedRunState    `bson:"state_history" json:"state_history"`
	SampleSheet      *SampleSheetInfo   `bson:"samplesheet,omitempty" json:"samplesheet"`
	SampleSheetFiles []SampleSheetInfo  `bson:"samplesheets,omitempty" json:"samplesheets"`
	RunParameters    RunParameters      `bson:"run_parameters,omitempty" json:"run_parameters,omitempty"`
	RunInfo          RunInfo            `bson:"run_info,omitempty" json:"run_info,omitempty"`
	Analysis         []*Analysis        `bson:"analysis,omitempty" json:"analysis,omitempty"`
	AnalysisCount    int32              `bson:"analysis_count" json:"analysis_count"`
}

func (*Run) UnmarshalBSON

func (r *Run) UnmarshalBSON(data []byte) error

type RunCompletionStatus

type RunCompletionStatus struct {
	Status  string
	Message string
}

func ParseRunCompletionStatus

func ParseRunCompletionStatus(data []byte) (RunCompletionStatus, error)

func ReadRunCompletionStatus

func ReadRunCompletionStatus(filename string) (RunCompletionStatus, error)

type RunFilter

type RunFilter struct {
	RunID            string    `form:"run_id"`
	RunIdQuery       string    `form:"run_id_query"`
	Brief            bool      `form:"brief"`
	Platform         string    `form:"platform"`
	State            string    `form:"state"`
	From             time.Time `form:"from"`
	To               time.Time `form:"to"`
	PaginationFilter `form:",inline"`
}

Run filtering.

func (RunFilter) UrlParams

func (f RunFilter) UrlParams() string

Convert a run filter to URL query parameters.

type RunInfo

type RunInfo struct {
	Version int `xml:"Version,attr" bson:"version" json:"version"`
	Run     struct {
		RunID      string     `xml:"Id,attr" bson:"run_id" json:"run_id"`
		Number     int        `xml:"Number,attr" bson:"number" json:"number"`
		Flowcell   string     `xml:"Flowcell" bson:"flowcell" json:"flowcell"`
		Instrument string     `xml:"Instrument" bson:"instrument" json:"instrument"`
		Date       CustomTime `xml:"Date" bson:"date" json:"date"`
		Reads      struct {
			Read []struct {
				Number              int    `xml:"Number,attr" bson:"number" json:"number"`
				NumCycles           int    `xml:"NumCycles,attr" bson:"num_cycles" json:"num_cycles"`
				IsIndexedRead       string `xml:"IsIndexedRead,attr" bson:"is_indexed_read" json:"is_indexed_read"`
				IsReverseComplement string `xml:"IsReverseComplement,attr" bson:"is_reverse_complement" json:"is_reverse_complement"`
			} `xml:"Read" bson:"read" json:"read"`
		} `xml:"Reads" bson:"reads" json:"reads"`
		FlowcellLayout struct {
			LaneCount      int `xml:"LaneCount,attr" bson:"lane_count" json:"lane_count"`
			SurfaceCount   int `xml:"SurfaceCount,attr" bson:"surface_count" json:"surface_count"`
			SwathCount     int `xml:"SwathCount,attr" bson:"swath_count" json:"swath_count"`
			TileCount      int `xml:"TileCount,attr" bson:"tile_count" json:"tile_count"`
			SectionPerLane int `xml:"SectionPerLane,attr,omitempty" bson:"section_per_lane,omitempty" json:"section_per_lane,omitempty"`
			LanePerSection int `xml:"LanePerSection,attr,omitempty" bson:"lane_per_section,omitempty" json:"lane_per_section,omitempty"`
			TileSet        struct {
				TileNamingConvention string   `xml:"TileNamingConvention,attr" bson:"tile_naming_convention" json:"tile_naming_convention"`
				Tiles                []string `xml:"Tiles>Tile" bson:"tiles" json:"tiles"`
			} `xml:"TileSet" bson:"tileset" json:"tileset"`
		} `xml:"FlowcellLayout" bson:"flowcell_layout" json:"flowcell_layout"`
		ImageDimensions struct {
			Width  int `xml:"Width,attr" bson:"width" json:"width"`
			Height int `xml:"Height,attr" bson:"height" json:"height"`
		} `xml:"ImageDimensions" bson:"image_dimensions" json:"image_dimensions"`
		ImageChannels []string `xml:"ImageChannels>Name" bson:"image_channels" json:"image_channels"`
	} `xml:"Run" bson:"run" json:"run"`
}

func ParseRunInfo

func ParseRunInfo(data []byte) (RunInfo, error)

type RunParameters

type RunParameters interface {
	IsValid() bool
	GetExperimentName() string
	GetRunID() string
	Platform() string
	Flowcell() string
}

func ParseRunParameters

func ParseRunParameters(paramsData []byte) (RunParameters, error)

type RunResult

type RunResult struct {
	PaginationMetadata `bson:"metadata" json:"metadata"`
	Runs               []*Run `bson:"runs" json:"runs"`
}

type RunState

type RunState int
const (
	New RunState = iota
	Ready
	Pending
	Complete
	Error
	Moved
	Unknown
)

func (RunState) MarshalBSONValue

func (r RunState) MarshalBSONValue() (bsontype.Type, []byte, error)

func (RunState) MarshalJSON

func (r RunState) MarshalJSON() ([]byte, error)

func (*RunState) Set

func (s *RunState) Set(v string) error

func (RunState) String

func (s RunState) String() string

func (*RunState) Type

func (s *RunState) Type() string

func (*RunState) UnmarshalBSONValue

func (r *RunState) UnmarshalBSONValue(t bsontype.Type, data []byte) error

func (*RunState) UnmarshalJSON

func (r *RunState) UnmarshalJSON(data []byte) error

type RunSummary

type RunSummary struct {
	Level           string    `bson:"level" json:"level"`
	Yield           int       `bson:"yield" json:"yield"`
	ProjectedYield  int       `bson:"projected_yield" json:"projected_yield"`
	PercentAligned  JsonFloat `bson:"percent_aligned" json:"percent_aligned"`
	ErrorRate       JsonFloat `bson:"error_rate" json:"error_rate"`
	IntensityC1     JsonFloat `bson:"intensity_c1" json:"intensity_c1"`
	PercentQ30      JsonFloat `bson:"percent_q30" json:"percent_q30"`
	PercentOccupied JsonFloat `bson:"percent_occupied" json:"percent_occupied"`
}

type RunningSummary

type RunningSummary[T uint32 | uint64 | float32 | float64] struct {
	Sum T

	Mean float64
	// contains filtered or unexported fields
}

func NewRunningSummary

func NewRunningSummary[T uint32 | uint64 | float32 | float64](weighted bool) *RunningSummary[T]

func (*RunningSummary[T]) Push

func (v *RunningSummary[T]) Push(x T, weight ...T) error

func (RunningSummary[T]) SD

func (v RunningSummary[T]) SD() float64

func (RunningSummary[T]) Var

func (v RunningSummary[T]) Var() float64

type Sample added in v0.3.0

type Sample struct {
	// Sample name. If missing it should be set to the sample ID.
	Name string `bson:"name" json:"name"`
	// Sample ID as listed in the samplesheet.
	Id string `bson:"id" json:"id"`
	// Paths to fastq files related to the sample.
	Fastq []string `bson:"fastq" json:"fastq"`
	// Analyses associated with the sample.
	Analyses []*SampleAnalysis `bson:"analyses" json:"analyses"`
}

Sample represents a sequenced sample with associated analyses.

type SampleAnalysis added in v0.3.0

type SampleAnalysis struct {
	Pipeline `bson:"pipeline" json:"pipeline"`
	Results  []SampleAnalysisResult `bson:"path" json:"path"`
}

SampleAnalysis represents a collection of analysis results from an analysis pipeline.

type SampleAnalysisResult added in v0.3.0

type SampleAnalysisResult struct {
	Type        string   `bson:"type" json:"type"`
	Description string   `bson:"description" json:"description"`
	Path        []string `bson:"path" json:"path"`
}

SampleAnalysisResult is a specific result from an analysis pipeline.

type SampleFilter added in v0.3.0

type SampleFilter struct {
	Name             string `form:"sample_name"`
	Id               string `form:"sample_id"`
	RunId            string `form:"run_id"`
	Analysis         string `form:"analysis"`
	PaginationFilter `form:",inline"`
}

Sample filtering.

func (SampleFilter) UrlParams added in v0.3.0

func (f SampleFilter) UrlParams() string

Convert a sample filter to URL query parameters.

type SampleResult added in v0.3.0

type SampleResult struct {
	PaginationMetadata `bson:"metadata" json:"metadata"`
	Samples            []Sample `bson:"samples" json:"samples"`
}

type SampleSheet

type SampleSheet struct {
	RunID    *string           `bson:"run_id" json:"run_id"`
	UUID     *uuid.UUID        `bson:"uuid" json:"uuid"`
	Files    []SampleSheetInfo `bson:"files" json:"files"`
	Sections []Section         `bson:"sections" json:"sections"`
}

func ParseSampleSheet

func ParseSampleSheet(r *bufio.Reader) (SampleSheet, error)

func ReadSampleSheet

func ReadSampleSheet(filename string) (SampleSheet, error)

func (SampleSheet) IsValid

func (s SampleSheet) IsValid() bool

func (SampleSheet) LastModified added in v0.3.0

func (s SampleSheet) LastModified() (time.Time, error)

func (SampleSheet) Merge added in v0.3.0

func (s SampleSheet) Merge(other *SampleSheet) (*SampleSheet, error)

Merge two sample sheets. Merging is only allowed if the UUIDs of the sample sheets are the same, and the run IDs are the same. An exception to this is if the run ID of the current sample sheet is nil. If the run ID in the current sample sheet is non-nil and different from the other sample sheet, or if the UUIDs are different, an error is returned.

func (SampleSheet) Section

func (s SampleSheet) Section(name string) *Section

func (SampleSheet) Version

func (s SampleSheet) Version() int

type SampleSheetInfo

type SampleSheetInfo struct {
	Path             string    `bson:"path" json:"path"`
	ModificationTime time.Time `bson:"modification_time" json:"modification_time"`
}

type Section

type Section struct {
	Name string      `bson:"name" json:"name"`
	Type SectionType `bson:"type" json:"type"`
	Rows [][]string  `bson:"rows" json:"rows"`
}

func (Section) Get

func (s Section) Get(name string, index ...int) (string, error)

func (Section) GetColumn

func (s Section) GetColumn(name string) ([]string, error)

func (Section) GetFloat

func (s Section) GetFloat(name string, index ...int) (float64, error)

func (Section) GetInt

func (s Section) GetInt(name string, index ...int) (int, error)

type SectionType

type SectionType int
const (
	UnknownSection SectionType = iota
	SettingsSection
	DataSection
)

func (SectionType) MarshalBSONValue

func (s SectionType) MarshalBSONValue() (bsontype.Type, []byte, error)

func (SectionType) MarshalJSON

func (s SectionType) MarshalJSON() ([]byte, error)

func (SectionType) String

func (s SectionType) String() string

func (*SectionType) UnmarshalBSONValue

func (s *SectionType) UnmarshalBSONValue(t bsontype.Type, b []byte) error

type StatsMap1

type StatsMap1 = map[int]*RunningSummary[float64]

type StatsMap2

type StatsMap2 = map[int]map[int]*RunningSummary[float64]

type StatsMap3

type StatsMap3 = map[int]map[int]map[int]*RunningSummary[float64]

type Tile

type Tile interface {
	Parse(io.Reader) error
}

type Tile16

type Tile16 uint16

func (*Tile16) Parse

func (t *Tile16) Parse(r io.Reader) error

type Tile32

type Tile32 uint32

func (*Tile32) Parse

func (t *Tile32) Parse(r io.Reader) error

type TileSummary

type TileSummary struct {
	Lane            int     `bson:"lane" json:"lane"`
	Tile            int     `bson:"tile" json:"tile"`
	PercentOccupied float64 `bson:"percent_occupied" json:"percent_occupied"`
	PercentPF       float64 `bson:"percent_pf" json:"percent_pf"`
}

type TimedRunState

type TimedRunState struct {
	State RunState  `bson:"state" json:"state"`
	Time  time.Time `bson:"time" json:"time"`
}

type UpdateResult

type UpdateResult = mongo.UpdateResult

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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