Package xstream

import "github.com/BurntSushi/repeats/xstream"
Overview
Index

Overview ▾

Package xstream provides convenience functions and types for running the XSTREAM Java program. See http://jimcooperlab.mcdb.ucsb.edu/xstream/ for more details.

Variables

var DefaultOptions = Options{
    MinWordMatch:      0.7,
    MinPeriod:         2,
    MinCopyNo:         2,
    MinDomainLen:      10,
    MinConsensusMatch: 0.8,
    MaxPeriod:         0,
    MaxGaps:           3,
    MinTRContent:      0.0,
    MaxIndelError:     0.5,

    ShortSeedLength:         3,
    MediumSeedLength:        5,
    MaxSeedLength:           7,
    DPMatchScore:            2,
    DPMissPenalty:           -4,
    DPGapPenalty:            -4,
    ConsecGapMax:            3,
    MergeMaxPeriod:          50,
    MergeMaxNonoverlap:      10,
    MergeNonoverlapPeriod:   0.25,
    MergeXThreshold:         0.5,
    RRAlpha:                 0.9,
    RRBeta:                  0.75,
    RRGamma:                 0.9,
    RRDelta:                 0.6,
    TwoStagePeriodThreshold: 10,
    LongPeriodFilter:        20,
}
var (
    JavaBin = "java"
)

func Init

func Init(c build.Context) error

Init initializes the path to find the `xstream.jar`. It is automatically called at program initialization with the Default context. Use this if you need to override the Default context.

func Run

func Run(opt Options, inpFasta io.Reader) ([]Result, error)

Run executes XSTREAM with the given options and the fasta input provided. The results are parsed from the "xls" file written by XSTREAM.

XSTREAM is a jar file that needs to be executed with Java. If `java` is not in your path, then the `JavaBin` package variable should be set to the specific location of the `java` binary.

type Options

type Options struct {
    MinWordMatch      float64
    MinPeriod         int
    MinCopyNo         int
    MinDomainLen      int
    MinConsensusMatch float64
    MaxPeriod         int // 0 is default max period (half of input seq length).
    MaxGaps           int

    // anything outside of (0, 1] means default min TR cov.
    // (domain length / input sequence length)
    MinTRContent float64

    MaxIndelError float64

    ShortSeedLength         int
    MediumSeedLength        int
    MaxSeedLength           int
    DPMatchScore            int
    DPMissPenalty           int
    DPGapPenalty            int
    ConsecGapMax            int
    MergeMaxPeriod          int
    MergeMaxNonoverlap      int
    MergeNonoverlapPeriod   float64
    MergeXThreshold         float64
    RRAlpha                 float64
    RRBeta                  float64
    RRGamma                 float64
    RRDelta                 float64
    TwoStagePeriodThreshold int
    LongPeriodFilter        int
}

type Result

type Result struct {
    Id              string
    Name            string
    Length          int
    Start           int
    End             int
    Period          int
    CopyNum         float64
    MSA             seq.MSA
    ConsensusNoGaps string
    Consensus       string
    ConsensusError  float64
}