sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
808b68a9a51311c79b8833b262f0c6a10b07fada5f36c8baad58e873592f27ad | Go | 3,722 | 114 | // Package fastq provides functions for reading, writing, and manipulating data in the fastq file format.
package fastq
import (
"fmt"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"log"
"sync"
)
// Fastq stores the name, sequence, and qu... |
1f92bbd4bbb3e8ceb24f9ac09920db7e2c2757bbba7f0996fd29b43a7f49b0a7 | Go | 3,725 | 136 | package fastq
import (
"log"
"strings"
"github.com/vertgenlab/gonomics/dna"
)
const debugMode = 0 //set debugMode to 1 to enable prints
// AllAreEqual returns true if each Fastq entry in a slice of Fastq structs contains identical information, false otherwise.
func AllAreEqual(alpha []Fastq, beta []Fastq) bool {... |
51ca9f25a802e2c2601562c88d37327a9ecb39f50b5322d2eddaebe017d491de | Go | 3,729 | 135 | package fileio
import (
"bufio"
"fmt"
"io"
"os"
"strings"
"github.com/klauspost/pgzip"
"github.com/vertgenlab/gonomics/exception"
)
// EasyReader provides a simplified wrapper of the builtin golang io functions.
// Will silently handle reading gziped files. EasyReader is a valid io.Reader.
type EasyReader str... |
4c3918baea78cb064b3875f2664b4a33822114ebbddced49c9dd1feeda053b67 | Go | 3,742 | 96 | package axt
import (
"fmt"
"strings"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/vcf"
)
// ToVcfFile creates a new vcf file (i.e. filename) and writes all mutations
// observed in the slice of Axts to this vcf file.
func ToVcfFile(filename string, axtList []Axt) {
var records []vcf.Vcf
... |
1d4ec1555402201a89d67e0279fe94a5b686d3d45c8402132a895707830e2afb | Go | 3,743 | 125 | // Command Group: "General Tools"
// Find corresponding orthologous transcription start
package main
import (
"flag"
"fmt"
"log"
"github.com/vertgenlab/gonomics/bed"
"github.com/vertgenlab/gonomics/chain"
"github.com/vertgenlab/gonomics/chromInfo"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertge... |
9ed766345cd8a5eecf86fa48c07f9e38953cf301c3f1531acc60f1f1ae35275b | Go | 3,745 | 90 | // Package sam provides functions for reading, writing, and manipulating sam files.
// The Sam struct is built off the v1.6 specification defined at https://github.com/samtools/hts-specs
package sam
import (
"fmt"
"github.com/vertgenlab/gonomics/chromInfo"
"github.com/vertgenlab/gonomics/cigar"
"github.com/vertge... |
58ad05d3fbf785616ef3445a5f1b1dbdad344ec66698c3bba5abbaf96c80ae5c | Go | 3,749 | 164 | package maf
import (
"sort"
"strings"
"github.com/vertgenlab/gonomics/dna"
)
// MafSLinesAreEqual returns true if, and only if, the values
// in two "S" lines are identical
func MafSLinesAreEqual(a MafSLine, b MafSLine) bool {
if a.Src != b.Src {
return false
}
if a.Start != b.Start {
return false
}
if a... |
b68bc836cd8e83b9499bf3c63d38da3039e82e86cfbcf797184400052b01fdaf | Go | 3,769 | 127 | package motif
import (
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fasta"
"os"
"testing"
)
var MatchCompTests = []struct {
MotifFile string
MotifType string
FastaFile string
ChromName string
PropMatch float64
OutFile stri... |
5cf924d14ad09c1e670356238aa55eb0eb3aadf2848ea31d0420c2829f5b87e4 | Go | 3,802 | 135 | // Command Group: "Statistics & Population Genetics"
// Generates a binary input matrix for PCA
package main
import (
"flag"
"fmt"
"log"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fasta"
"github.com/vertgenlab/gonomics/fileio"
)
/*
The fir... |
e7a3693a7716e3693dd6206a28d2dc7685ca5f90db25f90d767764c72bfe4360 | Go | 3,803 | 119 | package lift
import (
"fmt"
"strings"
"github.com/vertgenlab/gonomics/numbers"
)
// OverlapCount returns the number of elements from list one that have any overlap with list two. Answers range from 0 to len(a).
// Input Lift slices must be presorted with SortByCoord.
func OverlapCount(a []Lift, b []Lift) int {
v... |
4119a76b2a982cc62caf9622c240aba2aade4491327641c2cff3146816aeeab9 | Go | 3,813 | 117 | // Command Group: "FASTA and Multi-FASTA Tools"
// Merge two multiFa files on a shared reference. Does not perform local realignment on INDELs
package main
import (
"flag"
"fmt"
"log"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/fasta"
)
func mergeMultiFa(inAFile string, inBFile string,... |
569ce6497b4e5244fd3c1eba2c8876ba9c743460f0af027dc744411241dce499 | Go | 3,819 | 139 | package main
import (
"fmt"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/interval"
"io"
"sync"
)
type Settings struct { // Draft of input setting struct
Input string // implemented
Output string // implemented
SelectFile string // implemented
//Extend int
NonOver... |
b8a315d0db87a9c909ccc5feaa3892841ee305d4fb0f689569463cb9c4661840 | Go | 3,831 | 115 | package numbers
import (
"math"
"testing"
)
var definiteIntegralTests = []struct {
f func(float64) float64
a float64
b float64
answer float64
}{
{func(x float64) float64 { return x }, 0, 1, 0.5},
{func(x float64) float64 { return math.Pow(x, 2) + 1 }, 0, 2, 14.0 / 3.0},
{func(x float64) float6... |
629ba39378e5c233a496c8c027fec297ce6f9c9f4be52f72afe15d24ebb8f9e0 | Go | 3,837 | 118 | package genomeGraph
// SortGraph will reorder nodes in a graph such that the order and Ids of the output graph are topologically sorted.
func SortGraph(g *GenomeGraph) *GenomeGraph {
answer := &GenomeGraph{}
answer.Nodes = make([]Node, len(g.Nodes))
order := GetSortOrder(g)
for sortedIdx, originalIdx := range orde... |
ed67a6083d604bbb26a26729e0c0d03b4af1fb92d59c236cf7ef39a47ca1ea25 | Go | 3,837 | 210 | package sam
import (
"fmt"
"io"
"testing"
//bgBam "github.com/biogo/hts/bam"
//bgSam "github.com/biogo/hts/sam".
"github.com/vertgenlab/gonomics/cigar"
"github.com/vertgenlab/gonomics/dna"
)
const bamTestfile string = "../bgzf/testdata/test.bam"
const samTestfile string = "../bgzf/testdata/test.sam"
func Tes... |
d18897ae5f4cfea12d752312d31ccde8f893c25fbc7a424d809f99531040776b | Go | 3,840 | 113 | package main
import (
"flag"
"fmt"
"github.com/vertgenlab/gonomics/bed"
"github.com/vertgenlab/gonomics/chromInfo"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/gtf"
"github.com/vertgenlab/gonomics/numbers/parse"
"log"
"os"
"strings"
)
//... |
d1c706ee41b0e26976fefcaa10c218b07fe159f361fab5a3f1a1a57d005b28f4 | Go | 3,841 | 177 | package chain
import (
"log"
"sort"
"strings"
)
// Uses bool to compare target or query coordinates as one function
// true is for target, false is for query.
func compareStartCoord(a Chain, b Chain, checkTarget bool) int {
if checkTarget {
return compareTargetCoord(a, b)
} else {
return compareQueryCoord(a,... |
e16d19a31b8f1bf30a57d55781d82a298b9c89e6ff9adefd7b1d5fb3d231157b | Go | 3,853 | 138 | package dnaThreeBit
import (
"bytes"
"strings"
"testing"
"github.com/vertgenlab/gonomics/dna"
)
//func RuneToThreeBitBase(r rune) ThreeBitBase {
//func ThreeBitBaseToRune(base ThreeBitBase) rune {
//func ThreeBitBaseToString(b ThreeBitBase) string {
//func FromString(s string) *ThreeBit {
//func ToString(fragmen... |
0accb8ffc5daa4e85c4f47866e619dc24ccbf52e151f86867384b1ce1c19ed89 | Go | 3,865 | 70 | package main
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
var globalAlignmentAnchorTests = []struct {
in_maf string
species1 string
species2 string
species1_genome ... |
9343c262fab2fc2603f976489421574a315e5cbd25e6dcce83c38e93b9ca967e | Go | 3,872 | 71 | // Command Group: "Data Conversion"
// Converts a bed and fasta sequences into amino acid sequences within the bed regions
package main
import (
"flag"
"fmt"
"github.com/vertgenlab/gonomics/bed"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/fasta"
"github.com/vertgenlab/gonomics/fileio"
... |
5f197f3f672e9008ac4847ff574afcc05a5ec78f66aab729598b7299ff8a0957 | Go | 3,888 | 110 | package sam
import (
"github.com/vertgenlab/gonomics/bed"
"github.com/vertgenlab/gonomics/cigar"
"github.com/vertgenlab/gonomics/dna"
"log"
)
// SamBedToBases takes a sam record and bed record and returns the sam sequence that corresponds to the reference coordinates
// specified by the bed record. The program lo... |
31033ac7687e74ba18c84476872f0944220ccd635646f3e913524aaad4875102 | Go | 3,891 | 101 | package numbers
import (
"math/rand"
)
// BinomialAlias contains alias table information used to
// generate binomial distributed random variates for pre-specified
// parameters. Setting up the BinomialAlias struct runs in O(n) time.
// However, once the alias is set up for a fixed cost, random variates
// can be ge... |
168be45960b8376594939599594cb8bf387c95a2bffe18c77d580db1c6b4a216 | Go | 3,901 | 181 | package gene
import (
"errors"
"fmt"
"github.com/vertgenlab/gonomics/dna"
)
func equal(alpha, beta *Gene) (bool, error) {
if alpha.id != beta.id {
return false, errors.New("id")
}
if alpha.startPos != beta.startPos {
return false, errors.New("startPos")
}
if alpha.posStrand != beta.posStrand {
return... |
f115b98e00d962f2e5a420cbfd087153c1759294392db53d7b03bb37d20202b0 | Go | 3,923 | 107 | package variant
import (
"errors"
"github.com/vertgenlab/gonomics/dna"
)
var (
ErrRefMatch = errors.New("position in seq does not match expected ref")
ErrInvalidPosition = errors.New("position of mutation was invalid")
ErrNegPos = errors.New("variant position plus offset is negative")
)
// Muta... |
3da9f40a5aa63609d480b126ac817331d7cd52c1d3da580fbe745d23f151a0e8 | Go | 3,925 | 100 | // Package graphReconstruct (WIP) has tools to reconstruct ancient genomes using extant descendants, but utilizes graph genomes instead of linear genomes.
package graphReconstruct
import (
"log"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/dna/dnaTwoBit"
"github.com/vertgenlab/gonomics/exp... |
8a5dce00ad84cd7abe7f5fb9bf3a5582a5f530fbb770b3fd447978328f10fec7 | Go | 3,929 | 106 | package main
import (
"flag"
"fmt"
"github.com/vertgenlab/gonomics/browser"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/numbers/parse"
"log"
"os"
"strings"
)
// VisualizeSettings defines the usage settings for the pFa Visualize subcommand.
type VisualizeSettings struct {
InFile... |
0ecbf9c89aaeac3c84b28a33b3871281fd5ce43538c0d87c29d28f9457763269 | Go | 3,939 | 138 | package gene
import (
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/numbers"
)
// Substitution changes a single nucleotide to the desired base, predicts the effect,
// and updates the Gene struct to reflect the change.
// The position of the mutation should be given in base-zero genomic coord... |
a1ede3ecabf87bd056fa0e6454173d5627e21b96d081a7e028bca2cc4bc9604a | Go | 3,939 | 127 | package parse
import (
"log"
"strconv"
)
// StringToBool parses a string into a bool and will exit on error.
func StringToBool(s string) bool {
b, err := strconv.ParseBool(s)
if err != nil {
log.Panicf("Error: trouble converting \"%s\" to a bool", s)
}
return b
}
// StringToInt parses a string into an int an... |
f5d198d1cae071739d0f7488f8fa5f6f27a864380c776c0e7bd244c8eb548868 | Go | 3,957 | 103 | package main
import (
"github.com/vertgenlab/gonomics/bed/bedpe"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"os"
"testing"
)
var StrawToBedPeTests = []struct {
FileList string
OutFile string
BinSize ... |
8aa60c115f912c6be68428d7ba474d66d6289559322fc294f3b550bf9ad401ca | Go | 3,973 | 132 | package axt
import (
"fmt"
"log"
"github.com/vertgenlab/gonomics/cigar"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/sam"
)
// ToSam converts an Axt record into a Sam (sam.SamAln) record
// TODO: Add logic to add hard clip on ends of axt that contain no sequence alignment.
func ToSam(axt... |
7cec85902e088faa65c64fe5388617e5250d68587f7c08af8b42c0acf61619df | Go | 3,985 | 106 | // Command Group: "FASTA and Multi-FASTA Tools"
// Scan multiple Fasta alignment for a user-specified pattern ('present bases (A,C,G,T, not gap- or N)' for now) and report counts
package main
import (
"flag"
"fmt"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fasta"
"github.com/vertg... |
2b25257cd0370ea03dec98fdf83ef238332e9bbeeb4baa6a125fccd83298a028 | Go | 3,995 | 134 | package fasta
import (
"errors"
"io"
"log"
"os"
"strings"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/exception"
)
// Seeker enables random access of fasta sequences using a pre-computed index.
type Seeker struct {
file readSeekCloser // TODO change to io.ReadSeekCloser after update
... |
98821c88aa3c1b1ac53e58568dcff2ed8012dcfd102be5fa6e85ec9afd86aa18 | Go | 3,995 | 142 | package sam
import (
"testing"
"github.com/vertgenlab/gonomics/dna"
)
var PileConsensusTests = []struct {
p Pile
c Consensus
substitutionsOnly bool
insertionThreshold float64
}{
{p: Pile{
CountF: [13]int{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
CountR: [13]int{0, 0,... |
c15bca4c61947ab4bff8cd6c855e2940890af50c2e7e743174d3f23202bbacd6 | Go | 3,996 | 109 | // Command Group: "VCF Tools"
// Filter genotyped VCFs containing at least 3 samples with SNP regions where parental genomes are homozygous (and different) and have a clear heterozygous F1 from the parents
package main
import (
"flag"
"fmt"
"log"
"strings"
"github.com/vertgenlab/gonomics/fileio"
"github.com/ve... |
0e302f9d20c557374c479ccd78e2f1f4fe99c70c7a0719ae98b7e9a5cb1f6b6d | Go | 4,023 | 136 | // Command Group: "SAM Tools"
// Count bases from sequencing data
package main
import (
"flag"
"fmt"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/sam"
"io"
"log"
"strings"
"sync"
)
func usage() {
fmt.Print(
"bamTagToReadGroup - Add bam... |
77246539b4246dacffb40afe89f9217c4cac02136a6467e49e53d0030fae9582 | Go | 4,052 | 150 | package main
import (
"strings"
"github.com/vertgenlab/gonomics/axt"
"github.com/vertgenlab/gonomics/chain"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/fasta"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/genomeGraph"
"github.com/vertgenlab/gonomics/vcf"
)
f... |
d227e17ec2bb4a30ec22b7e8c326ca5203c6b571ea6b810ff2ad8c919742af21 | Go | 4,057 | 251 | package pDna
import (
"math/rand"
"testing"
// "fmt"
)
var EqualBaseTests = []struct {
P Float32Base
Q Float32Base
Precision float32
Expected bool
}{
{P: Float32Base{
A: 0.3,
C: 0.2,
G: 0.5,
T: 0,
},
Q: Float32Base{
A: 0.3,
C: 0.2,
G: 0.5,
T: 0,
},
Precision: 1e-6,
... |
58fd37d5ab16bcf4dc22e576e407a6ef86eac5eeeb03b3a9eb1d8e72e8f3da6a | Go | 4,063 | 117 | package bed
import (
"fmt"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/fasta"
"log"
"math"
)
// MultiFaUngappedRegions takes in a MultiFa format alignment and returns a bed file of all ungapped regions
// for a user-specified seqName. The resulting sequence is in target coordinates, and ... |
4cbde1eae395988cdafed5888a87572e03e38a4da64843d9e7d7bcea78dcad3f | Go | 4,083 | 155 | package main
import (
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"io/ioutil"
"os"
"testing"
"github.com/vertgenlab/gonomics/bed"
)
var IntervalOverlapTests = []struct {
InFile string
OutFile string
SelectFile string
NonOverlap bool
Thr... |
b61963e1d1be55f24c910b37087dfd1e8391f6f81fea323febdd9b00c3006c51 | Go | 4,105 | 105 | package net
import (
"fmt"
"github.com/vertgenlab/gonomics/bed"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/numbers/parse"
)
// bedAnnotation is struct that helps the ToBed function. It holds data that makes up extended bed fields.
type bedAnnotation struct {
thickStart int
thickEnd... |
274dccfd7e37b61c66c9668ae80db3df702cc43108b92459a05dbeda57223554 | Go | 4,113 | 158 | package maf
import (
"testing"
//"os".
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/fileio"
)
var readWriteTests = []struct {
filename string
}{
{"testdata/chr22.test.maf"},
}
var srcToAssemblyAndChromTests = []struct {
src string
assembly_expected string
chrom_expecte... |
3684c91c4405a5e93fab4ef3ab18e40a51a30b8b810a6e933b5494810e4285c5 | Go | 4,123 | 165 | package fit
import (
"log"
"testing"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/numbers"
"github.com/vertgenlab/gonomics/numbers/parse"
)
var NegativeBinomialTests = []struct {
InFile string
ExpectedR float64
ExpectedP float64
}{
{InFile: "testdata/negativeBinomialVariates.r.... |
7b9d660cf03d80f1c021af85867f2ff29846697785eb90ad91cd04f50dc92373 | Go | 4,137 | 121 | package main
import (
"testing"
"github.com/vertgenlab/gonomics/align"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/fasta"
"github.com/vertgenlab/gonomics/genomeGraph"
)
// initiate fake fasta files for testing the graph function.
var toad = fasta.Fasta{Name: "toad", Seq: dna.StringToBas... |
3d21003ffd1704b9ef535f50a296fc800005bea2db547e6eb673a071b5dada3d | Go | 4,142 | 133 | package fasta
import (
"fmt"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"log"
"sort"
)
// AssemblyStats takes the path to a fasta file and a flag for whether lower case letters
// should count as assembly gaps. Six ints are returned, ... |
01baf3ad003b8d8121b80967db2f3275555206014ab0b40098739bc801262540 | Go | 4,154 | 147 | package bgzf
import (
"bytes"
"compress/gzip"
"encoding/binary"
"encoding/hex"
"fmt"
"io"
"log"
"math"
)
// magicHexEOF is a particular empty bgzf block that marks the true EOF.
var magicEOF []byte = makeMagicEOF()
// BlockWriter moves data -> compressor -> zipBlock -> file writer.
type BlockWriter struct {
... |
f0fe996c057b7b167cc59b1790d886da4b098c341c20c81df9a6d06e685ec7cb | Go | 4,163 | 160 | package motif
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fasta"
"github.com/vertgenlab/gonomics/fileio"
)
var PfmToPpmTests = []struct {
PfmFile string
OutputFile string
ExpectedFile string
Pseudocount float64
}{
{"testdata/expected.jaspar.txt... |
91a36abf47b61043800e7d6f946029abaa5386ff6be6b5777b87c74339a2150e | Go | 4,184 | 89 | package main
import (
"flag"
"fmt"
"github.com/vertgenlab/gonomics/fasta"
"github.com/vertgenlab/gonomics/motif"
"log"
)
func tfMatchComp(s motif.MatchCompSettings, fastaFileName string) {
//read in fasta sequences
records := fasta.Read(fastaFileName)
fasta.AllToUpper(records)
s.Records = records
//pre-fli... |
cd14e733a69c09689676daafb2df0adcc4c0b49005fcf86e41db07b4bf666f7c | Go | 4,190 | 179 | package main
import (
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"os"
"testing"
)
var filterTests = []struct {
InFile string
OutFile string
MatrixType string
MaxLength int
MinLength int
ExpectedFile string
}{
{InFile: "testdata/jaspar.vertebrate.tx... |
a244cbc1e5e7de09b3e4fa9cf4b00ab64f2340a307d1bd79cbde0461626cd742 | Go | 4,227 | 151 | package gtf
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/bed"
"github.com/vertgenlab/gonomics/chromInfo"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
var GenesToPromoterBedTests = []struct {
gFile string
cFile string
upstream ... |
b73079c5b4c66bf25ddc74881a449586a77c4299c15de4577f533305bda77200 | Go | 4,272 | 104 | // Command Group: "FASTA and Multi-FASTA Tools"
// Calculates the gc content of fasta sequences for all regions specified in a bed file
package main
import (
"flag"
"fmt"
"github.com/vertgenlab/gonomics/bed"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/g... |
cedd3faa2955dff64252836b90e71207fd12d191886a195b337c6c3e69f50663 | Go | 4,274 | 151 | // Package popgen contains tools for population genetic analysis, specifically for selection and population structure.
package popgen
import (
"github.com/vertgenlab/gonomics/exception"
"strings"
"github.com/vertgenlab/gonomics/fasta"
"github.com/vertgenlab/gonomics/fileio"
)
// Group is a struct with associated... |
0b9adf397e37d6cf46b2771268b9dc76597ebf9ee1fc6448fef13f6cafea959c | Go | 4,299 | 168 | package simulate
import (
"math/rand"
"os"
"testing"
"fmt"
"github.com/vertgenlab/gonomics/bed"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fasta"
"github.com/vertgenlab/gonomics/fileio"
)
var CountWindowsTests = []struct {
InputFa string
RegionLength int
Expected in... |
4cbee971bae1eec87a773d8eb7b14c569740129de3d13e3e499a81423dd68c7d | Go | 4,320 | 203 | package vcf
import (
"strings"
"testing"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/variant"
)
var testSub = Vcf{
Chr: "subTest",
Pos: 1,
Ref: "A",
Alt: []string{"T", "G", "C"},
}
var expSub0 = variant.Substitution{
Chr: "subTest", Pos: 0, Ref: dna.A, Alt: dna.T,
}
var expSub1 = ... |
92cbd54d24c55faee3abdc25540ef5ed23e6460a8c6b3fa44f91c10399afd70e | Go | 4,336 | 116 | package main
import (
"flag"
"fmt"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fasta"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/motif"
"log"
"os"
)
// InfoSettings defines the usage settings for the pwmTools info subcommand.
type InfoSettings struct... |
346e8f1f92d5671f0118ddce3577929a986b44b3cfd1dc98707a1767858e813f | Go | 4,423 | 130 | package main
import (
"flag"
"fmt"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/numbers"
"github.com/vertgenlab/gonomics/numbers/fit"
"github.com/vertgenlab/gonomics/sam"
"log"
"os"
)
type CoverageSett... |
7bbefee468a1aa86b72c8dc9f9b64a1467c93fff53a156ee511b2386ac3dff74 | Go | 4,450 | 131 | // Command Group: "Sequence Evolution & Reconstruction"
// Reconstruct ancient sequences using extant genomes and a newick tree with branch lengths
package main
import (
"bufio"
"flag"
"fmt"
"log"
"os"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fasta/pFasta"
"github.com/vertge... |
0ede54f3f99d1a7fb8aa53aa39fc655e4ba0b7e79384577186f53d12df1c34cd | Go | 4,456 | 158 | package main
import (
"errors"
"flag"
"fmt"
"github.com/vertgenlab/gonomics/bed"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/sam"
"log"
"os"
"path/filepath"
)
type mapqSettings struct {
InFile string
OutFile string
BedRegions s... |
ff74f5473d34a83adc7dd7a4190e88ccd4343dfb59ee3cf8992607fe7395c6be | Go | 4,479 | 128 | // Command Group: "BED Tools"
package main
import (
"flag"
"fmt"
"github.com/vertgenlab/gonomics/bed/bedpe"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/numbers"
"log"
"math"
)
type Settings struct {
InFile string
OutFile ... |
a7234dd583367f725a78fac6fcb1c40c12f5e09411fc8ab90866b20fb7b534a2 | Go | 4,483 | 122 | package align
import (
"fmt"
"image"
"image/color"
"image/draw"
"sort"
"strings"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/fasta"
"github.com/vertgenlab/gonomics/sketch"
)
type keyValue struct {
Key string
Value int
}
func incrementOrAdd(list []keyValue, needle string) []keyV... |
4fc4a0bc91e8b47222e736593cfe7597106a9f128b8d0ca21e82a15758d42096 | Go | 4,498 | 114 | package vcf
import (
"fmt"
"strings"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/fasta"
)
// AppendAncestor adds the ancestral allele state (defined by input bases) to the INFO column of a vcf entry.
func AppendAncestor(g Vcf, b []dna.Base) Vcf {
if g.Info == "." {
g.Info = fmt.Sprint... |
ba7127148091e30e4747811f1fca08d8567880775d4285cfb875cd364f28ecb3 | Go | 4,506 | 131 | package main
import (
"flag"
"fmt"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/gtf"
"log"
"os"
)
// FilterSettings defines the usage settings for the gtfTools filter subcommand.
type FilterSettings struct {
InFile string
OutFile... |
7965cf0094ae188d0c65a5a89347c277c72a1d9c8767d099b7bff559bbf4e7c6 | Go | 4,514 | 144 | // Command Group: "General Tools"
// Used to check for completion of SLURM job arrays (WIP). Takes in a 'fancy' version of a job array text file (modeled after PARASOL)
package main
import (
"flag"
"fmt"
"log"
"strings"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
type ... |
cc64f6e46811953a744fda201542ec7d68c66f81bcd74a6d72209a085cb16c50 | Go | 4,534 | 174 | package fileio
import (
"bufio"
"bytes"
"encoding/binary"
"errors"
"fmt"
"io"
"log"
"os"
"strconv"
"strings"
"github.com/klauspost/pgzip"
"github.com/vertgenlab/gonomics/exception"
)
const (
defaultBufSize = 4096
)
// ByteReader wraps bufio.Reader for efficient byte-level file parsing.
type ByteReader ... |
499aaa24a17be80f40a8da9bda7639649480cc552b325e843568e558d550b575 | Go | 4,539 | 160 | // Package giraf contains utilities and software to operate genome graph alignments in giraf format
package giraf
import (
"fmt"
"io"
"sync"
"github.com/vertgenlab/gonomics/cigar"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
// Giraf... |
7776366511f7429e02b9bba2f7da58bda9e17e9e833c32928ca2bc433bf82919 | Go | 4,541 | 130 | // Command Group: "Variant Calling & Annotation"
// Annotate Vcf records with cDNA and protein effect predictions
package main
import (
"flag"
"fmt"
"log"
"strings"
"sync"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/fasta"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenl... |
1e6961a514e15978fec953c831f9ff2d86bfd91a25bbc7f0b44897f57e6ab3f2 | Go | 4,591 | 143 | package numbers
import (
"fmt"
"math"
"testing"
)
var fisherExactLessTests = []struct {
a int // top left in matrix
b int // top right in matrix
c int // bottom left in matrix
d int // bottom right in matrix
pvalue float64 // pvalue of a being less
}{
{0, 3, 7, 10, 0.2509}... |
ad187807ec8357c37d3e45ce485217dfdbeb84c95ea99e570cb522d3ec3ce0d7 | Go | 4,605 | 135 | // Command Group: "Genome Graph Tools"
// Command Usage: "Genome Graph Creation, Alignment, and Manipulation"
// Graph-Smith-Waterman: align single or paired end fastqs
package main
import (
"flag"
"fmt"
"os"
"strings"
"github.com/vertgenlab/gonomics/align"
"github.com/vertgenlab/gonomics/chromInfo"
"github.c... |
db46f50860eb1a29974d0f4165a5f5045285c23759dfd6e1ee90bca1d237f4a8 | Go | 4,642 | 107 | package main
import (
"fmt"
"strings"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/sam"
"github.com/vertgenlab/gonomics/vcf"
)
func ASFilter(v vcf.Vcf, parentOne int16, parentTwo int16, F1 int16) bool {
if vcf.IsHomozygous(v.Samples[parentOne]) &... |
9dd090d0f0c49581622ccab64c1ee181300233d3d184d5e4720a95c45bc5602b | Go | 4,644 | 130 | // Command Group: "BED Tools"
// Calculates the minimum distance between beds in separate files with matching names
package main
import (
"flag"
"fmt"
"log"
"github.com/vertgenlab/gonomics/bed"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
func bedMinimumDistanceName(inp... |
ef29d8e114aad075c30a46da46e8dd6452b14b18249981dc44d53b9d7d32c77b | Go | 4,678 | 141 | // Command Group: "Sequence Evolution & Reconstruction"
// WARNING: This program is now deprecated. Please use 'reconstructSeq' as its replacement.
// Returns maximum likelihood ancestral sequences from a Mouse-Rat-ChineseHamster-Squirrel multiple alignment in multiFa format
package main
import (
"flag"
"fmt"
"log... |
e8d950e6cd7fc10364b1ff184ed1afe4d1da752e9c283d4cbeb3d3e2fb051262 | Go | 4,688 | 86 | // Command Group: "Statistics & Population Genetics"
// Returns values sampled from the probability distribution of the mean selection coefficient for a given set of bed regions
package main
import (
"flag"
"fmt"
"log"
"math/rand"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/popge... |
7b6769f793b2e35766ec73f116d389456598d5d9123f591c40ed6dce825de3f3 | Go | 4,693 | 194 | package dna
import (
"log"
)
// ToUpper changes the input base to uppercase.
func ToUpper(b Base) Base {
switch b {
case LowerA:
return A
case LowerC:
return C
case LowerG:
return G
case LowerT:
return T
case LowerN:
return N
default:
return b
}
}
// ToLower changes the input base to lowercase.
... |
3ff70e77a718c2c3b472a0dabfb9e19dccb06bb4ecf43ce6458d2853f06d9ed5 | Go | 4,706 | 198 | package sam
import (
"fmt"
"github.com/vertgenlab/gonomics/exception"
"io"
"os"
"strings"
"testing"
)
func TestTags(t *testing.T) {
var err error
data, _ := Read("testdata/unmapped.bam")
for i := range data {
err = ParseExtra(&data[i])
if err != nil {
t.Error("problem parsing tags in ParseExtra")
}
... |
a52e3eb1e67674703e31a1356f838b14f0f4f263238dc9f407a94aa9aff03813 | Go | 4,716 | 86 | package main
import (
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/numbers"
"os"
"testing"
)
var FastqFilterTests = []struct {
inputFile string
outputFile string
expectedFile string
R1InFile string
R2InFile ... |
799b7f9414fee1387afb775c62980beec34a3172c1bf718c4ab654d5fcd1efbb | Go | 4,752 | 122 | package genomeGraph
import (
"log"
"sort"
"github.com/vertgenlab/gonomics/fastq"
)
func extendCurrSeed(seed *SeedDev, gg *GenomeGraph, read fastq.Fastq, left bool, right bool) {
var newTStart, newQStart, newTEnd, newQEnd int32 = int32(seed.TargetStart) - 1, int32(seed.QueryStart) - 1, int32(seed.TargetStart + se... |
3174f5f88fe111818d0fe71007ac241cf3827b8012f5854cc597e6371351daa4 | Go | 4,790 | 97 | package fasta
import (
"log"
"testing"
"github.com/vertgenlab/gonomics/dna"
)
var (
genome1 = "testdata/testBreakBinning.fa"
expBases1 = dna.StringToBases("ACGTA")
expBases2 = dna.StringToBases("CGT")
expBases3 = dna.StringToBases("AC")
expBases4 = dna.StringToBases("GTACG")
expBases5 = dna.St... |
37c39eed8cf3b04ba8ae1a95348dad7b67513f057483904c1fae47ef9242a004 | Go | 4,817 | 118 | package main
import (
"flag"
"fmt"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/motif"
"log"
"os"
)
// FormatSettings defines the usage settings for the pwmTools format subcommand.
type FormatSettings struct {
InFile string
OutFile string
InType string
OutType ... |
ab2dad8eda8bcb653f5d865dd55337f22264bd763e891205333fcd3aeda41435 | Go | 4,828 | 153 | // Command Group: "General Tools"
// A tool to find non/overlapping genomic regions
package main
import (
"flag"
"fmt"
"log"
"os"
"runtime/pprof"
"runtime/trace"
"sync"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/interval"
)
func usage... |
40617b250879f139fd6308ede9442e005511f5d46f9bfde36422116770dc20f9 | Go | 4,830 | 117 | package main
import (
"flag"
"fmt"
"log"
"github.com/vertgenlab/gonomics/bed"
"github.com/vertgenlab/gonomics/fasta"
)
// multiFaSubsequenceSwap swaps a series of specified regions from a bed file between two sequences in a MultiFa object
// The foregroundName is the name of the sequence containing the regions ... |
912cc1cf73720d136d2e13819f550823a6906b871b338ad549b839295e9d2a89 | Go | 4,836 | 158 | package fasta
import (
"bufio"
"bytes"
"fmt"
"io"
"log"
"os"
"strconv"
"strings"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
// Index stores the byte offset for each fasta sequencing allowing for efficient random access.
type Index struct {
chroms []chrOffset /... |
91eafc5ab818e103fdfb18430492ec47febdcb738d9f7650c13fcef628017806 | Go | 4,870 | 159 | // Command Group: "FASTQ TOOLS"
// Finds and replaces specified bits of sequence field
package main
import (
"flag"
"fmt"
"log"
"strings"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fastq"
"github.com/vertgenlab/gonomics/fileio"
)
type Fin... |
f98578eaecae19079a19d372f48cc8c9db63c1a9c0b746c8742e99496dbc8f6d | Go | 4,893 | 164 | package main
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
//Tests were made with the following cmds.
//~/go/bin/multiFaAcceleration -windowSize 50 -rawInitialVelBranchLengths test.RawInitial.bed -rawVelBranchLengths test.RawVel.bed chr1 test.fa test... |
ac0a6890d2ff0712321c2a854f99a3406ac9452e019272da353b68964d841f7f | Go | 4,916 | 177 | package gene
import (
"testing"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/fasta"
"github.com/vertgenlab/gonomics/gtf"
)
func TestGtfToGoGene(t *testing.T) {
g := gtf.Read("testdata/test.gtf")
f := fasta.Read("testdata/test.fasta")
var ok bool
var err error
// Positive posStrand t... |
c5a73b0a29f7f8e5926e0359c2d9226640a5e48f1557cd499cc843e2a8672bd1 | Go | 4,933 | 158 | package chain
import (
"log"
"github.com/vertgenlab/gonomics/axt"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/numbers"
)
// AllToAxt converts a slice of chain structs into a slice of axt structs, taking in the target and query faMaps.
func AllToAxt(ch []Chain, target map[string][]dna.Bas... |
ed3a20d6d3e3ba4e9e4882b41c4c70b032ee0aa4467252546883e7ce6c80a827 | Go | 4,962 | 125 | package genomeGraph
import (
// "github.com/vertgenlab/gonomics/fastq"
"log"
"sort"
"github.com/vertgenlab/gonomics/dna"
)
type SeedDev struct {
TargetId uint32
TargetStart uint32
QueryStart uint32
Length uint32
PosStrand bool
TotalLength uint32
NextPart *SeedDev
}
func IndexGenomeIntoMap(g... |
1d8756c2ad7596466c100561e730590c935924ef8a3c7bd28f79a8ef98e5c5a5 | Go | 4,971 | 149 | // Command Group: "Statistics & Population Genetics"
// Generate unique haplotypes for provided regions from genetic variation data
package main
import (
"flag"
"fmt"
"github.com/vertgenlab/gonomics/bed"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonom... |
d0a7790414d6db634cd65b2c0ec3c010c46f6fde784c7904a5ace3c851b69baa | Go | 4,984 | 165 | package genomeGraph
import (
"fmt"
"log"
"math/rand"
"github.com/vertgenlab/gonomics/cigar"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/giraf"
"github.com/vertgenlab/gonomics/numbers"
"github.com/vertgenlab/gonomics/numbers/parse"
)
func RandGiraf(graph *GenomeGraph, numReads int, re... |
eefdfac2b1c6508ce6d1ed812e6aa7d919e20e99cf6ea372bdbff80d08823874 | Go | 4,988 | 203 | package vcf
import (
"testing"
)
func TestIsHeterozygous(t *testing.T) {
tests := []struct {
sample Sample
expected bool
}{
{Sample{Alleles: []int16{}}, false},
{Sample{Alleles: []int16{0, 1}}, true},
{Sample{Alleles: []int16{1, 1}}, false},
}
for _, test := range tests {
result := IsHeterozygous(... |
2d1a022adb795816fea0705c5e7680cb7de27719f7c920b19a90eb1bee7c89be | Go | 5,032 | 200 | package dna
import (
"fmt"
"log"
"unicode"
"github.com/vertgenlab/gonomics/exception"
)
// RuneToBase converts a rune into a dna.Base if it matches one of the acceptable DNA characters.
// Note: '*', used by VCF to denote deleted alleles becomes Nil.
func RuneToBase(r rune) (Base, error) {
switch r {
case 'A':... |
896b428ad4d3b381c664ff6bda0d8bb4b5ebc8ab7f7ae085bcbcb5099842dcae | Go | 5,043 | 163 | package main
import (
"fmt"
"os"
"strings"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/sam"
)
var SimulateSamTests = []struct {
OutFile string
RefFile string
NumReads ... |
0d65a2cfb1cb4d420103812ee7ceb6aad383af2c06639d8565477592cf7dc0fd | Go | 5,060 | 111 | package main
import (
"flag"
"fmt"
"log"
"os"
"github.com/vertgenlab/gonomics/bed"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/wig"
)
type PeakSettings struct {
InWig string
ChromSizes string
OutBed string
Threshold ... |
50ccf44794aa82e014ccc7dbe8322dd308b6301899253f20fe5a5b4bc4501c12 | Go | 5,072 | 186 | package giraf
import (
"fmt"
"log"
"strconv"
"strings"
"github.com/vertgenlab/gonomics/cigar"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fastq"
"github.com/vertgenlab/gonomics/numbers/parse"
)
func GirafToString(g *Giraf) string {
var ans... |
c0095685593be168b36e7a78d9549e500dccd958d0a6774421b39640a6fd3158 | Go | 5,084 | 145 | package main
import (
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"os"
"testing"
)
var WigToTrainingSetTests = []struct {
InWigFile string
InFastaFile string
TrainFile string
ValidateFile string
TestFile string
WindowS... |
af42c01e90fdc64c63c8bfec64fcfc2e09ac02577b14c04164af58a879f61157 | Go | 5,093 | 167 | package sort
import (
"container/heap"
"encoding/gob"
"io"
"os"
"sort"
"github.com/vertgenlab/gonomics/exception"
)
type heapBuf []any
// lessFunc is used to define the Less method for heapBuf.
// lessFunc is set by the mergeSort function which inputs
// a less function for the input generic data type.
// It ... |
0edba478e3362fa87e1dd723f5937be8a94015e6b184e429c97acfe270e061ea | Go | 5,111 | 193 | // Package bgzf provides functions for reading and writing files in
// the BGZF compression format.
package bgzf
import (
"bufio"
"bytes"
"compress/gzip"
"io"
"log"
"math"
"os"
)
// BlockReader is the decompressor for BGZF files which is at its core
// a gzip reader. The BGZF reader retains a *os.File to use f... |
91ebb7d63df2fd97f6eec926a4b31bf7336d0cc0301fed477c662344f3f75189 | Go | 5,128 | 156 | package genomeGraph
import (
"flag"
"log"
"os"
"runtime"
"runtime/pprof"
"strings"
"sync"
"testing"
"time"
"github.com/vertgenlab/gonomics/fastq"
"github.com/vertgenlab/gonomics/giraf"
"github.com/vertgenlab/gonomics/numbers/parse"
)
var cpuprofile = flag.String("cpuprofile", "", "write cpu profile to `f... |
8ccaaca293e27f42a7a9d34988c8bacfe595a24b8e8a13f4ee8fde631c599dd0 | Go | 5,130 | 220 | package matrix
import (
"fmt"
"gonum.org/v1/gonum/mat"
"testing"
)
var FractionalSymmetricMatrixExponentiationTests = []struct {
InMat *mat.Dense
Power float64
Expected *mat.Dense
Precision float64
}{
{InMat: mat.NewDense(4, 4, []float64{
0.91, 0.03, 0.03, 0.03,
0.03, 0.91, 0.03, 0.03,
0.03, 0.... |
671e5031721765b822248602f9f032618e88ecef0ca3a7bbc399da2c0435adec | Go | 5,151 | 162 | package pFasta
import (
"bufio"
"encoding/binary"
"errors"
"fmt"
"github.com/vertgenlab/gonomics/dna/pDna"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/numbers/parse"
"github.com/x448/float16"
"io"
"log"
"strings"
)
// PFasta is the pro... |
02c4ae7a09ef445ffc42f4b7a07edae0fe5437ccd2736be97f2c8f65d93bb6f3 | Go | 5,189 | 149 | // Command Group: "Sequence Evolution & Reconstruction"
// Returns number of mutations that separate two sequences for a given window size
package main
import (
"flag"
"fmt"
"github.com/vertgenlab/gonomics/dna"
"log"
"math"
"os"
"runtime/pprof"
"github.com/vertgenlab/gonomics/fasta"
)
type Settings struct {... |
c54588ee3790a522a0859b4e6054b19c7971384dc42dc88204fea7de179a2248 | Go | 5,215 | 198 | package popgen
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
func BenchmarkAfsF1e7(b *testing.B) {
for i := 0; i < b.N; i++ {
PlotAfsF(0.03, 1322, "/dev/null", 1e-7)
}
}
func BenchmarkAfsF1e6(b *testing.B) {
for i := 0; i < b.N; i++ {
PlotAfs... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.