sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
9d4db26059ea0449ae48634499aabf5cfa028c86c19d84e97bf7ea027428be46 | Go | 1,950 | 48 | package main
import (
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"os"
"testing"
)
var CigarToBedTests = []struct {
inputFileOne_Name string
inputFileTwo_Name string
outFa string
FirstPos_InsBed int
FirstPos_DelBed int
Chrom stri... |
2bd07949f25816e014eb3c07b6ec8e71092029b08b45e42b8771920413a3ae52 | Go | 1,954 | 59 | // Command Group: "FASTA and Multi-FASTA Tools"
// Provides human-readable multiple alignments for all entries in a bed file
package main
import (
"flag"
"fmt"
"log"
"github.com/vertgenlab/gonomics/bed"
"github.com/vertgenlab/gonomics/browser"
)
func multFaVisualizeBeds(bedFile string, alnFile string, outForma... |
b1d69bd7b09b9640d96a7ec903c04aaa09f73974d61a543b11a27462633b5e6b | Go | 1,959 | 62 | package main
import (
"strings"
"testing"
"github.com/vertgenlab/gonomics/fasta"
"github.com/vertgenlab/gonomics/fileio"
)
// Checks if two accuracy files match, even when order is not matching.
func accEqual(a string, b string) bool {
var ok = false
fileA := fileio.Read(a)
fileB := fileio.Read(b)
for A := ... |
ff881be08b3f6c08ee42e62a78d0cbcdf8910fb307f03950c3af35c86aa70011 | Go | 1,968 | 60 | // Command Group: "FASTA and Multi-FASTA Tools"
// Removes all columns in a multi fasta alignment that are not variable
package main
import (
"flag"
"fmt"
"github.com/vertgenlab/gonomics/bed"
"github.com/vertgenlab/gonomics/fasta"
"log"
)
func mfaReduce(inFilename, outFilename, bedFilename, chrom string, refSta... |
a41bf5dae38135f0bbfee4f44266eedf834337aefcb53bdb8f49ff65b66e9106 | Go | 1,969 | 61 | package main
import (
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"os"
"testing"
)
var HaqerBedCompTests = []struct {
bedA string
bedB string
outFile string
expFile string
list string
matrixAverage string
matrix... |
9bdcd50f10e62a8ed745f57b67fdb90d6c5af9b5c5f03935d0363934fa6cee71 | Go | 1,977 | 91 | package main
import (
"fmt"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fasta"
"github.com/vertgenlab/gonomics/fasta/pFasta"
"os"
"testing"
)
var faToPfaTests = []struct {
InFile string
OutFile string
Start int
End int
Chrom string
}{
{
InFile: "testdata/test_faT... |
a79b12761124e9a29335b09ba30e5f49b29f50065aed5938451d23c51fa5dee0 | Go | 1,982 | 73 | // Command Group: "Data Conversion"
// Convert a maf alignment into a bed, where the bed score is the alignment score
package main
import (
"flag"
"fmt"
"log"
"github.com/vertgenlab/gonomics/bed"
"github.com/vertgenlab/gonomics/maf"
)
func mafToBed(mafFile string, outBed string, reference string) {
mafRecords... |
1ac2ad14b8d16c2b5468dc5d25af02e914d4edfbeca3bb9a6c20d406c0d3cbb0 | Go | 1,986 | 62 | package gtf
import (
"strings"
"testing"
// "fmt".
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/fasta"
"github.com/vertgenlab/gonomics/vcf"
)
func TestVariantToAnnotationLarge(t *testing.T) {
testGtf := Read("testdata/test.gtf")
testVcf, _ := vcf.Read("testdata/test.vcf")
krit := fas... |
333b55ae5ec2af8f744d2fa970ee7023cf9406aaa911c7d374133f4cb7e97863 | Go | 1,988 | 48 | package main
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
var BedSubsetMatrixTests = []struct {
UnionFile string
FileListFile string
Fraction bool
MarkMultipleOverlaps string
OutFil... |
f3888b08af3ca76268bcf8f1bd003f434b7963f9d9ae20803b637b636da4ca9d | Go | 2,010 | 67 | // Command Group: "FASTA and Multi-FASTA Tools"
// Scan multiple Fasta alignment for a user-specified pattern (N for now) and report bed regions in reference sequence coordinates
package main
import (
"flag"
"fmt"
"github.com/vertgenlab/gonomics/bed"
"github.com/vertgenlab/gonomics/fasta"
"log"
)
func multiFaSc... |
d83c78fe78f5a970fa4de9a282cdaa3cb94545f36ae5070d0eee7c77e9a9dd51 | Go | 2,021 | 59 | package main
import (
"github.com/vertgenlab/gonomics/bed"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"log"
"os"
"testing"
)
var ontologyEnrichmentTests = []struct {
Input string
ChromSize string
GeneFile string
GafFile string
OboFile ... |
342345994e32a191ac728c9aff991b28f996bb4aebc3951a92f8c00c7e0ac637 | Go | 2,043 | 85 | package axt
import (
"log"
"os"
"testing"
)
var readWriteTests = []struct {
filename string // input
}{
{"testdata/chrM_gasacu1.axt"},
}
func TestReadToChan(t *testing.T) {
var index int
for _, test := range readWriteTests {
file := Read(test.filename)
reader, headerLines := GoReadToChan(test.filename)
... |
4bf27e3e5496c58c0ba18213da404c91133194c5e985a066c5b8a0db4c0dcbd3 | Go | 2,047 | 88 | package main
import (
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"os"
"testing"
)
var SimulateVcfTests = []struct {
ExpectedFile string
OutFile string
Alpha float64
NumAlleles int
NumSites int
SetSeed int64
BoundAlpha flo... |
b36aa6d6d4d50a20e4bcd8b753f0e34e9be738dbc8dbeeb5133a28a2f2ca1f95 | Go | 2,048 | 45 | package simulate
import (
"fmt"
"github.com/vertgenlab/gonomics/expandedTree"
"github.com/vertgenlab/gonomics/numbers"
"log"
"math/rand"
)
// ETree produces a phylogenetic tree with a user-specified number of nodes and random gamma-distributed branch lengths,
// determined by a user-specific alpha and beta param... |
054f991a7c2be574d1081aa25250f50b0c15c5ba81c7175d8360191f951fa879 | Go | 2,059 | 84 | package pFasta
import (
"fmt"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fasta"
"os"
"testing"
)
var FaToPfaTests = []struct {
InputFilename string
Start int
End int
Chrom string
}{
{
InputFilename: "testdata/test_faToPfa_input_0.fa",
Start: ... |
83bc83342b8cc58d60fe0442ceee17775122aed954bfed668cdda72e0ae2f0d6 | Go | 2,089 | 74 | package simulate
import (
"math/rand"
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fasta"
"github.com/vertgenlab/gonomics/fileio"
)
var WithIndelsTests = []struct {
FastaFile string
BranchLength float64
PropIndel float64
Lambda fl... |
12a81c37ff47f06dee3e4bafb44087b026a23f2459fbb0078eb18741d6542443 | Go | 2,093 | 67 | package tree
import (
"fmt"
"image"
"image/color"
"github.com/vertgenlab/gonomics/sketch"
"golang.org/x/image/font"
"golang.org/x/image/font/basicfont"
"golang.org/x/image/math/fixed"
)
func addLabel(img *image.RGBA, label string, xStart int, yStart int) {
point := fixed.Point26_6{fixed.Int26_6(xStart * 64),... |
1aa0d04203f33affa3165da28c3e5c91f1aefe0bf00d0beaf3d429f3449ae601 | Go | 2,096 | 56 | package main
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fasta"
"github.com/vertgenlab/gonomics/fileio"
)
func TestAllPossible(t *testing.T) {
var err error
var mouse fasta.Fasta = fasta.Fasta{Name: "mm10"}
var rat f... |
0ed08006c33fcd768e2e67102b9f256a997467b5ac2a3bd05ad3cbd50e5ff59e | Go | 2,100 | 58 | // Command Group: "GTF Tools"
// getPromoter will take a list of unique genes of interest and return a bed file of the promoter region proceeding
// the position of the TSS for each isoform by the amount specified with upstream and following the TSS by the amount specified by downstream.
package main
import (
"flag"... |
871fd71997d4317ee0cda24ddabb98b41bb809380da8efa59c85a5cca7d7194d | Go | 2,104 | 54 | package main
import (
"github.com/vertgenlab/gonomics/bed"
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fasta"
)
var MfaReduceTests = []struct {
inputFile string
outputFile string
expectedFile string
bedFilename string
chrom string
refStart int... |
309810de9e8f0b3b70142200089852cece6a530ecbd53b2cee95cca99ffc77c2 | Go | 2,108 | 82 | package main
import (
"flag"
"fmt"
"github.com/vertgenlab/gonomics/bed"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/numbers"
"log"
)
func bedShear(inFile string, outFile string, fragmentSize int) {
var err error
var currInBed bed.Bed
var... |
60a2c34753e1fc94a4d6f67d8217ac3935be718eebe02823ab1c2d336d448eaf | Go | 2,109 | 67 | package main
import (
"flag"
"fmt"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fasta/pFasta"
"log"
"os"
)
// FaToPfaSettings defines the usage settings for the pFa FaToPfa subcommand.
type FaToPfaSettings struct {
InFile string
OutFile string
Start int
End int
Chrom ... |
2f245f02a3769169758504d07e9ce020d76e5ea4cf008f01ac16de40f2bfc356 | Go | 2,110 | 76 | package sam
// flagTestBit tests a single bit in the sam Flag.
func flagTestBit(num uint16, bit uint16) bool {
var dummy uint16 = bit & num //bitwise AND
return dummy == bit
}
// IsPaired returns true if the input record has a mate pair.
func IsPaired(sam Sam) bool {
return flagTestBit(sam.Flag, 1)
}
// ProperlyA... |
b332b943d99f235f8cb7766acbf727b5bb642a9f052540861adb174e673bc7f4 | Go | 2,119 | 70 | package main
import (
"strings"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
var lastZ = "lastZInstall"
var pairwise = "../../lastZWriter/testdata"
var speciesListFile = pairwise + "/speciesList.txt"
var refListFile = pairwise + "/refList.txt"
var allDists = pair... |
0ce54f9e78e0bd93a2e1b5230443408f0e6cc43454b4193b422daf4d66cffea7 | Go | 2,126 | 76 | package bed
import "testing"
var BedMethodTests = []struct {
b Bed
expectedChrom string
expectedChromStart int
expectedChromEnd int
newChrom string
newStart int
newEnd int
}{
{b: Bed{Chrom: "chr1", ChromStart: 12, ChromEnd: 15},
expectedChrom: "ch... |
943729c7cfaf0f07e512372908d52ca3f24336cf18976310b67eb6ba0675ce8a | Go | 2,133 | 74 | package dna
import "testing"
var alpha = StringToBases("ACTGacgtAAACC--ACacgnnnNNNactg")
var beta = StringToBases("ACGGacgtAATCC--ACacgnnnNCNaCtg")
func TestCount(t *testing.T) {
ACount, CCount, GCount, TCount, NCount, aCount, cCount, gCount, tCount, nCount, gapCount := Count(alpha)
if ACount != 5 || CCount != 4 |... |
0c8d176f7e6f6255f71d5aea75c2bca5ed8925166c8158a99c31798e6915c9eb | Go | 2,143 | 53 | package main
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
var CountPairOfBasesTest = []struct {
fastaFile string
chromName string
baseone string
basetwo string
outfile string
bedFile string
compare bool
expectedTxt st... |
b02187e5360936a4e32501bd209967f52903dbb21c1598016e58faf90feb1003 | Go | 2,152 | 103 | package binaryGiraf
import (
"io"
"reflect"
"testing"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/genomeGraph"
"github.com/vertgenlab/gonomics/giraf"
)
var nodeSeq []dna.Base = dna.StringToBases("ATGCGATGCG" +
"ATGCGATGCGATGCGATGCGATGCGATGCGATG... |
16dd617de5ff820e36156dbbb5d338465dbb4fc1986ddf22e64eb8e414ec4d6d | Go | 2,154 | 67 | package align
import (
"log"
"github.com/vertgenlab/gonomics/dna"
)
// ConstGap_highMem aligns two sequences (alpha, beta) using a score matrix (scores) and a constant gap penalty of gapPen.
// The return values are the alignment score and the cigar representing the alignment.
func ConstGap_highMem(alpha []dna.Bas... |
1dd1a488940e4b8e32a5a95edeabdf8e6f090e1e2819cbdcc783edf49e42a14a | Go | 2,157 | 167 | package pFasta
import (
"math/rand"
"testing"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/dna/pDna"
"github.com/vertgenlab/gonomics/fasta"
)
var SampleTests = []struct {
Input []PFasta
Chrom string
SetSeed int64
Expected fasta.Fasta
}{
{Input: []PFasta{{Name: "chr2",
Seq: ... |
6c859c2349633170d841a0bdb1d9e6dc52966b2bdf83f5c2e0395a6abfd3847e | Go | 2,158 | 90 | package main
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/bed"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/vcf"
)
var LiftTests = []struct {
inputFile string
outFile string
expectedOutputFile string
unmappedFile string
chainFile s... |
c7c39b752037f38aaf304d3ec4f7f86d50f9b6a6f9bd13532e0a7d4d7192d5bd | Go | 2,159 | 91 | package logspace
import (
"log"
"math"
)
// ToBase10 takes in a logspace number (base e is assumed within this package), and converts it to a base 10 log transformed number.
func ToBase10(lnX float64) float64 {
return lnX * math.Log10(math.E)
}
// CanConvert returns true if the input logSpace number can be conver... |
bf82d42a0a2fb9aa0a92611b45950c38d96b4e1aa5c98e718558d30fe59dbb42 | Go | 2,167 | 60 | package expandedTree
import (
"github.com/vertgenlab/gonomics/numbers/matrix"
"gonum.org/v1/gonum/mat"
)
// PopulateSubstitutionMatrices initializes the SubstitutionMatrix field of every node in an input
// newick tree if the provided node is the root node.
// The substitution matrix for each branch is based on a k... |
b5160013f3fb74f05942f66d5dbc0630768080be2df06a78cac74368abe11c2f | Go | 2,178 | 78 | // Command Group: "BED Tools"
// Given a window size (default 5000), return the number of base pairs that are in any bed region within that window
package main
import (
"flag"
"fmt"
"log"
"github.com/vertgenlab/gonomics/bed"
"github.com/vertgenlab/gonomics/chromInfo"
"github.com/vertgenlab/gonomics/fileio"
"g... |
a2eed7d2f85a42d8633092cf113d95a9f4975e06d5d69f5a027b854ec0469051 | Go | 2,179 | 65 | // Command Group: "Statistics & Population Genetics"
// Computes the Dunn Index based on variable SNPs for each input bed region of a multiple alignment
package main
import (
"flag"
"fmt"
"log"
"github.com/vertgenlab/gonomics/bed"
"github.com/vertgenlab/gonomics/fasta"
"github.com/vertgenlab/gonomics/popgen"
)... |
5c766aa82a69641e38451ad956fc3eebd5286de5baeb4f1d81da1c96521305e8 | Go | 2,196 | 78 | // Command Group: "Data Simulation"
// Returns a file of random bed regions of an input bed file
package main
import (
"flag"
"fmt"
"log"
"math/rand"
"github.com/vertgenlab/gonomics/bed"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/simulat... |
d7b8be554501d0f5dd80e9953dc1d2b0b5100e0757747e2dbb78d3683e82a6e3 | Go | 2,200 | 87 | package simulate
import (
"fmt"
"math/rand"
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fasta"
"github.com/vertgenlab/gonomics/fileio"
)
var GCcontent = 0.42
var RandGeneTests = []struct {
name string
length int
GC float64
}{
{"testingRandGene", 102, GC... |
00a31ab42c9654210f7c291651632c2f0c56c1a86dd7d1627614a3c4f343d815 | Go | 2,212 | 116 | package genomeGraph
import (
"testing"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/dna/dnaTwoBit"
)
func TestGetSortOrder(t *testing.T) {
graph := MakeTestGraph()
// Just getting two sets of the same nodes to make sure they will separate
nodesToSort := append(graph.Nodes)
order := br... |
497a8864e3f9c3e9ab72d71de237c00ea5559b28bf677a9fcb7d444c02238f2a | Go | 2,233 | 62 | // Command Group: "Statistics & Population Genetics"
// Returns summary statistics on an MCMC trace file produced by selectionMCMC
package main
import (
"flag"
"fmt"
"log"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/numbers"
)
func mcmcTra... |
14fd2ff6b5c4d0e438b682b6172f5bfac54aa966a159c43c1051fbf410214c48 | Go | 2,244 | 113 | package popgen
import (
"fmt"
"testing"
"github.com/vertgenlab/gonomics/vcf"
)
var VcfSampleToSegSiteTests = []struct {
Vcf vcf.Vcf
DivergenceAscertainment bool
UnPolarized bool
IncludeRef bool
Expected SegSite
ExpectedFlagBool bool
}{
{vcf... |
7a4cebffe18366eed0c2837208379ca1993d93324e7d21f84fa915d81f45a0b5 | Go | 2,251 | 115 | package axt
import (
"sort"
"strings"
)
func compareRCoord(alpha Axt, beta Axt) int {
if alpha.RStart < beta.RStart {
return -1
}
if alpha.RStart > beta.RStart {
return 1
}
if alpha.REnd < beta.REnd {
return -1
}
if alpha.REnd > beta.REnd {
return 1
}
return 0
}
func compareRName(alpha Axt, beta A... |
226b29e4564f9a8ae4cb4dbe4ba3c8e740301dc070890ed773160f24f793fedb | Go | 2,253 | 97 | package sam
import (
"testing"
)
const (
paired int = 1
properlyAligned int = 2
unmapped int = 4
mateUnmapped int = 8
posStrand int = 16
mateIsPosStrand int = 32
forwardRead int = 64
reverseRead int = 128
notPrimaryAlign int = 256
readFailsQc int = 512
isDuplicate ... |
b86d7bb70b094584dd8549ac20335ebf3c74b7ba88edcc94ac33d0d4621c253a | Go | 2,262 | 72 | package main
import (
"flag"
"fmt"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fasta/pFasta"
"github.com/vertgenlab/gonomics/numbers/parse"
"log"
"os"
)
// ExtractSettings defines the usage settings for the pFa extract subcommand.
type ExtractSettings struct {
InFile string
Ch... |
6d40007226047dce485fc29866839c7f424a710a865eec20ee9dd8aadd68df88 | Go | 2,268 | 90 | package main
import (
"os"
"sort"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
var QuickOrthologTests = []struct {
TName string
QName string
GtfFile string
ChainFile string
ChromSizes string
O... |
99c4b4677d053b5092f7ac83dbad8b82ead210c74afaad27eae0020a6ff9ad02 | Go | 2,285 | 101 | package main
import (
"fmt"
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fasta"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/vcf"
)
// TODO add better testing once sam simulation code is done.
func TestCallVariants(t *testing.T) {
var er... |
760222197f5ee8909f069b176eb4eefdf2490e8f4f43607cbe17bbd33fcaee3c | Go | 2,295 | 80 | package main
import (
"strings"
"sync"
"testing"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/fasta"
"github.com/vertgenlab/gonomics/gtf"
"github.com/vertgenlab/gonomics/vcf"
)
func TestVcfEffectPrediction(t *testing.T) {
settings := &Settings{
Vcf: "../../gtf/testdata/te... |
8ff9574cb11fa30e7f07bbe18cce80481dbb4bca6921f3f5426686dbd4339a1b | Go | 2,306 | 81 | package genomeGraph
import (
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fastq"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/sam"
"log"
"os"
"runtime/pprof"
"sync"
"testing"
"time"
)
const Profile int = 0
func TestQuickMemPool(t *testing.T) {
var t... |
44e3aa2fd01b1fe52527dfb8dbdc84d2da815e1ac5d5c9216ed07a0dfbcdcd8d | Go | 2,308 | 74 | package ontology
import (
"github.com/vertgenlab/gonomics/bed"
"github.com/vertgenlab/gonomics/bed/bedpe"
"github.com/vertgenlab/gonomics/chromInfo"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/ontology/gaf"
"github.com/vertgenlab/gonomics/ontology/obo"
"log"
"os"
"testing"
)
va... |
2e6498a11964eda5b034cbe2e17719204ecc72e01685be667a1e073640772fff | Go | 2,311 | 70 | // Command Group: "Data Simulation"
// Returns a file of giraf alignments for a input genome graph
package main
import (
"flag"
"fmt"
"log"
"github.com/vertgenlab/gonomics/genomeGraph"
"github.com/vertgenlab/gonomics/giraf"
"github.com/vertgenlab/gonomics/sam"
)
func girafSimulate(graph *genomeGraph.GenomeGra... |
c89b0ae4a43f9d01f848c59452de219fab56899964c3241b76528a1585f65640 | Go | 2,320 | 81 | package main
import (
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/motif"
"os"
"testing"
)
var TfMatchCompTests = []struct {
InFile string
MatrixFile string
ChromName string
OutFile string
PropMatch float64
MatrixFileType str... |
d76026e805055cb8964c1280bea3ae6451b057c73404b4fb5cd2732b642c9f82 | Go | 2,337 | 58 | package numbers
import (
"math"
"github.com/vertgenlab/gonomics/numbers/logspace"
)
// BinomialDistLog returns log(BinomialDist), where log is the natural logarithm.
// This is ideal for very small probabilities to avoid underflow.
func BinomialDistLog(n int, k int, p float64) float64 {
coefficient := BinomCoeffi... |
e8d6557ba386efbca09109b60bdeed8869742272190dcc3afd2941ed71ca8ddc | Go | 2,343 | 89 | // Command Group: "Statistics & Population Genetics"
// Pseudorandomly selects variants from an input VCF file
package main
import (
"flag"
"fmt"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/numbers/parse"
"github.com/vertgenlab/gonomics/vcf"... |
fecaa055b1bede6ac8e39df8184b553c8accfce5591bb712c6e01d04e9dd7b47 | Go | 2,347 | 59 | package sketch
import (
"image/color"
)
// KellyPalette contains a set of high-contrast colors from:
// K. Kelly (1965): Twenty-two colors of maximum contrast. Color Eng., 3(6)
var KellyPalette = color.Palette{
color.RGBA{0xF2, 0xF3, 0xF4, 0xff},
color.RGBA{0x22, 0x22, 0x22, 0xff},
color.RGBA{0xF3, 0xC3, 0x00, 0x... |
829a04306cb060ccdfeabb801eb2ac488069f4cbe93c78fcc3146c8e570771ae | Go | 2,352 | 108 | package bgzf
import (
"bytes"
"crypto/md5"
"io"
"io/ioutil"
"os"
"testing"
)
var block1hash = [16]byte{3, 56, 205, 200, 44, 174, 95, 168, 153, 248, 173, 154, 105, 114, 7, 32}
var block2hash = [16]byte{218, 54, 146, 68, 164, 54, 39, 51, 148, 255, 120, 50, 109, 214, 29, 2}
func TestRead(t *testing.T) {
b := New... |
8cb96fbef93fd27f8d8acc24849fe7149536809815b13d2595d0f13df50679d7 | Go | 2,384 | 68 | package popgen
import (
"testing"
"github.com/vertgenlab/gonomics/bed"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/fasta"
)
var DunnTests = []struct {
B bed.Bed
Aln []fasta.Fasta
G []*Group
Realign bool
ExpectedDunn... |
2d4c2c0cff4df45d09ecd3619919f7d31b38986e6bf6340bb8198d48db7428eb | Go | 2,386 | 106 | package main
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/popgen"
)
var SelectionMcmcTests = []struct {
VcfFile string
OutFile string
ExpectedFile string
Iterations ... |
7da02549893ad2d7eea0c4b32d00e7e19766bfc133b4aafa003c6c00def1fc39 | Go | 2,399 | 82 | package main
import (
"flag"
"fmt"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/expandedTree"
"github.com/vertgenlab/gonomics/fasta"
"github.com/vertgenlab/gonomics/simulate"
"log"
"math/rand"
"os"
)
type GenicSettings struct {
TreeFile string
InFile string
OutFile ... |
a6b28f61b4d422617fd09ac89398404ade5dbe38b70553faa8df5531155ba1f4 | Go | 2,400 | 67 | package main
import (
"flag"
"fmt"
"github.com/vertgenlab/gonomics/bed"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fasta/pFasta"
"log"
"os"
)
// ExtractBedSettings defines the usage settings for the pFa extractBed subcommand.
type ExtractBedSettings struct {
InFile string
... |
14aab56b7cb51611b0b0c919b077cea0f4e8f705807dab3cbc2d29136250d64f | Go | 2,408 | 90 | // Command Group: "Deep Learning"
// Make deep learning prediction TSV files from input fasta format data
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"
)
t... |
29a0e241e92ce158bb688387033e709b5eabdeafc5ae7fe03dccfceeac031407 | Go | 2,414 | 71 | package main
import (
"flag"
"fmt"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fasta/pFasta"
"log"
"os"
)
// VcfToPfaSettings defines the usage settings for the pFa VcfToPfa subcommand.
type VcfToPfaSettings struct {
InFile string
RefFile string
OutDir string
Start int
En... |
7588e7ec28fe411da133bd8b2e422f8774bda9b42eb93f9631c98ccdc60718c6 | Go | 2,422 | 99 | package dnaThreeBit
import (
"log"
"strings"
"github.com/vertgenlab/gonomics/dna"
)
// RuneToThreeBitBase returns a single bases in ThreeBitBase format that corresponds to the given rune.
func RuneToThreeBitBase(r rune) ThreeBitBase {
switch r {
case 'A':
return A
case 'C':
return C
case 'G':
return G
... |
9c288659288d469ea15ebdfdfef25803eb64ed1d437c7563493145595f88b9ab | Go | 2,425 | 79 | package main
import (
"math/rand"
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
var samConsensusTests = []struct {
inFile string
refFile string
outFile string
multiFaDir string
su... |
61ff0bea3d37b6b15a5337198eb9d8241762d9dfe6c9b8def3267c1ba157f935 | Go | 2,439 | 59 | package main
// Example of JSON layout can be found in the link below
// http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/rest/v4/hsapiens/genomic/variant/chr1%3A878884%3AC%3AT,chr1%3A878917%3AT%3AA,chr1%3A878920%3AT%3AA,chr1%3A878991%3AGTGTT%3AG,chr1%3A879229%3AA%3AT,chr1%3A879231%3AA%3AC,chr1%3A879897%3AT%3AC,chr1%... |
6716107d378ce90f5577e1c634954db93ccecd818c68a50212b54e3fcc6eabbd | Go | 2,443 | 71 | // package fit contains tools for fitting statistical distributions to data.
package fit
import (
"github.com/vertgenlab/gonomics/numbers"
)
// Poisson fits an input slice of data points []float64 to a Poisson distribution, defined
// by the single parameter lambda, which is returned as a float64.
func Poisson(data... |
ed126c6e488ce1bedc783c3e8db028356afffe2b6430fc498acd8c24ad80fdd6 | Go | 2,463 | 68 | package main
import (
"github.com/vertgenlab/gonomics/exception"
"os"
"testing"
"github.com/vertgenlab/gonomics/fasta"
)
var FaFilterTests = []struct {
inputFile string
outputFile string
expectedFile string
name string
notName string
nameContains string
refPositions bool
s... |
d1aa8a911b17799385c3acebadb4c7039daf263f0d7a86ce249e46418423be79 | Go | 2,478 | 97 | package lift
import (
"sort"
"strings"
)
// allAreEqual returns true if two input slices of Lifts contain Lift entries that all return true for equal.
func allAreEqual(a []Lift, b []Lift) bool {
if len(a) != len(b) {
return false
}
for i := 0; i < len(a); i++ {
if !equal(a[i], b[i]) {
return false
}
}
... |
8258f69d65522bfdda665a3810281c5d6af13a3492ec14603e819b19075c8ae9 | Go | 2,493 | 95 | package numbers
import (
"math"
"testing"
)
var BinomialDistLogTests = []struct {
n int
k int
p float64
answer float64
}{
{20, 4, 0.6, -8.21825},
{20, 20, 0.6, -10.2165},
}
func TestBinomialDistLog(t *testing.T) {
for _, test := range BinomialDistLogTests {
calculated := BinomialDistLog(tes... |
08b19129b10835e3d756dd802ccd25db544f500ea4be8d81a76f702ab76778e0 | Go | 2,496 | 95 | package reconstruct
import (
"bufio"
"github.com/vertgenlab/gonomics/fasta/pFasta"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/wig"
"log"
"os"
"testing"
)
var IlsReconstructTests = []struct {
PostProbsFileName string
ReconsFileName string
ChromSizesFileName string
Precision... |
4d3e4be74d1e891d48f3961a5a6e4ae4eddc230b8b60133cb4b194628e9c0264 | Go | 2,497 | 58 | package maf
import (
"testing"
"github.com/vertgenlab/gonomics/dna"
)
var MafSLinesAreEqualTests = []struct {
a MafSLine
b MafSLine
expected bool
}{
{MafSLine{Src: "hg38.chr6_GL000254v2_alt", Start: 331, Size: 38, Strand: true, SrcSize: 4827813, Seq: dna.StringToBases("CTGTAGTCTGTCAGATATGGGTGGAGT... |
918ee94465463162f6fb8d047981be79a82631a95bd970abae25e2645abbfe20 | Go | 2,501 | 85 | package main
import (
"flag"
"fmt"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/motif"
"github.com/vertgenlab/gonomics/numbers"
"log"
"os"
)
// FilterSettings defines the usage settings for the pwmTools filter subcommand.
type FilterSetting... |
673e7e96ed18bebbf8d4d002702a78b5b1b7c71f5e78e38fca5a8ca458f8d523 | Go | 2,502 | 103 | package main
import (
"flag"
"fmt"
"github.com/vertgenlab/gonomics/bed"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"log"
"os"
"strings"
)
type Settings struct {
Mode string
InFile string
OutDir string
GzipOut bool
}
func bedSplit(s Settings) {
var err error
... |
b3f1123bd2d4fb33c493e1b59e171b8b1f22aae7e3ae3f33d23dd2b37d953a46 | Go | 2,504 | 87 | package bed
import (
"fmt"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"os"
"testing"
)
var TrimTests = []struct {
InFile string
ExpectedFile string
TrimLeft int
TrimRight int
}{
{InFile: "testdata/testTrim.bed",
ExpectedFile: "testdata/expectedTrim.bed"... |
2a2ab4f5318923826337c5d3bfcec161c6abe5ddfdac839169bd6f43b396a570 | Go | 2,505 | 70 | package main
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
var findAndReplaceColumnTests = []struct {
inFile string
inFileDelim string
findAndReplaceFile string
findAndReplaceDelim string
outFile string
expecte... |
9c66e38b2dc48d368b7ef524f74d66577b1ca907406a2a972ceb238011d6e2c2 | Go | 2,508 | 87 | // Command Group: "FASTA and Multi-FASTA Tools"
// Returns summary statistics to standard out for an input.fa, including the counts for each base.
package main
import (
"flag"
"fmt"
"log"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fasta"
"gi... |
51e105cd10aaf4013ad121e9b7ce14cd63fb855be9d9137f0e76555205cacdab | Go | 2,510 | 99 | // Command Group: "Data Conversion"
// Converts sam to bed
package main
import (
"flag"
"fmt"
"log"
"github.com/vertgenlab/gonomics/bed"
"github.com/vertgenlab/gonomics/chromInfo"
"github.com/vertgenlab/gonomics/convert"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"git... |
65f427524cde35ac3baf14b85cbe2cff61b14189d49f8bc135e29e722ba54159 | Go | 2,517 | 58 | package reconstruct
import (
"github.com/vertgenlab/gonomics/dna/pDna"
"github.com/vertgenlab/gonomics/fasta/pFasta"
"github.com/vertgenlab/gonomics/wig"
"log"
)
// IlsReconstructSeq takes in a list of posterior probabilities for n sequences and a list of n reconstructed pFasta sequences, and aggregates the pFast... |
7e5e264dc66ce35f5c4eac25a9c708eae16656043427227cc61588c3c455a760 | Go | 2,521 | 101 | package fileio
import (
"io"
"os"
"strings"
"testing"
)
var testfile string = "testdata/smallTest"
var line1 string = "#shhhh this line is a secret"
var line2 string = "Hello World"
var line3 string = "I am a gopher"
func TestNextLine(t *testing.T) {
file := EasyOpen(testfile)
l1, done := NextLine(file.BuffRea... |
d23e9b92ee12d8d61669408f34865df12b4d571d0f068667c530be84cd2615c0 | Go | 2,524 | 88 | package fastq
import (
"log"
"strings"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/dna/dnaTwoBit"
"github.com/vertgenlab/gonomics/fileio"
)
// FastqBig holds normal fastq info, as well as the reverse complement of the sequence
// and two rainbow tables where every possible offset of Seq... |
2a3073087302b4b84eccbd7a8750e1252db4efea01796bd1646f536178ffff43 | Go | 2,525 | 87 | // Package browser contains command line visualization tools for genomic information.
package browser
import (
"fmt"
"log"
"unicode/utf8"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/fasta"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/numbers"
)
// MultiFaVis... |
494e20e5cf672c505b653a3242b8b38e98ed9934e1ed594090eca26e7deb70bc | Go | 2,540 | 78 | //Package dnaTwoBit implements data structures for two-bit encoding of DNA sequences.
package dnaTwoBit
import (
"log"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/numbers"
)
// TwoBit is a struct that encodes DNA sequences in two-bit compressed format.
// Seq contains the sequence inform... |
304a5767b46bb5039727a9e076ddb11b1d6a9171a24c08af05030f1c28d3ea64 | Go | 2,544 | 81 | package main
import (
"flag"
"fmt"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fasta"
"github.com/vertgenlab/gonomics/fasta/pFasta"
"github.com/vertgenlab/gonomics/fileio"
"log"
"math/rand"
"os"
)
// SampleSettings defines the usage settings for the pFa sample subcommand.
type ... |
d50eadcbabbb537146d36ac08bb0f5a9e078f4cd614b7cb859f031cfbf41e064 | Go | 2,546 | 104 | package variant
import (
"testing"
"github.com/vertgenlab/gonomics/dna"
)
type MutatorTest struct {
Mutator
ExpectedSeq []dna.Base
}
var substitutionMutateTests = []MutatorTest{
{subTest1, subTest1ExpSeq},
{subTest2, subTest2ExpSeq},
{subTest3, subTest3ExpSeq},
{subTest4, subTest4ExpSeq},
{subTest5, subTes... |
eba32b31dff643fc5585d684696c7ce167fd56c8e6f1cc417e9d169f8bfdc46d | Go | 2,552 | 65 | package fasta
import (
"testing"
"github.com/vertgenlab/gonomics/dna"
)
var seqTwoA = dna.StringToBases("ACGTacgTCATCATCATTACTACTAC")
var seqTwoB = dna.StringToBases("acgtACGTACGT")
var seqTwoC = dna.StringToBases("ACGTACGTACGTT")
var allEqualTests = []struct {
dataOne []Fasta
dataTwo []Fasta
expected bool
}{... |
187bb2de9faeabfa88a2c788af3b7b214521eac54f80216b1ed73b08cb71fad0 | Go | 2,558 | 92 | package bed
import (
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fasta"
"github.com/vertgenlab/gonomics/fileio"
"os"
"testing"
)
var ToLowerTests = []struct {
InFastaFile string
InBedFile string
IgnoreExtraRegions bool
OutFile string
ExpectedFile ... |
a0374c5eb8d419d59460396ccbd6d1db6f57b281c960df86763b491ec46e6bc5 | Go | 2,569 | 117 | package obo
// AllAreEqual returns true if two input slices of Obo structs are identical.
func AllAreEqual(a map[string]*Obo, b map[string]*Obo) bool {
var foundInMap bool
if len(a) != len(b) {
return false
}
for i := range a {
if _, foundInMap = b[i]; !foundInMap {
return false
} else {
if !Equal(*a[i... |
e52d7f9f82d4d49f35e65dc61f947df3a15a3f7ed3b3c68dbb87df26e5e08663 | Go | 2,569 | 81 | package cigar
// Append merges a cigar into a slice, checking for consecutive cigars with the same operation.
func Append(alpha []Cigar, beta Cigar) []Cigar {
if len(alpha) > 0 && alpha[len(alpha)-1].Op == beta.Op {
alpha[len(alpha)-1].RunLength += beta.RunLength
} else {
alpha = append(alpha, beta)
}
return a... |
f17776d5dfdf95b0774d0ee8bd1a0c2d7b7d0f7f88ee99344054bea41744c4dd | Go | 2,572 | 85 | package dnaTwoBit
import (
"log"
"math/bits"
"github.com/vertgenlab/gonomics/numbers"
)
func CountRightMatches(one *TwoBit, startOne int, two *TwoBit, startTwo int) int {
const bitsPerBase int = 2
const bitsPerInt int = 64
const basesPerInt int = bitsPerInt / bitsPerBase
const ones uint64 = 0xFFFFFFFFFFFFFFFF... |
bae6760f1af1164bbf5d81acf38df98629d6a32d3e117da16ba03014f4d9d363 | Go | 2,584 | 86 | package main
import (
"math"
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
var FaFindFastTests = []struct {
InFile string
OutFile string
ExpectedFile string
FirstQueryName string
SecondQueryName ... |
144b46d92e750d1e9c1dcd7197d4a013ccb977399c7e26191b41ee371dc98e52 | Go | 2,590 | 62 | package dna
import (
"testing"
)
var compareTests = []struct {
a string // first input
b string // second input
expectedCaseSensitive int
expectedIgnoreCase int
expectedIgnoreCaseAndGaps int
expectedCaseSensitiveIgnoreGaps... |
58d271c0325a124a7164a0551c94e354e4507483b60e37b1369952f3c7cdb858 | Go | 2,598 | 95 | package vcf
import (
"strings"
"github.com/vertgenlab/gonomics/dna"
)
// GVcf stores genotype information, but is currently being deprecated.
type GVcf struct { //TODO: Uncommented for now, but this struct needs to be removed soon.
Vcf
Seq [][]dna.Base
Genotypes []Sample
}
// SampleHash stores index and ... |
912a65ed9dcae775801c7462576827e0cba2c77c1c9bf1564f08fdb0ac4f5fb8 | Go | 2,605 | 73 | package main
import (
"flag"
"fmt"
"github.com/vertgenlab/gonomics/dna/pDna"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fasta/pFasta"
"github.com/vertgenlab/gonomics/wig"
"log"
"math"
"os"
)
// EntropyTrackSettings defines the usage settings for the pFa entropyTrack subcommand... |
260abd2ceb441e749980eb8963cf6b2f348baad382ebd170d97c3673f8fa6fcc | Go | 2,614 | 69 | package main
import (
"fmt"
"os"
"strings"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
var MergeSortTests = []struct {
InFile string
InFileR2 string
OutFile string
OutFileR2 string
ExpectedFile string
ExpectedFileR2 ... |
d58ac3ec5c141df68858d7bb0c4705cdcd64c3c04d1863556ecc5b8afb9f5b30 | Go | 2,617 | 93 | package sam
import (
"math"
"testing"
)
func TestSeekBamRegion(t *testing.T) {
br, _ := OpenBam("testdata/rand.bam")
bai := ReadBai("testdata/rand.bam.bai")
reads := SeekBamRegion(br, bai, "chr7", 45000000, 45200000)
for i := range reads {
if reads[i].RName != "chr7" || !(reads[i].GetChromStart() < 45200000 &... |
2c6336c47a5336dff99d6862bea9bc4b8328eb322304d66bb48c03a64d61aa74 | Go | 2,620 | 89 | package motif
import (
"io/ioutil"
"os"
"testing"
)
func createTempFileWithContent(t *testing.T, content string) (filename string) {
t.Helper()
tmpFile, err := ioutil.TempFile("", "motif_test_*.tsv")
if err != nil {
t.Fatalf("Failed to create temp file: %v", err)
}
defer tmpFile.Close()
_, err = tmpFile.W... |
25f381d1d38496db4e4e56bbb38002f62d056968a32cca89f0b04426dbc238e9 | Go | 2,627 | 77 | // Command Group: "FASTA and Multi-FASTA Tools"
// Bins fastas into a minimum size group with either a single record or multiple records from a size ordered chrom.sizes file
package main
import (
"flag"
"fmt"
"log"
"path/filepath"
"strings"
"github.com/vertgenlab/gonomics/fasta"
"github.com/vertgenlab/gonomic... |
54f992360ae43eaaabcb889d901e7954edd0839cdda1c8c69ce877b6fe63ee03 | Go | 2,627 | 98 | // Package align provides basic struct(s), gap scoring matrices, and dynamical approaches to aligning sequences
package align
import (
"math"
)
var veryNegNum int64 = math.MinInt64 / 2
// these are relative to the first seq.
// e.g. ColI is an insertion in the second seq, relative to the first.
type ColType uint8
... |
994895fcd5682dd4a551e5076cbd7e31ea7c2c1157efcb0cded1dcfba59f619b | Go | 2,637 | 80 | package vcf
import (
"testing"
"github.com/vertgenlab/gonomics/chromInfo"
)
func expectedHeader() Header {
var h Header
h.FileFormat = "VCFv4.3"
h.Chroms = map[string]chromInfo.ChromInfo{
"chrA": {Name: "chrA", Size: 10, Order: 0},
"chrB": {Name: "chrB", Size: 20, Order: 1}}
h.Filter = map[string]FilterHea... |
29d9c296e22f685f036c031fad4bdc7d1a6edc001ed89ab5f1c0a102dbae195e | Go | 2,651 | 129 | package main
import (
"io/ioutil"
"testing"
"github.com/vertgenlab/gonomics/dna"
"github.com/vertgenlab/gonomics/dna/dnaTwoBit"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/genomeGraph"
"github.com/vertgenlab/gonomics/giraf"
)
func TestGir... |
1ae6178a371ab38d2cbf970b06609acc293dde46c513fd54b909d176687e2af7 | Go | 2,669 | 146 | package fasta
import (
"testing"
)
func TestGoReadToChan(t *testing.T) {
for _, test := range readWriteTests {
stream := GoReadToChan(test.filename)
actual := make([]Fasta, 0, len(test.data))
for val := range stream {
ToAppend := val
actual = append(actual, ToAppend)
}
if !AllAreEqual(test.data, act... |
c746330b46ff5c48fda0763cfc3fe49d35eed417b21964f971a4207b044dc8df | Go | 2,676 | 94 | package binaryGiraf
import (
"github.com/vertgenlab/gonomics/exception"
"io"
"sync"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/genomeGraph"
"github.com/vertgenlab/gonomics/giraf"
)
// Read will input a giraf.fe file and will decompress into a slice of giraf.Giraf.
// Requires the g... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.