Documentation ¶
Overview ¶
Package minimap2 contains functions for working with minimap2.
minimap2 is a DNA alignment package written by Heng Li for aligning nanopore reads as the spirtual successor to bwa-mem, which is a widely used alignment algorithm for illumina sequencing reads.
minimap2 takes in fasta reference genomes and aligns them with fastq reads, outputting a sam alignment file. In this package, all io is handled with standard library io.Reader and io.Writer, both of which can be used with dnadesign `bio` parsers. Data should be piped in using data `WriteTo` functions, and can be read using a sam parser.
We use `os.Exec` instead of cgo in order to make the package simpler, and also because the overhead of launching is minimal in comparison to how much data is expected to run through minimap2.
For more information on minimap2, please visit Heng Li's git: https://github.com/lh3/minimap2
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Minimap2 ¶
Minimap2 aligns sequences using minimap2 over the command line. Right now, only nanopore (map-ont) is supported. If you need others enabled, please put in an issue.
Example ¶
package main import ( "bytes" "fmt" "os" "strings" "github.com/koeng101/dnadesign/external/minimap2" "github.com/koeng101/dnadesign/lib/bio" ) func main() { // Get template io.Reader templateFile, _ := os.Open("./data/templates.fasta") templateFastas, _ := bio.NewFastaParser(templateFile).Parse() defer templateFile.Close() // Get fastq reads io.Reader fastqFile, _ := os.Open("./data/reads.fastq") defer fastqFile.Close() // Create output buffer var buf bytes.Buffer // Execute the Minimap2Raw function _ = minimap2.Minimap2(templateFastas, fastqFile, &buf) output := buf.String() line2 := strings.Split(output, "\n")[2] fmt.Println(line2) }
Output: @SQ SN:oligo2 LN:158
Types ¶
This section is empty.