atacdemultiplexutils

package
v0.47.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2020 License: MIT Imports: 19 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 PEAKSCOREDICT map[Peak]float64

PEAKSCOREDICT dict containing score for ref peaks

View Source
var PEAKSYMBOLDICT map[Peak][]string

PEAKSYMBOLDICT map[peak]symbol

Functions

func AssertIfFileExists added in v0.38.0

func AssertIfFileExists(filename string)

AssertIfFileExists panic if err is nil from os.Stats

func Check

func Check(err error)

Check ...

func CheckIfFileExists added in v0.38.0

func CheckIfFileExists(filename string) bool

CheckIfFileExists return true or flase

func CheckIfFolderExists added in v0.38.0

func CheckIfFolderExists(foldername string) bool

CheckIfFolderExists return true or flase

func CheckIfPeakPosIsMutltipleOf3 added in v0.40.0

func CheckIfPeakPosIsMutltipleOf3(peakPos []int) (numberOfPeaks int)

CheckIfPeakPosIsMutltipleOf3 check if list is multiple of 3

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 []int, sep string)

CreatePeakIntervalTreeCustom ...

func ExceCmd

func ExceCmd(cmd string)

ExceCmd ...

func ExceCmdReturnOutput added in v0.38.0

func ExceCmdReturnOutput(cmd string) string

ExceCmdReturnOutput return output of comand

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, trim bool, keepLine bool) int

LoadPeaks load peak file globally

func LoadPeaksAndTrimandReturnOrientation added in v0.46.12

func LoadPeaksAndTrimandReturnOrientation(fname Filename, orientationColID int) (nbPeaks int, orientationDict map[uint]string)

LoadPeaksAndTrimAndReturnOrienation load peak fil,

return peak peak id trimmed for "chr" -> dict and
return Orientation dict (i.e. the sense of the peak)

func LoadPeaksCustom added in v0.31.8

func LoadPeaksCustom(fname Filename, sep string, peakPos []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,
	symbol SymbolType,
	refPos []int,
	scorefiltercolumns int)

LoadRefCustomFileWithSymbol peaksymbolfile, peakfile Filename

func LoadSymbolFile added in v0.31.0

func LoadSymbolFile(peaksymbolfile, peakfile Filename)

LoadSymbolFile peaksymbolfile, peakfile Filename

func MaxIntList added in v0.31.15

func MaxIntList(intlist []int) (max int)

MaxIntList int give the max of list

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 ReturnReaderForSamfile added in v0.43.1

func ReturnReaderForSamfile(fname Filename) (*sam.Reader, *os.File)

ReturnReaderForSamfile ...

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

func TryExceCmd added in v0.39.0

func TryExceCmd(cmd string) error

TryExceCmd try exec command else return err

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 Filename from string

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

func (*Peak) StringToPeakWithPosAndStart added in v0.40.0

func (peak *Peak) StringToPeakWithPosAndStart(str string, refPosList []int, start int)

StringToPeakWithPosAndStart 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 CreatePeakIntervalTreeObjectFromFile added in v0.31.6

func CreatePeakIntervalTreeObjectFromFile(bedfile Filename, sep string, peakPos []int) (
	intervalObject PeakIntervalTreeObject)

CreatePeakIntervalTreeObjectFromFile create a peak intervall dict object

type Reader added in v0.44.0

type Reader interface {
	Read([]byte) (i int, err error)
}

Reader reader interface

func ReturnFileReader added in v0.44.0

func ReturnFileReader(fname string) (reader Reader)

ReturnFileReader ...

type SymbolType added in v0.31.16

type SymbolType struct {
	SymbolPos []int
	SymbolStr string
}

SymbolType Descriptor of a symbol: either a string or int slice

Jump to

Keyboard shortcuts

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