czid

package
v0.0.0-...-35b150b Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FASTQFileType             inputFileType = "fastq"
	PrimerBedFileType         inputFileType = "primer_bed"
	ReferenceSequenceFileType inputFileType = "reference_sequence"
)

Variables

View Source
var DefaultClient = &Client{
	auth0:      auth0.DefaultClient,
	httpClient: http.DefaultClient,
}

Functions

func GeoSearchSuggestions

func GeoSearchSuggestions(samplesMetadata *SamplesMetadata) error

func IsInput

func IsInput(path string) bool

func IsR1

func IsR1(path string) bool

func IsR2

func IsR2(path string) bool

func SamplesFromDir

func SamplesFromDir(directory string, verbose bool) (map[string]SampleFiles, error)

func StripLaneNumber

func StripLaneNumber(path string) string

func ToSampleName

func ToSampleName(path string) string

func UploadSamplesFlow

func UploadSamplesFlow(
	sampleFiles map[string]SampleFiles,
	stringMetadata map[string]string,
	projectName string,
	metadataCSVPath string,
	workflow string,
	sampleOptions SampleOptions,
	disableBuffer bool,
) error

Types

type Client

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

func (*Client) CreateSamples

func (c *Client) CreateSamples(
	projectID int,
	sampleFiles map[string]SampleFiles,
	samplesMetadata SamplesMetadata,
	workflow string,
	sampleOptions SampleOptions,
) ([]createSamplesResSample, error)

CreateSamples creates samples on the back end and returns the necessary information to upload their files

func (*Client) GetGeoSearchSuggestion

func (c *Client) GetGeoSearchSuggestion(queryStr string, isHuman bool) (GeoSearchSuggestion, error)

func (*Client) GetMetadataForHostGenome

func (c *Client) GetMetadataForHostGenome(hostGenome string) ([]MetadataField, error)

func (*Client) GetProjectID

func (c *Client) GetProjectID(projectName string) (int, error)

func (*Client) GetTemplateCSV

func (c *Client) GetTemplateCSV(sampleNames []string, hostGenome string) (*csv.Reader, error)

func (*Client) GetUploadCredentials

func (c *Client) GetUploadCredentials(sampleID int) (aws.Credentials, error)

func (*Client) MarkSampleUploaded

func (c *Client) MarkSampleUploaded(sampleId int, sampleName string) error

func (*Client) ValidateSampleNames

func (c *Client) ValidateSampleNames(sampleNames []string, projectID int) ([]string, error)

func (*Client) ValidateSamplesMetadata

func (c *Client) ValidateSamplesMetadata(projectID int, samplesMetadata SamplesMetadata) error

type CreateSamplesReqSample

type CreateSamplesReqSample struct {
	HostGenomeName      string                      `json:"host_genome_name"`
	InputFileAttributes []createSamplesReqInputFile `json:"input_files_attributes"`
	Name                string                      `json:"name"`
	ProjectID           int                         `json:"project_id"`
	Status              string                      `json:"status"`
	Workflows           []string                    `json:"workflows"`
	Technology          string                      `json:"technology"`
	WetlabProtocol      string                      `json:"wetlab_protocol"`
	MedakaModel         *string                     `json:"medaka_model,omitempty"`
	ClearLabs           *bool                       `json:"clearlabs,omitempty"`
	ReferenceAccession  *string                     `json:"accession_id,omitempty"`
	ReferenceFasta      *string                     `json:"ref_fasta,omitempty"`
	PrimerBed           *string                     `json:"primer_bed,omitempty"`
}

type Example

type Example struct {
	All []string `json:"all"`
	One []string `json:"1"`
}

type GeoSearchSuggestion

type GeoSearchSuggestion struct {
	Name            string `json:"name"`
	GeoLevel        string `json:"geo_level"`
	CountryName     string `json:"country_name"`
	StateName       string `json:"state_name"`
	SubdivisionName string `json:"subdivision_name"`
	CityName        string `json:"city_name"`
	// Lat             float64 `json:"lat"`
	// Lng             float64 `json:"lng"`
	CountryCode string `json:"country_code"`
}

func (GeoSearchSuggestion) String

func (g GeoSearchSuggestion) String() string

type GetGeoSearchSuggestionReq

type GetGeoSearchSuggestionReq struct{}

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient interface

type Metadata

type Metadata struct {
	HostGenome string

	CollectionLocation GeoSearchSuggestion
	// contains filtered or unexported fields
}

func NewMetadata

func NewMetadata(m map[string]string) Metadata

func (Metadata) Fuse

func (a Metadata) Fuse(b Metadata) Metadata

func (Metadata) MarshalJSON

func (m Metadata) MarshalJSON() ([]byte, error)

type MetadataField

type MetadataField struct {
	Name        string
	Description string
	Example     Example
}

type SampleFiles

type SampleFiles struct {
	R1             []string
	R2             []string
	Single         []string
	ReferenceFasta []string
	PrimerBed      []string
}

type SampleOptions

type SampleOptions struct {
	Technology         string
	WetlabProtocol     string
	MedakaModel        string
	ClearLabs          bool
	ReferenceAccession string
	ReferenceFasta     string
	PrimerBed          string
}

type SamplesMetadata

type SamplesMetadata = map[string]Metadata

func CSVMetadata

func CSVMetadata(csvpath string) (SamplesMetadata, error)

func GetCombinedMetadata

func GetCombinedMetadata(sampleFiles map[string]SampleFiles, stringMetadata map[string]string, metadataCSVPath string) (SamplesMetadata, error)

GetCombinedMetadata parses the metadata CSV, validates it, then fuses it with flag-based metadata

type UploadInfo

type UploadInfo struct {
	MultipartUploadId *string `json:"multipart_upload_id"`
	S3Path            string  `json:"s3_path"`
}

UploadInfo stores the data necessary to upload a file to s3

Jump to

Keyboard shortcuts

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