alignmentplots

package
v0.0.0-...-8533540 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2019 License: MIT Imports: 3 Imported by: 1

README

Alignment Plots Package

GoDoc

Overview

Alignment plots visualize the relationship between nucleotide or amino acid sequences.

Example

The following example demonstrates how to print an alignment plot of two sequences to stdout.

package main

import (
	"fmt"
	"log"

	"github.com/DanielSchuette/bioinformatics/alignmentplots"
)

func main() {
	// create an `Alignment' struct
	align := &alignmentplots.Alignment{
		SeqA: "MEEPQSDPSVEPPLSQET",   /* human TP53 AA 1-18 */
		SeqB: "EPQSDPSVEPPLSQETFSDL", /* human TP53 AA 3-22 */
	}

	// plot the resulting struct
	fmt.Println(align)

	// align the two input sequences `SeqA' and `SeqB'
	align.Align()

	// plot the alignment
	err := align.Plot("My First Alignment Plot")
	if err != nil {
		log.Fatalf("error while plotting: %v\n", err)
	}
}

This program generates the following output:

Matching residues are represented by certain characters (0 for matches that lie within the main diagonal or have at least one diagonal neighbor and x for matches that are not associated with a sequence of at least two diagonal matches) and are color-coded.

License

The code in this repository is MIT licensed.

Documentation

Overview

Package alignmentplots ...

Index

Constants

View Source
const (
	// returns the current version of `alignmentplots'
	Version = "0.0.1"
)

Package-level constants that determine certain behaviors of e.g. the plotting functionality.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alignment

type Alignment struct {
	// sequence A will be plotted in rows
	SeqA string

	// sequence B will be plotted in columns
	SeqB string

	// the alignment matrix indicates sequence similarities
	AlignmentMatrix [][]bool
}

Alignment holds two protein sequences and optionally their alignment matrix.

func (*Alignment) Align

func (a *Alignment) Align()

Align populates the `AlignmentMatrix' field of an `Alignment' struct. It must be called before an alignment plot can be created.

func (*Alignment) Plot

func (a *Alignment) Plot(title string) error

Plot creates a dot plot that visualizes the alignment of two protein sequences.

func (*Alignment) String

func (a *Alignment) String() string

String ensures that `Alignment' implements the `Stringer' interface for pretty printing.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL