gff

package
v0.15.5 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(sequence poly.Sequence) []byte

Build takes an Annotated sequence and returns a byte array representing a gff to be written out.

Example
sequence := Read("../../data/ecoli-mg1655-short.gff")
gffBytes := Build(sequence)
reparsedSequence := Parse(gffBytes)

fmt.Println(reparsedSequence.Meta.Name)
Output:

U00096.3

func Parse

func Parse(file []byte) poly.Sequence

Parse Takes in a string representing a gffv3 file and parses it into an Sequence object.

Example
file, _ := ioutil.ReadFile("../../data/ecoli-mg1655-short.gff")
sequence := Parse(file)

fmt.Println(sequence.Meta.Name)
Output:

U00096.3

func Read

func Read(path string) poly.Sequence

Read takes in a filepath for a .gffv3 file and parses it into an Annotated poly.Sequence struct.

Example
sequence := Read("../../data/ecoli-mg1655-short.gff")
fmt.Println(sequence.Meta.Name)
Output:

U00096.3

func Write

func Write(sequence poly.Sequence, path string)

Write takes an poly.Sequence struct and a path string and writes out a gff to that path.

Example
tmpDataDir, err := ioutil.TempDir("", "data-*")
if err != nil {
	fmt.Println(err.Error())
}
defer os.RemoveAll(tmpDataDir)

sequence := Read("../../data/ecoli-mg1655-short.gff")

tmpGffFilePath := filepath.Join(tmpDataDir, "ecoli-mg1655-short.gff")
Write(sequence, tmpGffFilePath)

testSequence := Read(tmpGffFilePath)

fmt.Println(testSequence.Meta.Name)
Output:

U00096.3

Types

This section is empty.

Jump to

Keyboard shortcuts

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