atacdemultiplexutils

package
v0.31.14 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const BUFFERSIZE = 1000000

BUFFERSIZE ...

Variables

View Source
var CHRINTERVALDICT map[string]*interval.IntTree

CHRINTERVALDICT chr ID <-> interval tree

View Source
var CHRINTERVALDICTTHREAD map[int]map[string]*interval.IntTree

CHRINTERVALDICTTHREAD threadNB -> chr ID -> pos

View Source
var INTERVALMAPPING map[uintptr]string

INTERVALMAPPING peak ID pos <->pos

View Source
var PEAKIDDICT map[string]uint

PEAKIDDICT peak ID<->pos

View Source
var PEAKSYMBOLDICT map[Peak][]string

PEAKSYMBOLDICT map[peak]symbol

Functions

func Check

func Check(err error)

Check ...

func CloseFile

func CloseFile(file closer)

CloseFile close file checking error

func CountNbLines

func CountNbLines(filename string) int

CountNbLines count nb lines in a file

func CreatePeakIntervalTree

func CreatePeakIntervalTree()

CreatePeakIntervalTree ...

func CreatePeakIntervalTreeCustom added in v0.31.8

func CreatePeakIntervalTreeCustom(peakPos [3]int, sep string)

CreatePeakIntervalTreeCustom ...

func ExceCmd

func ExceCmd(cmd string)

ExceCmd ...

func InitIntervalDictsThreading

func InitIntervalDictsThreading(threadnb int)

InitIntervalDictsThreading Init interval dict threading map by copying the interval map for each trheads

func LoadCellDictsFromBedFileToIndex added in v0.29.1

func LoadCellDictsFromBedFileToIndex(fname Filename) map[string]int

LoadCellDictsFromBedFileToIndex create cell ID <-> index dict using a single cell bed file storing unique CELL ID Ex: chr1 15555 15522 CELLID1 chr1 25555 25522 CELLID1 chr1 35555 35522 CELLID1 chr1 15555 15522 CELLID2 chr1 25555 25522 CELLID2

will give map(CELLID1:0, CELLID2:1)

func LoadCellDictsToIndex

func LoadCellDictsToIndex(fname Filename) map[string]int

LoadCellDictsToIndex create cell ID index dict

func LoadCellIDDict

func LoadCellIDDict(fname string) map[string]bool

LoadCellIDDict create cell ID bool dict

func LoadPeaks

func LoadPeaks(fname Filename) int

LoadPeaks load peak file globally

func LoadPeaksAndTrim added in v0.29.1

func LoadPeaksAndTrim(fname Filename) int

LoadPeaksAndTrim load peak file and return peak peak id trimmed for "chr" -> dict

func LoadPeaksCustom added in v0.31.8

func LoadPeaksCustom(fname Filename, sep string, peakPos [3]int) int

LoadPeaksCustom load peak file globally

func LoadPeaksDict added in v0.31.6

func LoadPeaksDict(fname Filename) (peakiddict map[string]uint)

LoadPeaksDict load peak file return map[string]int

func LoadPeaksSubset

func LoadPeaksSubset(fname Filename, firstPeak, lastPeak int)

LoadPeaksSubset load peak file but using only a subset of peaks and return peak peak id -> dict

func LoadRefBedFileWithSymbol added in v0.31.0

func LoadRefBedFileWithSymbol(peaksymbolfile Filename)

LoadRefBedFileWithSymbol peaksymbolfile, peakfile Filename

func LoadRefCustomFileWithSymbol added in v0.31.7

func LoadRefCustomFileWithSymbol(peaksymbolfile Filename, sep string, symbolPos []int, refPos [3]int)

LoadRefCustomFileWithSymbol peaksymbolfile, peakfile Filename

func LoadSymbolFile added in v0.31.0

func LoadSymbolFile(peaksymbolfile, peakfile Filename)

LoadSymbolFile peaksymbolfile, peakfile Filename

func ReturnReader

func ReturnReader(fname string, startingLine int) (*bufio.Scanner, *os.File)

ReturnReader ...

func ReturnReaderForBamfile added in v0.31.4

func ReturnReaderForBamfile(fname string, threadnb int) (*bam.Reader, *os.File)

ReturnReaderForBamfile ...

func ReturnReaderForBzipfile

func ReturnReaderForBzipfile(fname string, startingLine int) (*bufio.Scanner, *os.File)

ReturnReaderForBzipfile ...

func ReturnReaderForBzipfileOld

func ReturnReaderForBzipfileOld(fname string, seekPos int) (*bufio.Scanner, *os.File)

ReturnReaderForBzipfileOld ...

func ReturnReaderForBzipfilePureGo

func ReturnReaderForBzipfilePureGo(fname string, startingLine int) (*bufio.Scanner, *os.File)

ReturnReaderForBzipfilePureGo ...

func ReturnReaderForGzipfile

func ReturnReaderForGzipfile(fname string, startingLine int) (*bufio.Scanner, *os.File)

ReturnReaderForGzipfile ...

func ReturnWriter

func ReturnWriter(fname string) io.WriteCloser

ReturnWriter ...

func ReturnWriterForBzipfile

func ReturnWriterForBzipfile(fname string) *bzip2.Writer

ReturnWriterForBzipfile ...

func ReturnWriterForGzipFile

func ReturnWriterForGzipFile(fname string) io.WriteCloser

ReturnWriterForGzipFile ...

func SortLogfile

func SortLogfile(filename Filename, separator string, outfname string,
	ignoreSortingCategory bool, ignoreError bool)

SortLogfile sort a file according to key value input:

filename string,
separator string,
outfname string,
ignoreSortingCategory bool,
ignoreError bool

Types

type ArrayFlags

type ArrayFlags []string

ArrayFlags ...

func (*ArrayFlags) Set

func (i *ArrayFlags) Set(value string) error

Set ...

func (*ArrayFlags) String

func (i *ArrayFlags) String() string

String ...

type Filename

type Filename string

Filename type used to check if files exists

func (*Filename) ReturnReader

func (i *Filename) ReturnReader(startingLine int) (*bufio.Scanner, *os.File)

ReturnReader Return reader for file

func (*Filename) Set

func (i *Filename) Set(filename string) error

Set ...

func (*Filename) String

func (i *Filename) String() string

type IntInterval

type IntInterval struct {
	Start, End int
	UID        uintptr
	Payload    interface{}
}

IntInterval Integer-specific intervals

func (IntInterval) ID

func (i IntInterval) ID() uintptr

ID Return the ID of Interval

func (IntInterval) Overlap

func (i IntInterval) Overlap(b interval.IntRange) bool

Overlap rule for two Interval

func (IntInterval) Range

func (i IntInterval) Range() interval.IntRange

Range Return the range of Interval

func (IntInterval) String

func (i IntInterval) String() string

String Return the string re[ of Interval

type Pair

type Pair struct {
	Key   string
	Value int
}

Pair ...

type PairList

type PairList []Pair

PairList ...

func RankByWordCountAndDeleteOldMap

func RankByWordCountAndDeleteOldMap(wordFrequencies *map[string]int) PairList

RankByWordCountAndDeleteOldMap ...

func (PairList) Len

func (p PairList) Len() int

Len

func (PairList) Less

func (p PairList) Less(i, j int) bool

func (PairList) Swap

func (p PairList) Swap(i, j int)

type Peak added in v0.31.0

type Peak struct {
	Slice      [3]string
	Start, End int
}

Peak Descriptor of a peak as string slice

func (*Peak) Chr added in v0.31.6

func (peak *Peak) Chr() (chr string)

Chr return the chromosome of the peak

func (*Peak) PeakToString added in v0.31.1

func (peak *Peak) PeakToString() (peakstr string)

PeakToString Convert Peak to string

func (*Peak) SplitToPeak added in v0.31.6

func (peak *Peak) SplitToPeak(split []string)

SplitToPeak Convert string split to peak

func (*Peak) StringToPeak added in v0.31.0

func (peak *Peak) StringToPeak(str string)

StringToPeak Convert Peak string to peak

func (*Peak) StringToPeakNoCheck added in v0.31.0

func (peak *Peak) StringToPeakNoCheck(str string)

StringToPeakNoCheck Convert Peak string to peak

func (*Peak) StringToPeakWithPos added in v0.31.12

func (peak *Peak) StringToPeakWithPos(str string, refPos [3]int)

StringToPeakWithPos Convert Peak string to peak

type PeakIntervalTreeObject added in v0.31.6

type PeakIntervalTreeObject struct {
	Chrintervaldict map[string]*interval.IntTree
	Intervalmapping map[uintptr]string
	Peakiddict      *map[string]uint
}

PeakIntervalTreeObject Peak IntervalTree Object

func CreatePeakIntervalTreeObject added in v0.31.6

func CreatePeakIntervalTreeObject(peakiddict map[string]uint) (
	intervalObject PeakIntervalTreeObject)

CreatePeakIntervalTreeObject create a peak intervall dict object

func CreatePeakIntervalTreeObjectFromFile added in v0.31.6

func CreatePeakIntervalTreeObjectFromFile(bedfile Filename) (intervalObject PeakIntervalTreeObject)

CreatePeakIntervalTreeObjectFromFile create a peak intervall dict object

Jump to

Keyboard shortcuts

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