This example shows how to open a uniprot data dump file and read the results into a list. Directly using the channel without converting to an array should be used for the Trembl data dump
()
| 12 | // into a list. Directly using the channel without converting to an array |
| 13 | // should be used for the Trembl data dump |
| 14 | func Example_basic() { |
| 15 | uniprotFile, _ := os.Open("data/uniprot_sprot_mini.xml.gz") |
| 16 | defer uniprotFile.Close() |
| 17 | unzippedFile, _ := gzip.NewReader(uniprotFile) |
| 18 | parser := uniprot.NewParser(unzippedFile) |
| 19 | entry, _ := parser.Next() |
| 20 | |
| 21 | fmt.Println(entry.Accession[0]) |
| 22 | // Output: P0C9F0 |
| 23 | } |