sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
713ff3a12e1576afb8e7ee2318826c2c43e102540bb1c3c088036d8bc1908607
Go
863
28
package interval import ( "testing" "github.com/vertgenlab/gonomics/bed" ) func TestMergeIntervals(t *testing.T) { var testIntervals []Interval = []Interval{ &bed.Bed{Chrom: "1", ChromStart: 1, ChromEnd: 8}, &bed.Bed{Chrom: "1", ChromStart: 3, ChromEnd: 5}, &bed.Bed{Chrom: "1", ChromStart: 4, ChromEnd: 4}, ...
43dd7c0b96ab696e1a7628e417c6f4691d191418ffa7b20e41c13c2fada83ff7
Go
865
34
// Command Group: "General Tools" // View http url links and print data stream to stdout package main import ( "flag" "fmt" "log" "github.com/vertgenlab/gonomics/fileio" ) func usage() { fmt.Print( "goFetchCat - view http url links and print data stream to stdout\n Usage:\n ./goFetchCat link.com/file.txt\n...
9276c9eae2660d8df8a4188b5afed0141aa8943a4297692ecb6ecabffdbec017
Go
868
42
package main import ( "flag" "fmt" "log" ) func usage() { fmt.Printf( "samInfo - a collection of tools for extracting information from SAM/BAM files." + "Usage:\n" + "\tsamInfo readLength in.sam/bam out.txt\n" + "\tOR\n" + "\tsamInfo coverage in.sam/bam histogram.txt statSummary.txt\n" + "\tOR\n"...
783ab72419bba379964ecd6ffbf7cf10e8a60d6833e625a7a964ebf0855c1845
Go
879
37
package bed import ( "io" ) // Current methods satisfy requirements for the following interfaces: // bed.BedLike // GetChrom returns the chrom of the bed struct. func (b Bed) GetChrom() string { return b.Chrom } // GetChromStart returns the starting coordinates of the bed struct. func (b Bed) GetChromStart() int ...
b02e28db273d1346d123187398f2f31196234d6ce65c3414e8ad235b0e39aab2
Go
879
36
package main import ( "fmt" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/vcf" "os" "testing" ) var SampleVcfTests = []struct { inputFile string expectedOutputFile string numVariants int numSamples int }{ {"testdata/babyTest.vcf", "testdata/babyTest_expec...
da33616d47ea2451f0f16a1cc5040f196b89c5e00584a5ce9566ca80258accde
Go
881
39
package chain import ( "io" ) // GetChrom returns the name of the target chromosome func (ch Chain) GetChrom() string { return ch.TName } // GetChromStart returns the starting position on the target chromosome func (ch Chain) GetChromStart() int { if ch.TStrand { return ch.TStart } else { return getSwapTCoor...
f7c8767bfe000a18ca81690499e8e9078176113d38c7b8bec3727e6105657a6d
Go
884
44
// Command Group: "Sorting" // Topologically sorts nodes in a genome graph (.gg) file package main import ( "flag" "fmt" "log" "github.com/vertgenlab/gonomics/genomeGraph" ) func usage() { fmt.Print( "sortGraph - Topologically sorts nodes in a genome graph (.gg) file. \n" + "Usage:\n" + " sortGraph inp...
056f2eb5be92d2e66f40370c02d2af616ca6ccacf92a0e7cc4d623cd8e1bf028
Go
891
32
package main import ( "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "os" "testing" ) var digestGenomeTests = []struct { inFile string outFile string expectedFile string motif string }{ {"testdata/in.fa", "testdata/out.MboI.bed", "testdata/expected.MboI.b...
6b3f205efd60027c6628e1a3dd792128a53a242996513805a08aae17010cd0c0
Go
892
45
package lift import ( "testing" ) var TotalSizeTests = []struct { filename string expected int }{ {"testdata/elements1.bed", 460}, {"testdata/elements2.bed", 6}, } func TestTotalSize(t *testing.T) { var b []Lift var actual int for _, v := range TotalSizeTests { b = GoRead(v.filename) actual = totalSize(b...
3403932249821ac85724b6bd71a99b7c80dc31d7533a273970c2ff38aa03d702
Go
900
34
package main import ( "os" "testing" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" ) var mafToMultiFaTests = []struct { mafFile string refFile string speciesFile string outMultiFaFileExpected string noMask bool }{ ...
10b9622fdebcff4641049445b5816d0ee8887b232f648aaa18700640dda8b5ea
Go
901
34
package numbers import ( "math" "testing" ) var highestDensityIntervalTests = []struct { Trace McmcTrace Start float64 End float64 Mean float64 Proportion float64 }{ {McmcTrace{Parameter: []float64{0.1, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 20.0}}, 2.0, 9.0, 6.41, 0.8}, } func TestHi...
c363073dba8443dcc7bba2638545a3a897e899225cc077af77cec852c8c4ef5b
Go
906
51
package numbers import ( "testing" ) func TestIntToRoman(t *testing.T) { testCases := []struct { input int expected string }{ {1, "I"}, {3, "III"}, {4, "IV"}, {9, "IX"}, {58, "LVIII"}, {1994, "MCMXCIV"}, {3994, "MMMCMXCIV"}, } for _, test := range testCases { result := IntToRoman(test.inp...
151338c9e616fa6bf1d12edacf3312f204e0796c23c9b9848f3f753f5671d784
Go
907
38
package wig import ( "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "os" "testing" ) var ReadWholeGenomeTests = []struct { InFile string ChromSizeFile string DefaultValue float64 OutFile string ExpectedFile string }{ {InFile: "testdata/wholeGenome.wig", C...
3a196f256922a54acbb414b0d72909eb160480c782a1882645bf26e3130c482e
Go
909
31
package fasta import ( "strings" "github.com/vertgenlab/gonomics/chromInfo" ) // IsFasta returns true if the input filename has a fasta file extension. // Input filename may have a .gz suffix. func IsFasta(filename string) bool { if strings.HasSuffix(filename, ".fasta") || strings.HasSuffix(filename, ".fa") || ...
928983e1a871969b36b85680b525ea4027e3f4191ed0c47a2d098aa484929643
Go
909
35
package main import ( "os" "testing" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" ) var SimulateBedTests = []struct { RegionCount int SimLength int MatchedBed string NoGapFile string OutFile string SetSeed int64 ExpectedFile string }{ {10, 1000, ""...
99182543be6399a3bd23ba0b194f695c41b62875840bcde980352d638a2f2af7
Go
914
43
package main import ( "flag" "fmt" "github.com/vertgenlab/gonomics/ontology/obo" "log" ) func oboToDot(oboFile string, term string, output string) { oboRecords, _ := obo.Read(oboFile, false) obo.SubtreeToDot(output, term, oboRecords) } func usage() { fmt.Print( "oboToDot takes in an obo file and the id bel...
63734715140811bb7fc20f6f98d0231fdf6182ee675f282898d3edefc6e367a7
Go
915
34
package main import ( "os" "testing" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" ) var DunnIndexTests = []struct { InputBed string InputFa string InputGroup string OutFile string ExpectedFile string Realign bool }{ {"testdata/test.bed", "testdata...
cdfbf49a224be32bd8eb4fe69bed2d694e566ca5a89dd1cb44bc9bdf777d012f
Go
922
36
package main import ( "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fasta" "os" "testing" ) var RandSeqTests = []struct { outFile string expectedFile string GC float64 numSeq int lenSeq int setSeed int64 }{ {"testdata/test.fa", "testdata/expected...
0524e2b9d3b995f465d6a36c76a424ca5e2305e90c30fc81a320051fe5be8d67
Go
924
37
package fileio import ( "bufio" "fmt" "github.com/klauspost/pgzip" "net/http" "strings" "github.com/vertgenlab/gonomics/exception" ) // EasyHttp will fetch data from files uploaded to an internet server and stream data into EasyReader. func EasyHttp(url string) *EasyReader { answer := EasyReader{} resp, err ...
43d33d6554538fe879baa4f6ffd67087ba2a1861114a851c5e7447aa3cb99c33
Go
931
40
package main import ( "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "os" "testing" ) var OboToolsMappingTests = []struct { InFile string OutFile string Force bool ExpectedFile string }{ {InFile: "../../ontology/obo/testdata/test.obo", OutFile: "te...
7b7214f93f46581b0bbbcba0e1d43531592a8d4900a9449869935949b0b5acb2
Go
931
40
package main import ( "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "os" "testing" ) var bedCountBamTests = []struct { inBam string inBed string outFile string expFile string normalize bool }{{ "testdata/in.sort.bam", "testdata/in.bed", "testdata/out.txt", "t...
a4dc09457e01fb033ea8c68df4d3b7042d170c3b50d50fc8a8ad1a76df850f69
Go
936
35
package gaf import ( "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "os" "testing" ) func TestReadAndWrite(t *testing.T) { var err error actual, header := Read("testdata/test.gaf") Write("testdata/out.gaf", actual, header) if !fileio.AreEqual("testdata/out.gaf", "testdata/t...
684c336889e133e87bbb47b126bc7e621c0d4aa322d91b932ef91e33077e4a34
Go
939
41
package wig import ( "github.com/vertgenlab/gonomics/exception" "os" "testing" "github.com/vertgenlab/gonomics/fileio" ) var SmoothTests = []struct { InFile string ChromSizes string OutFile string WindowSize int Missing float64 ExpectedFile string }{ {InFile: "testdata/unsmooth.wig", ...
44ea70e2543b8f418e30893509448beee4fb7da540b0cdf42a02fba14f293c2e
Go
944
31
package bed import ( "log" "testing" ) var r1 Bed = Bed{Chrom: "chr1", ChromStart: 1, ChromEnd: 2} var r2 Bed = Bed{Chrom: "chr1", ChromStart: 4, ChromEnd: 5} var r3 Bed = Bed{Chrom: "chr1", ChromStart: 10, ChromEnd: 11} var r4 Bed = Bed{Chrom: "chr1", ChromStart: 12, ChromEnd: 14} var querySlice []Bed = []Bed{r1,...
3d4031fdafcba0cd26aa7af488a369d188a0b2b288e33e717e0b3105bfa2747d
Go
946
32
package simulate import ( "math/rand" "os" "testing" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fasta" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/numbers" "github.com/vertgenlab/gonomics/sam" ) func TestSam(t *testing.T) { var err error rand.Seed...
dcaeba37b9115841b69a17ee6db60f340a3347ee737f8eb00cf7c36be5f91540
Go
946
26
package genomeGraph /* import ( "github.com/vertgenlab/gonomics/chromInfo" "github.com/vertgenlab/gonomics/fastq" "github.com/vertgenlab/gonomics/giraf" "github.com/vertgenlab/gonomics/sam" //"github.com/vertgenlab/gonomics/align" "log" "os" "sync" "testing" "time" ) //TODO: finish writing matrix helper fu...
e104a7f91e8c38f0646b74e90f9adba5a2980f58156f54dcbf7a81181a78641f
Go
946
42
package main import ( "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "os" "testing" ) var FilterTests = []struct { InFile string ChromSizes string OutFile string ExpectedFile string Chrom string }{ {InFile: "testdata/filter/in.filter.wig", ChromSizes...
a008cf975ad7f9baf3a71f49c7816b85e081d3ea368588364ecb613b7a051489
Go
966
51
package numbers import ( "log" "golang.org/x/exp/constraints" ) // Max returns the maximum of two input values of an ordered type. func Max[E constraints.Ordered](a, b E) E { if a > b { return a } return b } // Min returns the minimum of two input values of an ordered type. func Min[E constraints.Ordered](a,...
1d1eb970d6da6aec1d4b224be25756cbca991392d4c6432c90e5e8d3b363dd18
Go
971
40
package main import ( "os" "testing" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" ) var ScCountTests = []struct { InFile string OutFile string ExpectedFile string GeneFile string ExpNormalizationFile string }{ {"testdata/t...
b7fda60d23f82634d218fcc7168b1aba32862b8a8f7e02ca535abbc907ef81ee
Go
973
40
package bedpe import ( "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/numbers" ) func AllAreEqual(a []BedPe, b []BedPe) bool { if len(a) != len(b) { return false } for i := range a { if !Equal(a[i], b[i]) { return false } } return true } ...
ffeb993fdce169e3c809dc89fc6c4c409713ef39fce3cae0d2dfb89e937ac509
Go
977
33
package main import ( "os" "testing" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" ) var BedMinimumDistanceNameTests = []struct { inputBed string genomeBed string outputBed string expectedBed string }{ {"testdata/inputBed1.bed", "testdata/genomeBed1.bed", "testdat...
63fdffc1e240399df3856af561bcfe819f65f457b092280caa84e58bcd91e5d2
Go
992
36
package main import ( "os" "testing" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" ) var geneIdToNameTests = []struct { geneNameTable string in string out string ncbi bool ensembl bool keepMatching bool expectedFile string }{ {"te...
08988d034fd6a969db24bbbf03663d99206b2d810e912581f11e8c1a8c390cf0
Go
994
49
// Command Group: "Motif Tools" // A collection of tools for manipulating position matrices package main import ( "flag" "fmt" "log" ) func usage() { fmt.Printf( "pwmTools - a collection of tools for manipulating position matrices.\n" + "Usage:\n" + "\tpwmTools filter in.pwm out.pwm\n" + "\tOR\n" + ...
9f0ae48808c986ef283ab1a60bd66364b493e3cfc3b368fd0852c304192228b2
Go
1,003
44
// Command Group: "Sequence Evolution & Reconstruction" // Generates a newick tree file from an input dot format tree package main import ( "flag" "fmt" "github.com/vertgenlab/gonomics/tree" "log" ) func dotToNewick(inFile string, outFile string, verbose bool) { t := tree.ParseDot(inFile, verbose) tree.WriteNe...
7b6214dce814c05ec483cca11f913b7f1866e368f9f494154ca148a3cd7134e5
Go
1,012
56
package giraf import ( "strings" "github.com/vertgenlab/gonomics/cigar" "github.com/vertgenlab/gonomics/dna" ) func isEqual(a *Giraf, b *Giraf) bool { if strings.Compare(a.QName, b.QName) != 0 { return false } if a.QStart != b.QStart { return false } if a.QEnd != b.QEnd { return false } if a.PosStran...
75c8e9369339899dd8c55ffb70d83783d65b12d57eac527748bbe00e542c320c
Go
1,016
47
package fit import "testing" var LagrangeInterpolationTests = []struct { queryX float64 dataPoints [][]float64 expectedY float64 }{ { //first parabola is y=x^2 + 1 queryX: 0.5, dataPoints: [][]float64{ {1.0, 2.0}, {2.0, 5.0}, {3.0, 10.0}, }, expectedY: 1.25, }, { // next is linear interpol...
83d1af2c6e78cf9667b477f0b42524f9a58bc0e0fd367d778d3446e2206d9209
Go
1,025
56
package convert import ( "strings" "testing" ) var ChromNameTests = []struct { Ucsc string Ensembl string }{ {"chr1", "1"}, {"chr2", "2"}, {"chr3", "3"}, {"chr4", "4"}, {"chr5", "5"}, {"chr6", "6"}, {"chr7", "7"}, {"chr8", "8"}, {"chr9", "9"}, {"chr10", "10"}, {"chr11", "11"}, {"chr12", "12"}, {"c...
d1d3818fb1ab3c1d51dcf0cda444837a82890fbb6610de427d563ed2a523a6f6
Go
1,025
49
package fasta import ( "testing" "github.com/vertgenlab/gonomics/chromInfo" ) func TestIsFasta(t *testing.T) { if !IsFasta("test.fa") { t.Errorf("Problem is IsFasta") } if !IsFasta("test.fa.gz") { t.Errorf("Problem is IsFasta") } if !IsFasta("test.fasta") { t.Errorf("Problem is IsFasta") } if !IsFasta...
ac2e957fa92eea0f225194d167fea343f2d3c0b4c3eab969df879212804de352
Go
1,036
39
package sam import ( "testing" "github.com/vertgenlab/gonomics/cigar" "github.com/vertgenlab/gonomics/dna" ) func TestEqual(t *testing.T) { if !Equal(r001, r001) || // find tested records in io_test.go Equal(r001, r002) || Equal(r001, r001Supplemental) || Equal(r003, r002) || !Equal(r002, r002) || Equa...
12add1ae0f4fe0a48f8bff9e492e7ed99785f184d8de7e6109d077c7f6f09901
Go
1,053
46
// Command Group: "Sequence Evolution & Reconstruction" // Simulate sequence evolution on an input fasta from the root of a newick tree to the leaf nodes package main import ( "flag" "fmt" "log" ) func usage() { fmt.Print( "simulateEvol - a suite of tools for molecular evolution simulation.\n" + "Select a s...
bd0ebc1ed5c7fc6fea2c1218d008185673093a8cf9cefa8e87a2c33243798155
Go
1,053
30
package sam import ( "testing" "github.com/vertgenlab/gonomics/dna" ) var singleCellTests = []struct { InFile string ExpectedBx []string ExpectedUmi []string }{ {"testdata/singleCell.sam", []string{"AGTGCACGTGGAGGCT", "AGTGCACGTGGAGGCT", "AGTGCACGTGGAGGCT", "GGACAGTTAGACAAGT", "GCTAGGACAATGAGTA", "CAGGAC...
47552aec51a0e947c56f8d4a3ee4184b11f6127bf8612f55a86d6154a807f058
Go
1,067
28
package dnaThreeBit import ( "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/numbers" ) // NewThreeBitRainbow builds a "rainbow table" of a sequence in ThreeBit format // with every possible offset, so that there is always a version of the sequence // that can be compared to another ThreeBit se...
878b9c29d7a3268ef6edd28252ddb1086f5355795068cce19a9d0d082ddaca8e
Go
1,085
44
package main import ( "os" "testing" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" ) var BedGcContentTests = []struct { BedFile string FaFile string OutFile string ExpectedFile string MultiFaMode bool Species string }{ {BedFile: "testdata/test.bed...
8e8f6d62a593f47c83ebfb808d1865d0d2d46342199508d6f0a78a00df26bd06
Go
1,087
45
package main import ( "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "os" "testing" ) var WigStatsTests = []struct { InputNoGapBed string ChromSizes string InputWig string OutputFile string ExpectedFile string MissingDataValue float64 }{ {Input...
cd37f791d34ddc94b2188850bce628b2491d3dfbecd7e8d753efe5854a1a1635
Go
1,100
42
package main import ( "os" "testing" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" ) var BedMathTests = []struct { Afile string Bfile string Outfile string ExpectedFile string Op string }{ {"testdata/testA.bed", "testdata/testB.bed", "testda...
bf4b8463e64bb7ad5f5cf2a2d566d33b16a9834d24fc7f5e6cfbdf05423c6a68
Go
1,101
35
package numbers import ( "fmt" "github.com/vertgenlab/gonomics/fileio" ) // Plot returns the values of a function(float64) float64 between a left and right bound for a specified number of bins. // the answer is written to a file as a CSV for subsequent visualization. // Half-closed interval [left, right). func Plo...
0f8b6c5251b8d9e5987f4b8222e19825c7351cbb387738514faa61d3b7ccf3fa
Go
1,110
38
package align import ( "testing" "github.com/vertgenlab/gonomics/fasta" ) var multiAlignTests = []struct { input string expected string }{ {"testdata/multiAlignTest.in.fa", "testdata/multiAlignTest.expected.fa"}, {"testdata/multiAlignTest.in2.fa", "testdata/multiAlignTest.expected2.fa"}, } func TestMultiAl...
d2806b50bf81ba706c851ad73e08fb9c88978f4470a087f29b1d00f21cec4041
Go
1,110
49
package main import ( "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "os" "testing" ) var BedShearTests = []struct { InFile string OutFile string ExpectedFile string FragmentSize int }{ {InFile: "testdata/test.bed", OutFile: "testdata/tmp.1.bed", Expect...
87946d98884a2e48e6e44333902e9e234bbed663cd30c5b5b7236a6b0020b5ae
Go
1,113
37
package main import ( "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "os" "testing" ) var MaqqTests = []struct { infile string outhistogram string bedregions string expected string }{ {infile: "testdata/mapq/test1.sam", outhistogram: "testdata/mapq/out.hist.txt...
4ebf941ae90f48da3310975392997e37210e7037b39f184a7930da15aa6af660
Go
1,117
50
package pFasta import ( "github.com/vertgenlab/gonomics/fileio" "math/rand" "testing" ) var RandSeqTests = []struct { Length int Name string SeedSet bool SetSeed int64 RandSource *rand.Rand Expected string OutFile string Precision float32 }{ {Length: 5, Name: "chr1", SeedSe...
030e23973c03bb982eaae4c2e731febf292bcb022166ad004d487c0a14e3d5cd
Go
1,134
53
package main import ( "os" "testing" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" ) var FaToPredictSetTests = []struct { InFile string OutFile string ExpectedFile string WindowSize int Stride int WithRevComp bool }{ {InFile: "testdata/test.fa", O...
c62555906af4dae084bd1a8edab69614477b8fcd247f7dd4870bbb87c1eb3630
Go
1,137
24
package genomeGraph //"github.com/vertgenlab/gonomics/dna" //"github.com/vertgenlab/gonomics/fastq" //"log" //"testing" //TODO: consider dot format to graph // --> node_1 --> node_4 //node_0 --> node_3 --> node_6 // --> node_2 --> node_5 //TODO: The function this te...
c41cea3250e4c38a43bb0deab5ac5d2502c848c1d101401ba8335a31d96f7028
Go
1,139
53
// Command Group: "FASTA and Multi-FASTA Tools" // Filter a maf file to remove entries below a score threshold package main import ( "flag" "fmt" "log" "github.com/vertgenlab/gonomics/maf" ) func mafFilter(inFile string, outFile string, threshold float64) { mafRecords := maf.Read(inFile) var outMaf []*maf.Maf...
fc4fc162b62d38b54ec51d42874a2cafaee7268d669ff2aab43325ae75867773
Go
1,141
27
package genomeGraph import ( "sync" "github.com/vertgenlab/gonomics/cigar" "github.com/vertgenlab/gonomics/fastq" "github.com/vertgenlab/gonomics/sam" ) // this is just for speed testing to see how much of the speed slowdown is due to alignment time. func gswNothingWorker(gg *GenomeGraph, seedHash map[uint64][]u...
37b75e40057861d3c7560e4d2bddf4d52b76ed339420812a7e36b37678737f1d
Go
1,142
38
package align import ( "testing" "github.com/vertgenlab/gonomics/dna" ) var alignTests = []struct { seqOne string seqTwo string aln string }{ {"ACGT", "ACGT", "ACGT\nACGT\n"}, {"ACGT", "CGT", "ACGT\n-CGT\n"}, {"ACGT", "ACG", "ACGT\nACG-\n"}, {"CGT", "ACGT", "-CGT\nACGT\n"}, {"ACG", "ACGT", "ACG-\nACGT\n...
ca9126e955c458cea005e06335ff93c1222a11699bc92ec36141db272c5d0da5
Go
1,149
58
package gtf import ( "testing" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/vcf" ) func TestVcfToVariant(t *testing.T) { var inVcf vcf.Vcf var inGtf map[string]*Gene = make(map[string]*Gene) var inSeq map[string][]dna.Base = make(map[string][]dna.Base) inVcf.Chr = "DummyChr" inVcf.Re...
a59b8f8e081979fd4dd8b6043311e05bff6affd40c2fb1952963c0dfca3d40d2
Go
1,156
49
package pFasta import ( "github.com/vertgenlab/gonomics/fileio" "testing" ) var vcfToPfaTests = []struct { InputVcf string RefFa string Start int End int Expected string Output string Precision float32 }{ {InputVcf: "testdata/test_vcfToPfa_input_1.vcf", RefFa: "testdata/test_vcfToPf...
2edc0220f0be5d1067d9723ccd2d4f9f90f52b21f719cd2a8ef5a1c5524dc031
Go
1,157
30
package fit import "log" // LagrangeInterpolation returns f(queryX) for a given queryX. The function f(x) is // estimated by Lagrange Interpolation using a set of input dataPoints in [][]float64 format, // each data point is a []float64 with two elements, the first value is the x value and the // second value is the ...
19dfb418233d45d6bfdf529e04eaae183b6489cab314de1d1f52417307144e45
Go
1,158
70
package psl import ( "golang.org/x/exp/slices" ) // Equal will check two psl structs and compare every single field of data to determine if they are the same. func Equal(x, y Psl) bool { if x.Match != y.Match { return false } if x.MisMatch != y.MisMatch { return false } if x.RepeatMatch != y.RepeatMatch { ...
528d78c23f4c7fc614fdd3842a3161f7f384ecb22059dc92650153d2446d0f0f
Go
1,168
55
package vcf import ( "bytes" "testing" ) func TestWriteVcf(t *testing.T) { // Create a Vcf struct for testing record := Vcf{ Chr: "1", Pos: 1234567, Id: "rs123456", Ref: "A", Alt: []string{"G", "T"}, Qual: 99.0, Filter: "PASS", Info: "DP=100", Format: []string{"GT", ...
a38db2244b0b277223b5e248e154adf27373a50c2dd1b962345b8fb4d5ccef5a
Go
1,169
47
package main import ( "io/ioutil" "testing" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/giraf" ) func TestGirafSort(t *testing.T) { graphFile := "../../sort/testdata/mini.gg" readsFile := "../../sort/testdata/miniReads.giraf" outFile, err...
950b52b7cfa15717b2ffe992e2a3437b6bb476ebffb961b36d777a0170bfc68c
Go
1,170
52
// Command Group: "WIG Tools" // a collection of tools for manipulating Wig files. package main import ( "flag" "fmt" "log" ) func usage() { fmt.Printf( "wigTools - a collection of tools for manipulating Wig files.\n" + "Usage:\n" + "\twigTools peaks in.wig chrom.sizes out.bed\n" + "\twigTools filter ...
cd53c85b10016d04f47108943d708d1a022689c96773f5dd12cefb6b50488eb3
Go
1,177
48
package psl import ( "testing" ) var psldata Psl = Psl{ Match: 261, MisMatch: 54, RepeatMatch: 23, Ns: 0, QNumIns: 1, QBaseIns: 1, TNumIns: 0, TBaseIns: 0, Strand: "+-", QName: "NM_001001576", QSize: 376, QStart: 2, QEnd: 345, TName: "c...
364ac14a87ae46dae9af493ff94ee0c8251bd94fd1d90189f6f8a17fc4c7ad16
Go
1,179
45
package main import ( "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/wig" "os" "testing" ) var entropyTrackTests = []struct { InFile string OutFile string ChromSizes string ExpectedFile string DefaultValue float64 }{ {InFile: "testdata/test_sample_input.pfa", OutFi...
5b9586d03c7ba3cfe739de7f90ea0268cafc99ab1ffbc226ae08362622986d79
Go
1,189
45
package main import ( "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "os" "testing" ) var FastqReplaceSeqTests = []struct { inFile string outFile string expectedFile string findReplaceFile string findReplaceDelim string ignoreCase ...
d6d8a4e703449d936e75cf83adbe76eadba712f9b7ea22ec2afe61d4403ce066
Go
1,192
28
package sam import ( "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/cigar" "github.com/vertgenlab/gonomics/dna" "testing" ) func TestSamBedToBases(t *testing.T) { var obs []dna.Base rec := []Sam{ {RName: "chrA", Pos: 101, Cigar: cigar.FromString("10M"), Seq: dna.StringToBases("AACCTTGGAA...
03d5aaa2c02e470bc768408c68888895a1fe9994f60e34e16549f17627d7d935
Go
1,199
72
package sam import ( "bytes" "errors" "fmt" "io" "io/ioutil" "os" "strings" "testing" ) func TestBamWriter(t *testing.T) { var err error err = testFile("testdata/small.sam") if err != nil { t.Error(err) } } func TestBamWriterAuxTags(t *testing.T) { var err error err = testFile("testdata/auxTagTest.sa...
e44ae798214f0bfaea67b5557ee5087b746acb66b2b5ba229316e62c058330e4
Go
1,203
43
package bed import ( "os" "testing" ) var b1 Bed = Bed{Chrom: "chr1", ChromStart: 100, ChromEnd: 200, Name: "First", Score: 1, Strand: '+', FieldsInitialized: 6} var b2 Bed = Bed{Chrom: "chr2", ChromStart: 400, ChromEnd: 900, Name: "Second", Score: 5, Strand: '-', FieldsInitialized: 6} var b3 Bed = Bed{Chrom: "chr3...
e065924d60c74189da620978890957e2a396cffd76f8e612deceebfcd48cd08c
Go
1,215
46
package main import ( "os" "testing" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" ) func TestSimPcr(t *testing.T) { template := "testdata/test.fasta" primers := []string{ "GCCTCCGTGAGGCTAC", "TTGAGGATCTTTTCTTCACG", } simulatePcr(primers, template, "testdata/actual1.b...
ddd5a6ddcd5ef163bfece1429b40c48a7262e32bff03c5e7787f268136e1e90d
Go
1,219
37
package vcf import ( "strings" "testing" ) var IG1 Sample = Sample{[]int16{1, 0}, []bool{false, false}, []string{""}} var IG2 Sample = Sample{[]int16{0, 0}, []bool{false, false}, []string{""}} var IG3 Sample = Sample{[]int16{1, 1}, []bool{false, false}, []string{""}} var EG1 Sample = Sample{[]int16{0, 1}, []bool{f...
69e64d8697697d92dff6b8c6aa25e6124cb82e9a52cb6e9a2f8b22a605ffdc43
Go
1,220
45
package tree import ( "image/png" "os" "testing" ) var treeDrawTests = []struct { treeText string tmpFilename string }{ {"(human,chimp)ancestor;", "testdata/tmp.1.png"}, {"((human,chimp)humanChimpAncestor,rhesus);", "testdata/tmp.2.png"}, {"(((human,chimp),(mouse,rat)),dog);", "testdata/tmp.3.png"}, {"((p...
3feb803109fb41f4623eec6055ed41d051750f5f1acaba2cb7674225d9abd0ed
Go
1,229
42
package vcf import ( "log" //DEBUG: "fmt". ) // invertSample inverts the ancestral/derived state for each allele in a Sample. Only works for biallelic positions, throws an error if an allele state is greater than 1. // TODO: this is currently only supported for biallelic bases. func invertSample(g Sample) Sample { ...
0c900021a0e68ba0e7e200e33cc2d5791817fd261c44afd89de57a2ff02b9a9c
Go
1,234
51
package main import ( "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/sam" "testing" ) func TestTagToReadGroup(t *testing.T) { in := "testdata/tagTest.bam" valueFile := "testdata/tagTestValues.txt" targetTag := "CB" out := "testdata/testOutput.bam" bamTagToReadGroup(in, out, target...
a79622c7e7f738e21bed6c5342966dcc015901810974199a972081d528ccc5b0
Go
1,235
32
package browser import ( "testing" "github.com/vertgenlab/gonomics/fileio" ) var multiFaVisualizerTests = []struct { inFile string outFile string start int end int noMask bool lineLength int expectedFile string endOfAlignment bool }{ //here the infile is the...
90a901e2823d1d04dd32ad9a74cc7738ee7752877da14d27f6a64e6388067a30
Go
1,240
40
package main import ( "os" "testing" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" ) //note that the discrete functions are plotted in main, so these are tested in //the popgen package. var PlotFunctionsTests = []struct { Function string FunctionArgs string Left ...
c200a3e5bd849b8a6cfca291cf0ce20f5efbadd454ce04cda018e2039998dc6a
Go
1,247
42
package dnaTwoBit import ( "testing" "github.com/vertgenlab/gonomics/dna" ) var dnaStrings = []string{ "TCATACGTTTTTTTTTTTTTCTGTC", "TCAAAACCCCCGGGGTTTTTCTGTC", "TCATACGTACGTACGTCCCCCTGCCCC", "TCATGGGGGGGGCCAGTACGTTGGCT", } func TestDnaToFromString(t *testing.T) { var singleBase dna.Base for _, input := ran...
8fa5605ebcc9b12f92d84247f9008f19657e69cd0ca4eb7c9f766d3c09131a27
Go
1,259
45
package axt import ( "fmt" "testing" "github.com/vertgenlab/gonomics/cigar" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/sam" ) func TestSamFileConvert(t *testing.T) { //chr19 3001012 3001075 chr11 70568380 70568443 - 3500 var testAxt = Axt{ RName: "chr19", RStart: 1, RE...
64121b45d3292569634ccadad71ff0fae4b8c996ed7caf656c525c0696228b59
Go
1,260
37
package main import ( "os" "path/filepath" "strings" "testing" "github.com/vertgenlab/gonomics/exception" ) func TestGonomics(t *testing.T) { // check to see if binary is already installed, if so buildCmdCache, else return // Find binary location. Preference is gonomics exec path > GOBIN > GOPATH > Default g...
9f9bd9d803e062968b1b27852d669fc4c7b08dadf11628ffcd7d09d772313eae
Go
1,263
48
package main import ( "os" "testing" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" ) var LocateCGTest = []struct { inFa string chromName string outfile string compare bool cgtype string expectedTxt string }{ {"testdata/single_genome_test.fa", "chr...
9e2db55b5017dfcc473836bd7dd8518dc4a131d0f6c8e5731f957fa9f1b76ac2
Go
1,270
52
package main import ( "github.com/vertgenlab/gonomics/fasta/pFasta" "github.com/vertgenlab/gonomics/fileio" "testing" ) var IlsReconstructTests = []struct { PostProbsFiles string ReconFiles string ChromSizesFile string OutDir string Precision float32 Expected string TestPrecision flo...
d095d191d6fbb61739dd9238277d3abaf32f1577e54df77251035287da60fea6
Go
1,276
31
package genomeGraph import ( "log" "testing" "github.com/vertgenlab/gonomics/cigar" "github.com/vertgenlab/gonomics/dna" ) //func RightLocal(alpha []dna.Base, beta []dna.Base, scores [][]int64, gapPen int64, m [][]int64, trace [][]rune) (int64, []*cigar.Cigar, int64, int64, int64, int64) func TestRightLocal(t *...
b03e4e9e8f51335332b57fb49e97aab94d381ccd47fd30784a733ec796e2fa25
Go
1,277
55
package variant import ( "github.com/vertgenlab/gonomics/dna" ) // Substitution describes a single base change. // Pos is the 0-base position of the changed base. // (e.g. ATG sub 1 T>C -> ACG). type Substitution struct { Chr string Pos int Ref dna.Base Alt dna.Base } // Insertion describes an insertion into a ...
08f9955da0f3ab4ec93704f79a18045dc6a665f90152a93dff2b02b5937f20f3
Go
1,291
63
package bed import "testing" var TotalSizeTests = []struct { filename string expected int }{ {"testdata/elements1.bed", 460}, {"testdata/elements2.bed", 6}, } func TestTotalSize(t *testing.T) { var b []Bed var actual int for _, v := range TotalSizeTests { b = Read(v.filename) actual = TotalSize(b) if ac...
7e8373f78cc7b0ca3635dc14d5645ea8cb80dfd8a068bcca19074e2c35eeb4df
Go
1,291
51
package sam import ( "log" "strings" "github.com/vertgenlab/gonomics/dna" ) // SingleCellAlignment includes a Sam struct along with the parsed barcode and UMI for single-cell reads. type SingleCellAlignment struct { Aln Sam Bx []dna.Base Umi []dna.Base } // ToSingleCellAlignment parses the barcode and UMI fr...
c39a31eeb548ae32ca51ab7a09ee161e1c5d5b3f984f8557f768e4f2fdda02d5
Go
1,297
76
package dna import ( "fmt" ) func ExampleStringToBases() { var stringSeq string stringSeq = "ACGT" fmt.Println(stringSeq) var baseSeq []Base baseSeq = StringToBases(stringSeq) fmt.Println(baseSeq) // Output: // ACGT // [0 1 2 3] } func ExampleBasesToString() { var baseSeq []Base baseSeq = []Base{A, C, G...
c3b4141bf4ff975bc138b292ba7d4b0f502c1d808ba2d0baa4b130a345010ef1
Go
1,297
47
package main import ( "fmt" "os" "testing" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" ) var SlurmGeneralizedCheckTests = []struct { inputFancyFile string actualOutputParseTheInput string expectedOutputParseTheInput string }{ {"testdata/inputFancyFile.tx...
331e708d928e7f828dd8781110297e5d205dfec23a1e3de7000ed390d06a39ed
Go
1,298
50
package bedpe import ( "testing" "github.com/vertgenlab/gonomics/bed" ) var Equal1 BedPe = BedPe{A: bed.Bed{Chrom: "chr9", ChromStart: 60, ChromEnd: 75}, B: bed.Bed{Chrom: "chr9", ChromStart: 7500, ChromEnd: 7900}} var Equal2 BedPe = BedPe{A: bed.Bed{Chrom: "chr12", ChromStart: 86500, ChromEnd: 86540}, B: bed.Bed{...
b98d58aaa2b865fa756da63dea10b048a1c9300fcf3d0a47fa19b7c7b92c5992
Go
1,298
62
package vcf import ( "testing" ) func TestSnp(t *testing.T) { tests := []struct { vcf Vcf expected bool }{ {Vcf{Info: "SVTYPE=SNP"}, true}, {Vcf{Info: "SVTYPE=INS"}, false}, {Vcf{Info: "SVTYPE=DEL"}, false}, {Vcf{Info: "SOMEOTHERINFO;SVTYPE=SNP;MOREINFO"}, true}, } for _, test := range tests { ...
1115c76943a7957f4ef091153552c4c4157419115d26c1c3c17a87089f9d9c9f
Go
1,299
56
package main import ( "github.com/vertgenlab/gonomics/fasta/pFasta" "github.com/vertgenlab/gonomics/fileio" "testing" ) var vcfToPfaTests = []struct { InFile string RefFile string OutDir string Start int End int Expected string Precision float32 }{ {InFile: "testdata/test_vcfToPfa_input_1.vcf", RefFile:...
50dd79b6b457be37d9c9dd2e7420eee92c464873c2a8ceb96b3e612188015303
Go
1,309
47
package numbers import ( "fmt" "testing" ) var RandBinomialTests = []struct { N int P float64 VariateCount int ExpectedProb []float64 ExpectedAlias []int }{ {N: 5, P: 0.1, VariateCount: 20, ExpectedProb: []float64{1, 0.9683600000000008, 0.4374000000000003, 0.04860...
c29c643b5e0f872ec1cd72f092441108c72c51b73d941538fa4addcc450ce47c
Go
1,315
41
package giraf // flagTestBit test a single bit in a 16 bit flag. func flagTestBit(num uint8, bit uint8) bool { return bit&num == 0 } // ProperlyAligned returns true if the aligner determined this read was aligned correctly. func ProperlyAligned(giraf *Giraf) bool { return flagTestBit(giraf.Flag, 1) // 2 in sam } /...
59d7c6ddc9d6d839908e435d5d5597ce4cc4d65779c85270be5d0e7dbe1a534f
Go
1,321
62
package wig import ( "fmt" "testing" ) var PearsonTests = []struct { alpha map[string]Wig beta map[string]Wig missing float64 samplingFrequency float64 expected float64 }{ { alpha: map[string]Wig{ "chr1": { StepType: "fixedStep", Chrom: "chr1", S...
40b8aa6cfd788405093bedd85c2cf440349e4fa1ae2308f52350e2163deacca2
Go
1,329
65
package genomeGraph import ( "sort" "github.com/vertgenlab/gonomics/dna" ) func compareId(alpha *Node, beta *Node) int { if alpha.Id < beta.Id { return 1 } else if beta.Id < alpha.Id { return -1 } else { return 0 } } func compareSeq(alpha *Node, beta *Node) int { return dna.CompareSeqsCaseSensitive(alp...
1fb06781b5f2cbeb17e0bb02090d3b531d627a0b086f0294fba7a21d576654e0
Go
1,331
46
package numbers /* This file contains an implementation of an algorithm described in pseudocode in the following academic publication. Generating Beta Variates with Nonintegral Shape Parameters. R. C. H. Cheng Communications of the ACM, April 1978. */ import ( "log" "math" "math/rand" ) const RelError float64...
7372b807783f6c48c68684587a27e2e6c3873e9f49b66b87d424da892a84d43c
Go
1,346
37
package main import ( "os" "testing" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" ) var MultFaVisualizeBedsTests = []struct { BedFile string MultiFaFile string OutFormat bool NoMask bool LineLength int OutFiles []string ExpectedFiles []strin...
62fd9f4c774368b36928d85c3bc5b114372d50afc5ac7ca3fbc10fa96ac0b092
Go
1,363
40
package dnaThreeBit // Append adds "b" to the end of "fragment." // "fragment" can be nil. func Append(fragment *ThreeBit, b ThreeBitBase) *ThreeBit { // too confusing to have Append and append (from std lib) in this package? var bNum uint64 = uint64(b) if fragment == nil { return &ThreeBit{Seq: []uint64{bNum << 6...
72043deb28cdbf6e57e85813b15eacc4a78b7a22feff150efd87f9fe288dc12d
Go
1,370
52
package main import ( "github.com/vertgenlab/gonomics/fileio" "os" "testing" "github.com/vertgenlab/gonomics/exception" ) var MfaCountTests = []struct { inputFile string outputFile string queryName string both bool either bool secondQueryName string thirdQueryName str...
f72d870a39eb22006089a41e20248ba6d585d82bc38280301bd00edd8a75aafe
Go
1,374
44
package main import ( "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "os" "testing" ) // use struct to specify testdata. var mafIndelsTests = []struct { inMaf string speciesIns string speciesDel string threshold float64 outInsBed...
b5cf16dd4d80f5b039e45dee2dba2aa01c2908da994db6f445e1a054c108b6be
Go
1,377
54
package main import ( "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "os" "testing" ) var tfMatchTests = []struct { InFile string MatrixFile string OutFile string MatrixFileType string PropMatch float64 Pseudocounts float6...
cb60835c891ade77bebe4b01b373e31f4931c3fb829d07713b1513da94f9a8ad
Go
1,378
47
package giraf import ( "fmt" "log" "testing" "github.com/vertgenlab/gonomics/cigar" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/fileio" ) // TODO: Will write a better high throughput test when random generator is working. func TestReadAndWrite(t *testing.T) { var numGiraf int = 1 gir...