io

package
v0.31.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package io provides utilities for reading and writing sequence data.

Example
package main

import (
	"github.com/bebop/poly/io/fasta"
	"github.com/bebop/poly/io/genbank"
	"github.com/bebop/poly/io/gff"
	"github.com/bebop/poly/io/polyjson"
)

func main() {
	// Poly can take in basic gff, gbk, fasta, and JSON.
	// We call the json package "pson" (poly JSON) to prevent namespace collision with Go's standard json package.

	gffInput, _ := gff.Read("../data/ecoli-mg1655-short.gff")
	gbkInput, _ := genbank.Read("../data/puc19.gbk")
	fastaInput, _ := fasta.Read("fasta/data/base.fasta")
	jsonInput, _ := polyjson.Read("../data/cat.json")

	// Poly can also output these file formats. Every file format has a corresponding Write function.
	_ = gff.Write(gffInput, "test.gff")
	_ = genbank.Write(gbkInput, "test.gbk")
	_ = fasta.Write(fastaInput, "test.fasta")
	_ = polyjson.Write(jsonInput, "test.json")

	// Extra tips:

	// 1. All of these file formats can be read and written in JSON format using their native schemas.
	// 2. If you want to convert from one format to another (e.g. genbank to polyjson), you can easily do so with a for-loop and some field mapping.
	// 3. Every file format is unique but they all share a common interface so you can use them with almost every native function in Poly.
}
Output:

Directories

Path Synopsis
Package fasta contains fasta parsers and writers.
Package fasta contains fasta parsers and writers.
Package fastq contains fastq parsers and writers.
Package fastq contains fastq parsers and writers.
Package genbank provides genbank parsers and writers.
Package genbank provides genbank parsers and writers.
Package gff provides gff parsers and writers.
Package gff provides gff parsers and writers.
Package pileup contains pileup parsers and writers.
Package pileup contains pileup parsers and writers.
Package polyjson provides utilities to read and write poly.Sequence structs as JSON.
Package polyjson provides utilities to read and write poly.Sequence structs as JSON.
Package rebase contains a rebase parser for rebase data dump #31.
Package rebase contains a rebase parser for rebase data dump #31.
Package slow5 contains slow5 parsers and writers.
Package slow5 contains slow5 parsers and writers.
Package uniprot provides an XML parser for Uniprot data dumps.
Package uniprot provides an XML parser for Uniprot data dumps.

Jump to

Keyboard shortcuts

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