prepfa

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddErr

func AddErr[T any](it iter.Seq[T]) iter.Seq2[T, error]

func AppendSplit

func AppendSplit(out []string, s string, sep string) []string

func AppendString

func AppendString(buf []byte, s string) []byte

func BedSet

func BedSet[T any](it iter.Seq2[fastats.BedEntry[T], error]) map[string]int

func CatPath

func CatPath(w io.Writer, path string) error

func CatPaths

func CatPaths(out string, paths ...string) error

func ChrSpanEq

func ChrSpanEq(cs1, cs2 fastats.ChrSpan) bool

func ChrSpanLess

func ChrSpanLess(cs1, cs2 fastats.ChrSpan) bool

func Cleanup

func Cleanup(f CleanupFlags) error

func CleanupCtx

func CleanupCtx(ctx context.Context, arg Args, i int) error

func CollectBedWithHeader

func CollectBedWithHeader(path string) ([]fastats.BedEntry[[]string], error)

func CollectErr

func CollectErr[T any](it iter.Seq2[T, error]) ([]T, error)

func CollectFa

func CollectFa(path string) ([]fastats.FaEntry, error)

func CollectVCF

func CollectVCF(path string, cols ...int) (names []string, vcf []fastats.VcfEntry[[]string], err error)

func FaChrSpanSet

func FaChrSpanSet(it iter.Seq2[fastats.FaEntry, error]) (map[string]int, error)

func FaFixedWins

func FaFixedWins(fa []fastats.FaEntry, wins iter.Seq2[fastats.ChrSpan, error]) iter.Seq2[fastats.FaEntry, error]

func FaPosLess

func FaPosLess(f1, f2 fastats.FaEntry) bool

func FilterChrParent

func FilterChrParent[T any](parent string, it iter.Seq2[fastats.BedEntry[T], error]) iter.Seq2[fastats.BedEntry[T], error]

func GetFaChrSpan

func GetFaChrSpan(f fastats.FaEntry) (fastats.ChrSpan, error)

func Join

func Join(ctx context.Context, args Args) error

func KeepBedMatches

func KeepBedMatches[T any](css map[string]int, it iter.Seq2[fastats.BedEntry[T], error]) iter.Seq2[fastats.BedEntry[T], error]

func KeepFaMatches

func KeepFaMatches(css map[string]int, it iter.Seq2[fastats.FaEntry, error]) iter.Seq2[fastats.FaEntry, error]

func MakeWins

func MakeWins(fa []fastats.FaEntry, coords []CoordsPair, size int, step int, width int) iter.Seq2[fastats.ChrSpan, error]

func PrepFa

func PrepFa(f PrepFaFlags) error

func PrepareCtx

func PrepareCtx(ctx context.Context, arg Args, i int) error

func ReadGenos

func ReadGenos(line []string) ([]string, error)

func ReadVCF

func ReadVCF(r io.Reader) (names []string, it iter.Seq2[fastats.VcfEntry[[]string], error], err error)

func ReadWinBed

func ReadWinBed(r io.Reader) iter.Seq2[fastats.ChrSpan, error]

func RunCleanup

func RunCleanup()

func RunPrepAndClean

func RunPrepAndClean()

func RunPrepFa

func RunPrepFa()

func RunSeparate

func RunSeparate(ctx context.Context, arg Args, i int) error

func RunSeparates

func RunSeparates(ctx context.Context, args Args) error

func SliceIter

func SliceIter[S ~[]T, T any](s S) iter.Seq[T]

func SortBed

func SortBed[T any](bed []fastats.BedEntry[T])

func SortFa

func SortFa(fa []fastats.FaEntry)

func StartSignalhandler

func StartSignalhandler(closef func()) (endf func())

func StripChrParent

func StripChrParent[T any](it iter.Seq2[fastats.BedEntry[T], error]) iter.Seq2[fastats.BedEntry[T], error]

func SubsetVCFCols

func SubsetVCFCols(it iter.Seq2[fastats.VcfEntry[[]string], error], cols ...int) iter.Seq2[fastats.VcfEntry[[]string], error]

func TensorflowPredict

func TensorflowPredict(ctx context.Context, w io.Writer, f TensorflowFlags) error

func WriteBed

func WriteBed(path string, bed iter.Seq2[fastats.BedEntry[[]string], error]) error

func WriteCoords

func WriteCoords(path string, it iter.Seq2[CoordsPair, error]) error

func WriteFasta

func WriteFasta(path string, it iter.Seq2[fastats.FaEntry, error]) error

Types

type Args

type Args struct {
	Crosses []CrossArgs
	Size    int
	Step    int
	Width   int
	Outpre  string
	Threads int
	Paircol int
	Prepare bool
	Cleanup bool
	Combine bool
	Predict bool
}

func GetArgs

func GetArgs(r io.Reader) (Args, error)

func (Args) CrossCleanupFlags

func (a Args) CrossCleanupFlags(i int) CleanupFlags

func (Args) CrossPrepFlags

func (a Args) CrossPrepFlags(i int) PrepFaFlags

func (Args) TensorflowArgs

func (a Args) TensorflowArgs() TensorflowFlags

type CleanupFlags

type CleanupFlags struct {
	Fa1     string
	Fa2     string
	Bed     string
	Outpre  string
	Parent  string
	Paircol int
}

func GetCleanupFlags

func GetCleanupFlags() (CleanupFlags, error)

type CoordsPair

type CoordsPair struct {
	Original fastats.ChrSpan
	New      fastats.ChrSpan
}

func BuildChr

func BuildChr(entry fastats.FaEntry, vcf []fastats.VcfEntry[[]string]) (fa1, fa2 fastats.FaEntry, coord1, coord2 []CoordsPair)

func BuildFas

func BuildFas(fa []fastats.FaEntry, vcf []fastats.VcfEntry[[]string]) (fa1, fa2 []fastats.FaEntry, coords1, coords2 []CoordsPair)

type CrossArgs

type CrossArgs struct {
	Fa     string
	Vcf    string
	Bed    string
	C0     int
	C1     int
	Parent string
}

type FullFlags

type FullFlags struct {
	NoPrepare   bool
	NoCleanup   bool
	NoPredict   bool
	NoCombine   bool
	PredictOnly bool
}

type PrepFaFlags

type PrepFaFlags struct {
	Fa     string
	Vcf    string
	C0     int
	C1     int
	Size   int
	Step   int
	Width  int
	Outpre string
}

func GetPrepFaFlags

func GetPrepFaFlags() (PrepFaFlags, error)

type StripNaNsOut

type StripNaNsOut struct {
	Bed []fastats.BedEntry[[]string]
	Fa1 []fastats.FaEntry
	Fa2 []fastats.FaEntry
}

func StripNaNs

func StripNaNs(col int, bed []fastats.BedEntry[[]string], fa1, fa2 []fastats.FaEntry) (StripNaNsOut, error)

type TensorflowFlags

type TensorflowFlags struct {
	Fa1     string
	Fa2     string
	Bed     string
	Paircol int
	Width   int
}

Jump to

Keyboard shortcuts

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