project

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package project implements reading and writing of PhyGeo project files.

A PhyGeo project is a tab-delimited file (TSV) used to store the different data files required by PhyGeo commands.

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 a dataset file in a project.

const (
	// File for the plate motion model
	// of the paleogeographic reconstruction.
	GeoMotion Dataset = "geomotion"

	// File for pixel prior probability values.
	PixPrior Dataset = "pixprior"

	// File for presence-absence points
	// of the taxa in the project.
	Points Dataset = "points"

	// File for geographic distribution ranges
	// of the taxa in the project.
	Ranges Dataset = "ranges"

	// File for the landscape pixel values
	// at different time stages.
	Landscape Dataset = "landscape"

	// File for phylogenetic trees.
	Trees Dataset = "trees"
)

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:

# phygeo project files
dataset	path
geomotion	geo-motion.tab
pixprior	pix-prior.tab
ranges	ranges.tab
landscape	landscape.tab
trees	trees.tab

func (*Project) Add

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

Add adds a filepath of 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