project

package
v0.0.0-...-c89d2f7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dataset

type Dataset string

Dataset is a keyword to identify the type of dataset file in a project.

const (
	// File with an hierarchy of homologues.
	Homologues Dataset = "homologues"

	// File for specimen character observations.
	Observations Dataset = "observations"
)

Valid dataset types

type Project

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

A Project represents a collection of paths for particular datasets.

func New

func New() *Project

New creates a new empty project.

func Read

func Read(name string) (*Project, error)

Read reads a project file from a TSV file.

The TSV must contain the following fields:

  • dataset, for the kind of file
  • path, for the path of the file

Here is an example file:

# phydata project files
dataset	path
homologues	homologues.tab
observations	observations.tab

func (*Project) Add

func (p *Project) Add(set Dataset, path string) string

Add adds a filepath to a dataset to a given project. It returns the previous value for the dataset.

func (*Project) Path

func (p *Project) Path(set Dataset) string

Path returns the path of the given dataset.

func (*Project) Sets

func (p *Project) Sets() []Dataset

Sets returns the datasets defined on a project.

func (*Project) Write

func (p *Project) Write(name string) (err error)

Write writes a project into a file with the indicated name.

Jump to

Keyboard shortcuts

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