File: README.md

package info (click to toggle)
golang-github-biogo-hts 1.0.1%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,376 kB
  • ctags: 798
  • sloc: makefile: 3
file content (76 lines) | stat: -rw-r--r-- 1,980 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
flagstat
========

This example replicates the output of [samtools](https://samtools.github.io) flagstat command.
With a single core, the program is significantly slower, but the Go program comparable performance with 4 cores and surpassing the C implementation with 8.

On an example BAM file the output of samtools (1.3.2-199-gec1d68e/htslib 1.3.2-199-gec1d68e) is:
```
$ time samtools flagstat 9827_2#49.bam
56463236 + 0 in total (QC-passed reads + QC-failed reads)
0 + 0 secondary
0 + 0 supplementary
269248 + 0 duplicates
55357963 + 0 mapped (98.04% : N/A)
56463236 + 0 paired in sequencing
28231618 + 0 read1
28231618 + 0 read2
54363468 + 0 properly paired (96.28% : N/A)
55062652 + 0 with itself and mate mapped
295311 + 0 singletons (0.52% : N/A)
360264 + 0 with mate mapped to a different chr
300699 + 0 with mate mapped to a different chr (mapQ>=5)

real	1m31.517s
user	1m30.268s
sys	0m1.180s
```

and of this command (Go 1.8) on the same file is:
```
$ go build github.com/biogo/hts/paper/examples/flagstat
$ export GOMAXPROCS=1
$ time ./flagstat 9827_2#49.bam
56463236 + 0 in total (QC-passed reads + QC-failed reads)
0 + 0 in total secondary
0 + 0 in total supplementary
269248 + 0 duplicates
55357963 + 0 mapped (98.04% : N/A)
56463236 + 0 paired in sequencing
28231618 + 0 read1
28231618 + 0 read2
54363468 + 0 properly paired (96.28% : N/A)
55062652 + 0 with itself and mate mapped
295311 + 0 singletons (0.52% : N/A)
360264 + 0 with mate mapped to a different chr
300699 + 0 with mate mapped to a different chr (mapQ >= 5)

real	5m2.323s
user	5m0.312s
sys	0m2.148s
```

The following give the same flagstat output, but with reduced time.

GOMAXPROCS=2
```
real	2m41.310s
user	5m18.948s
sys	0m2.600s
```

GOMAXPROCS=4
```
real	1m40.957s
user	6m21.232s
sys	0m3.688s
```

GOMAXPROCS=8
```
real	1m28.465s
user	9m7.480s
sys	0m8.056s
```

The file used in the benchmark was 9827_2#49.bam, available from ftp://ftp.sra.ebi.ac.uk/vol1/ERA242/ERA242167/bam/9827_2%2349.bam