bedGraph

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GoReadToChan

func GoReadToChan(filename string) <-chan BedGraph

GoReadToChan reads BedGraph entries from an input filename to a <-chan BedGraph.

func ReadToChan

func ReadToChan(file *fileio.EasyReader, data chan<- BedGraph, wg *sync.WaitGroup)

ReadToChan reads from a fileio.EasyReader to send BedGraph structs to a chan<- BedGraph.

func ToString

func ToString(b BedGraph) string

ToString converts a BedGraph struct into a bedGraph file format string. Useful for writing to files or printing.

func Write

func Write(filename string, records []BedGraph)

Write writes a slice of BedGraph structs to a specified filename.

func WriteToFileHandle

func WriteToFileHandle(file io.Writer, rec BedGraph)

WriteToFileHandle writes an input BedGraph struct to an io.Writer.

Types

type BedGraph

type BedGraph struct {
	Chrom      string
	ChromStart int
	ChromEnd   int
	DataValue  float64
}

BedGraph stores information about genomic regions, including their location and an associated float DataValue. As with Bed, coordinates are 0-based, half-open.

func NextBedGraph

func NextBedGraph(reader *fileio.EasyReader) (BedGraph, bool)

NextBedGraph returns a BedGraph struct from an input fileio.EasyReader. Returns a bool that is true when the reader is done.

func Read

func Read(filename string) []BedGraph

Read returns a slice of BedGraph structs from an input filename.

func (BedGraph) String

func (b BedGraph) String() string

String converts a BedGraph struct to a string.

Jump to

Keyboard shortcuts

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