Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Parse ¶
Parse parses a poly.Sequence JSON file and adds appropriate pointers to struct.
Example ¶
file, _ := ioutil.ReadFile("../../data/sample.json")
sequence := Parse(file)
fmt.Println(sequence.Meta.Source)
Output: Saccharomyces cerevisiae (baker's yeast)
func Read ¶
Read reads a poly.Sequence JSON file.
Example ¶
sequence := Read("../../data/sample.json")
fmt.Println(sequence.Meta.Source)
Output: Saccharomyces cerevisiae (baker's yeast)
func Write ¶
Write writes a poly.Sequence struct out to json.
Example ¶
tmpDataDir, err := ioutil.TempDir("", "data-*")
if err != nil {
fmt.Println(err.Error())
}
defer os.RemoveAll(tmpDataDir)
sequence := Read("../../data/sample.json")
tmpJSONFilePath := filepath.Join(tmpDataDir, "sample.json")
Write(sequence, tmpJSONFilePath)
testSequence := Read(tmpJSONFilePath)
fmt.Println(testSequence.Meta.Source)
Output: Saccharomyces cerevisiae (baker's yeast)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.