bíogo/hts
bíogo/hts: high throughput sequence handling for the Go language - Published in JOSS (2017)
Science Score: 95.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 5 DOI reference(s) in README and JOSS metadata -
○Academic publication links
-
✓Committers with academic emails
1 of 9 committers (11.1%) from academic institutions -
○Institutional organization owner
-
✓JOSS paper metadata
Published in Journal of Open Source Software
Repository
biogo high throughput sequencing repository
Basic Info
Statistics
- Stars: 128
- Watchers: 9
- Forks: 41
- Open Issues: 7
- Releases: 1
Metadata Files
README.md

HTS
Installation
$ go get github.com/biogo/hts/...
Overview
SAM and BAM handling for the Go language.
bíogo/hts provides a Go native implementation of the SAM specification for SAM and BAM alignment formats commonly used for representation of high throughput genomic data, the BAI, CSI and tabix indexing formats, and the BGZF blocked compression format. The bíogo/hts packages perform parallelized read and write operations and are able to cache recent reads according to user-specified caching methods. The bíogo/hts APIs have been constructed to provide a consistent interface to sequence alignment data and the underlying compression system in order to aid ease of use and tool development.
Example usage
The following code implements the equivalent of samtools view -c -f n -F N file.bam.
``` package main
import ( "flag" "fmt" "io" "log" "os"
"github.com/biogo/hts/bam"
"github.com/biogo/hts/bgzf"
"github.com/biogo/hts/sam"
)
var ( require = flag.Int("f", 0, "required flags") exclude = flag.Int("F", 0, "excluded flags") file = flag.String("file", "", "input file (empty for stdin)") conc = flag.Int("threads", 0, "number of threads to use (0 = auto)") help = flag.Bool("help", false, "display help") )
const maxFlag = int(^sam.Flags(0))
func main() { flag.Parse() if *help { flag.Usage() os.Exit(0) }
if *require > maxFlag {
flag.Usage()
log.Fatal("required flags (f) out of range")
}
reqFlag := sam.Flags(*require)
if *exclude > maxFlag {
flag.Usage()
log.Fatal("excluded flags (F) out of range")
}
excFlag := sam.Flags(*exclude)
var r io.Reader
if *file == "" {
r = os.Stdin
} else {
f, err := os.Open(*file)
if err != nil {
log.Fatalf("could not open file %q:", err)
}
defer f.Close()
ok, err := bgzf.HasEOF(f)
if err != nil {
log.Fatalf("could not open file %q:", err)
}
if !ok {
log.Printf("file %q has no bgzf magic block: may be truncated", *file)
}
r = f
}
b, err := bam.NewReader(r, *conc)
if err != nil {
log.Fatalf("could not read bam:", err)
}
defer b.Close()
// We only need flags, so skip variable length data.
b.Omit(bam.AllVariableLengthData)
var n int
for {
rec, err := b.Read()
if err == io.EOF {
break
}
if err != nil {
log.Fatalf("error reading bam: %v", err)
}
if rec.Flags&reqFlag == reqFlag && rec.Flags&excFlag == 0 {
n++
}
}
fmt.Println(n)
} ```
Getting help
Help or similar requests are preferred on the biogo-user Google Group.
https://groups.google.com/forum/#!forum/biogo-user
Contributing
If you find any bugs, feel free to file an issue on the github issue tracker. Pull requests are welcome, though if they involve changes to API or addition of features, please first open a discussion at the biogo-dev Google Group.
https://groups.google.com/forum/#!forum/biogo-dev
Citing
If you use bíogo/hts, please cite Kortschak, Pedersen and Adelson "bíogo/hts: high throughput sequence handling for the Go language", doi:10.21105/joss.00168.
Library Structure and Coding Style
The coding style should be aligned with normal Go idioms as represented in the Go core libraries.
Copyright and License
Copyright ©2011-2013 The bíogo Authors except where otherwise noted. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
The bíogo logo is derived from Bitstream Charter, Copyright ©1989-1992 Bitstream Inc., Cambridge, MA.
BITSTREAM CHARTER is a registered trademark of Bitstream Inc.
Owner
- Name: bíogo
- Login: biogo
- Kind: organization
- Repositories: 14
- Profile: https://github.com/biogo
bíogo is a bioinformatics library collection for Go
JOSS Publication
bíogo/hts: high throughput sequence handling for the Go language
Authors
Tags
bioinformatics toolkit golangCodeMeta (codemeta.json)
{
"@context": "https://raw.githubusercontent.com/mbjones/codemeta/master/codemeta.jsonld",
"@type": "Code",
"author": [
{
"@id": "http://orcid.org/0000-0001-8295-2301",
"@type": "Person",
"email": "dan.kortschak@adelaide.edu.au",
"name": "R Daniel Kortschak",
"affiliation": "School of Biological Sciences, The University of Adelaide"
},
{
"@id": "https://orcid.org/0000-0003-1786-2216",
"@type": "Person",
"email": "brentp@genetics.utah.edu",
"name": "Brent S Pedersen",
"affiliation": "Department of Human Genetics, University of Utah"
},
{
"@id": "http://orcid.org/0000-0003-2404-5636",
"@type": "Person",
"email": "david.adelson@adelaide.edu.au",
"name": "David L Adelson",
"affiliation": "School of Biological Sciences, The University of Adelaide"
}
],
"identifier": "",
"codeRepository": "https://github.com/biogo/hts",
"datePublished": "2017-01-06",
"dateModified": "2017-02-01",
"dateCreated": "2017-01-06",
"description": "high throughput sequence handling for the Go language",
"keywords": "bioinformatics, high throughput sequencing, golang",
"license": "BSD-3 like",
"title": "bíogo/hts",
"version": "v1.0.1"
}
GitHub Events
Total
- Watch event: 2
- Issue comment event: 1
- Fork event: 1
Last Year
- Watch event: 2
- Issue comment event: 1
- Fork event: 1
Committers
Last synced: 5 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| kortschak | d****k@a****u | 427 |
| Brent Pedersen | b****e@g****m | 17 |
| Egon Elbre | e****e@g****m | 5 |
| Yaz Saito | y****o@g****m | 2 |
| Wei Xu | x****7@g****m | 1 |
| Shengjing Zhu | z****j@d****g | 1 |
| Clayton Wheeler | c****r@g****m | 1 |
| Brennon Loveless | b****s@g****m | 1 |
| Jason Travis | j****s@t****g | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 34
- Total pull requests: 71
- Average time to close issues: 2 months
- Average time to close pull requests: 20 days
- Total issue authors: 16
- Total pull request authors: 12
- Average comments per issue: 4.97
- Average comments per pull request: 1.34
- Merged pull requests: 61
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- brentp (9)
- kortschak (6)
- dongweigogo (3)
- bloveless (2)
- yipal (2)
- bsipos (2)
- ZhongbaoShi (1)
- mnsmar (1)
- sb10 (1)
- ns3116 (1)
- seqyuan (1)
- jpofmars (1)
- chrchang (1)
- nathanhaigh (1)
- defgenx (1)
Pull Request Authors
- kortschak (49)
- brentp (8)
- yasushi-saito (4)
- xuweixw (2)
- bsipos (2)
- bloveless (2)
- zhsj (1)
- yipal (1)
- ckingsford (1)
- egonelbre (1)
- AlanRace (1)
- csw (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
- Total downloads: unknown
- Total docker downloads: 15,067,665
- Total dependent packages: 96
- Total dependent repositories: 162
- Total versions: 14
proxy.golang.org: github.com/biogo/hts
- Homepage: https://github.com/biogo/hts
- Documentation: https://pkg.go.dev/github.com/biogo/hts#section-documentation
- License: BSD-3-Clause
-
Latest release: v1.4.5
published over 1 year ago
Rankings
Dependencies
- github.com/biogo/boom v0.0.0-20150317015657-28119bc1ffc1
- github.com/kortschak/utter v0.0.0-20190412033250-50fe362e6560
- github.com/kr/pretty v0.2.0
- github.com/ulikunitz/xz v0.5.10
- gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15
- github.com/biogo/boom v0.0.0-20150317015657-28119bc1ffc1
- github.com/kortschak/utter v0.0.0-20190412033250-50fe362e6560
- github.com/kr/pretty v0.2.0
- github.com/kr/pty v1.1.1
- github.com/kr/text v0.1.0
- github.com/ulikunitz/xz v0.5.10
- gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15
