sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
a51666564c134c251cd84839c3cdef0ce6a6e908f58b2a19c42956e509870994
Go
2,694
67
// Command Group: "BED Tools" // Returns a bed file with the Score field containing the minimum distance from the end of the chromosome. package main import ( "flag" "fmt" "log" "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/chromInfo" "github.com/vertgenlab/gonomics/numbers" ) func bedD...
450c784c4ebdb571273c75a378a6ec5c14d4c29d9382d09eed3e9aaadf89b2a8
Go
2,697
139
package numbers import ( "testing" ) var maxTests = []struct { a int // first input b int // second input expt int // expected result }{ {1, 2, 2}, {-1, 2, 2}, {-50, 2, 2}, {3, 7, 7}, {3, -7, 3}, {-3, -7, -3}, {100, 99, 100}, {100, -101, 100}, } func TestMax(t *testing.T) { for _, test := range ma...
b3b4e3e688e590f0a3daed37469b46899a1d2c5fb9f996c472da45995f51bd32
Go
2,705
120
package variant import ( "testing" "github.com/vertgenlab/gonomics/dna" ) type EffectorTest struct { Effector ExpectedEffect CodingChange } func equalEffects(a, b CodingChange) bool { switch { case a.Type != b.Type: return false case a.CodingPos != b.CodingPos: return false case a.ProteinPos != b.Prot...
ff0955a748b1934c6510f8a36d7be379d76742277781eaa37779bc296ed23b3a
Go
2,712
91
package main import ( "math" "os" "testing" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" ) var bedMaxWigTests = []struct { InputBed string InputWig string InputChromSizes string OutputFile string ExpectedFile string MinFlag bool AverageF...
7ce48066c21c0ba4e81198453fd585acf26f73d63b95ee483d0eef0c4204467d
Go
2,715
102
package align import ( "bytes" "fmt" "log" "github.com/vertgenlab/gonomics/dna" ) func colTypeToRune(a ColType) rune { switch a { case ColM: return 'M' case ColI: return 'I' case ColD: return 'D' default: log.Fatalf("Error: unexpected value when converting colType to rune %d", a) return '?' } } ...
34a327e506df4848d741448500fd96cc9b56085bf45714fdaa461d39abdb03a9
Go
2,741
65
package genomeGraph import ( "sync" "github.com/vertgenlab/gonomics/fastq" "github.com/vertgenlab/gonomics/giraf" "github.com/vertgenlab/gonomics/sam" ) // Goroutine worker functions. func RoutineFqToGiraf(gg *GenomeGraph, seedHash map[uint64][]uint64, seedLen int, stepSize int, scoreMatrix [][]int64, inputChan ...
289222ea193a95292be86c5906c2844f8c475ea6ad5858fe908286de18854601
Go
2,744
50
package binaryGiraf // Package binaryGiraf provides functions for reading and writing binary giraf files import ( "github.com/vertgenlab/gonomics/cigar" "github.com/vertgenlab/gonomics/dna/dnaThreeBit" ) // The structs in this file are only present for documentation and should not be used // Compressed with BGZF ...
d2c65d6abaed132c299f58b13c62a9d3462854e28aed7b4fc0c6e9ff3589fd1b
Go
2,745
92
package main import ( "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "os" "path/filepath" "strings" "testing" ) var BedSplitTests = []struct { Mode string InFile string OutDir string GzipOut bool ExpectedDir string }{ {Mode: "byName", InFile: ...
d57ba3ba4934b9d72737da9c337cb90703abe0aadbca8d0849b2d00aaa0d8d34
Go
2,766
86
// Command Group: "Data Simulation" // Contains functions for simulating VCF data package main import ( "flag" "fmt" "log" "math/rand" "github.com/vertgenlab/gonomics/simulate" ) func simulateVcf(s Settings) { rand.Seed(s.SetSeed) simulate.VcfToFile(s.Alpha, s.NumAlleles, s.NumSites, s.OutFile, s.BoundAlpha,...
5e322ef3b8279f6805f06d59bfa5dd2381055dcfd5ac25f2fb6c8e62fda1a517
Go
2,768
78
package sketch import ( "image" "image/color" "testing" ) // TestHLine tests the HLine function by drawing a horizontal line and checking if the expected color is set at each pixel. func TestHLine(t *testing.T) { img := image.NewRGBA(image.Rect(0, 0, 10, 10)) col := color.RGBA{255, 0, 0, 255} HLine(img, 2, 7, ...
441dcbf1d812868c44ecc61d8ae93a4eafaf66cea37a7c953c1deb8c6110f8cc
Go
2,770
100
package main import ( "flag" "fmt" "log" "os" "strings" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/genomeGraph" "github.com/vertgenlab/gonomics/giraf" ) // TODO: View feature needs some work. type ViewExe struct { Cmd *flag.FlagSet GirafFile string SamFile string } va...
62a935917f4208eaa202c9367c32b1eeb8b9bace03ad391b9c819746bd723fdf
Go
2,780
103
// Command Group: "Data Conversion" // Converts sam or bam to wig 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/sam" "github.com/vertgenlab/gonomics/wig" ) type...
8232b7f155fdaf5dc39ff875fb2c1de9b6f9e19893a4a714de0a12fd14f11b8c
Go
2,784
81
package main import ( "os" "testing" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fasta" ) var MultiFaExtractTests = []struct { inputFile string outputFile string expectedFile string removeGaps bool bed string start int end int out1 st...
0f4d7e812a03a14c3339b16ea9f5143c41bc0ee05443fdd2c0edd96ce2ee99ef
Go
2,809
78
package maf import ( "log" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/fasta" ) func setupBlankAln(ref fasta.Fasta, species []string) []fasta.Fasta { var answer []fasta.Fasta answer = append(answer, ref) answer[0].Name = species[0] for i := 1; i < len(species); i++ { answer = append...
c663dccd03ed676bb3f35fbdb7bc4411b373e8f94430bf7cde2571fb28a839a3
Go
2,810
90
package main import ( "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "os" "testing" ) var NonCodingTests = []struct { TreeFile string FastaFile string OutFile string SetSeed int64 NumNodes int GammaAlp...
dd36456a2c9bc1acffc79747b848f7ab574da887c85f132968a51681a433f2c0
Go
2,810
101
package sam import ( "fmt" "github.com/vertgenlab/gonomics/exception" "io" "strings" ) // SamPE is struct that contains 2 paired end Sam entries as well as a slice of Sam that represents all supplementary // alignments for the read-pair type SamPE struct { //TODO: rename from A/B to something more informative R1...
cb31326bed8576b3d36d407d02da586ab223d1778dbb3dbbdcce8e650f308735
Go
2,811
86
package genomeGraph import ( "log" "github.com/vertgenlab/gonomics/align" "github.com/vertgenlab/gonomics/cigar" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/fasta" ) func nmMatrixSetup(size int64) ([][]int64, [][]rune) { m := make([][]int64, size) trace := make([][]rune, size) for id...
3c0b1b647999aefecef6202513343551047fbf40e0ce53ab4e066160a5b9db24
Go
2,821
102
package main import ( "encoding/csv" "os" "strings" "testing" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" ) var VcfFormatTests = []struct { InFile string OutFile string ExpectedFile string EnsemblToUCSC bool UCSCToEnsembl bool FixVcfRecords bool Ref ...
1d80ab26d0101e5488a4c0c05d5ca26da8aa55c633aae951312dd2c1c2ce49c6
Go
2,830
70
package fastq import ( "fmt" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" ) // SingleCellPair is a struct that contains single-cell sequencing information, including a pairedEnd read, barcode, and UMI. type SingleCellPair struct { Reads ...
ccf420b61fbded96dda6bd6819df0d267eae46c564aa03f4f750842bb1002122
Go
2,833
81
// Command Group: "FASTA and Multi-FASTA Tools" // Concatenate multiFa alignment files by sequence. Accepts an arbitrary number of input fasta files package main import ( "flag" "fmt" "log" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fasta" "github.com/vertgenlab/gonomics/fileio"...
e0d2d5a254ea6625a2a7dc454de680235da2a51a01226ec5066cff2db39572bd
Go
2,856
87
package main import ( "github.com/vertgenlab/gonomics/fileio" "testing" ) /* Testing files were generated with the following commands in gonomics v1.0.0 ~/go/bin/randSeq -lenSeq 1000 -numSeq 1 -setSeed 5 myRandSeq.fa ~/go/bin/simulateSam -coverage 1.0 -flatErrorRate 0.01 -setSeed 9 myRandSeq.fa test1.unsorted.bam...
7d745cc240ad1ae7e895a0de4241eb96a9819eb708f24586598f95f279b198ee
Go
2,857
96
package lift import ( "testing" "github.com/vertgenlab/gonomics/bed" ) var OverlapTests = []struct { A bed.Bed B bed.Bed expected bool expectedLength int }{ {A: bed.Bed{"chr4", 1, 10, "", 0, bed.Positive, 3, nil}, B: bed.Bed{"chr4", 4, 12, "", 0, bed.Positive, 3, nil}, expected...
53cec959479b7925b8a6f1b79f0e1bcda308a14e1c35b6d3b4e93419bb2b737f
Go
2,858
99
// Command Group: "BED Tools" // Combines overlapping bed entries, keeping max score. Output will be sorted by genome coordinate package main import ( "flag" "fmt" "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonom...
bd49c853a5dbc7ce57b2d62125531d8bdd2e1d5a6e921d428b89952f7304c315
Go
2,858
109
package fileio import ( "bytes" "io" "os" "github.com/vertgenlab/gonomics/exception" ) // magic number that identifies a gzip file. var magicGzip = []byte{0x1f, 0x8b} // IsGzip checks if the magic gzip number is // present at the start of the input io.ReadSeeker. // After check for the magic number, IsGzip // s...
0225499192a7798ece70ce5e009ffb1ff6ec6f7ba63ce1cb1e854e58edda831f
Go
2,859
87
// Command Group: "Data Conversion" // Converts bed score to wig package main import ( "flag" "fmt" "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/chromInfo" "github.com/vertgenlab/gonomics/convert" "github.com/vertgenlab/gonomics/wig" "log" "math" ) type Settings struct { Method ...
07358e2e2cb176453ce22a773d91819f7637b2cb117186e77cb7f6e65fdb57ce
Go
2,866
85
// Command Group: "General Tools" // Perform functional enrichment analysis by associating genomic regions // with their nearest gene in 3d space using bedPe contact sites. package main import ( "flag" "fmt" "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/bed/bedpe" "github.com/vertgenlab/go...
e51d3e4e9b98cb03046ab1604012b98dc68234fe96067ae4e4f605fd3fba64c2
Go
2,872
104
// Command Group: "VCF Tools" // Options alter VCF formatting package main import ( "flag" "fmt" "log" "strings" "github.com/vertgenlab/gonomics/convert" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fasta" "github.com/vertgenlab/gonomics/fil...
5bc72114c49ea526fca9488c75dea4d18e3c26794ac8e1b3f1099869dafb9044
Go
2,879
94
// Command Group: "BED Tools" // Generates ideogram txt file from a bed package main import ( "flag" "fmt" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/numbers/parse" "log" "strings" "github.com/vertgenlab/gonomics/fileio" ) type IdeogramPoint struct { Chrom string Position...
c9358eee7b8764d37350b25a2b1fd57b600df2f9377f429940794ea83a887158
Go
2,893
140
package main import ( "io/ioutil" "os" "testing" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/dna/dnaTwoBit" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/genomeGraph" ) func TestSortOrder(t *testing.T) { sortedGraph := test(MakeTestGraph()) correctOrder ...
914062fc177ad895952968f6e4d29ae39d2f3f095984b8d97d0d3a32b9e19b1c
Go
2,904
144
package bgzf import ( "bytes" "compress/gzip" "crypto/md5" "encoding/binary" "fmt" "io" "log" "os" "testing" ) func TestWrite(t *testing.T) { b := NewBlock() r := NewBlockReader("testdata/test.bam") tmpfile, err := os.Create("testdata/tmp.bam") if err != nil { log.Panic(err) } w := NewBlockWriter(tmp...
1334a62e9859efb95ebf449f665781de8170226feaba31f791dc0ecbd4622619
Go
2,924
106
// Command Group: "FASTQ Tools" // Options alter fastq file formatting package main import ( "flag" "fmt" "log" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fastq" "github.com/vertgenlab/gonomics/fileio" ) func fastqFormat(s Settings) { if !s.PairedEnd { log.Fatalf("fastqForma...
a95aa8905961ee6e986915d47a924eb8eca92a383cab41d71bb4fe5b736bf4bb
Go
2,926
82
package gtf import ( "os" "testing" ) var c1 Cds = Cds{Start: 173477398, End: 173477492, Score: -1, Frame: 0} var f FiveUtr = FiveUtr{Start: 173477335, End: 173477397, Score: -1} //var e1 Exon = Exon{Start: 173477335, End: 173477492, Score: -1, ExonNumber: "\"1\"", ExonID: "\"NM_004905.1\"", Cds: &c1, FiveUtr: &f}...
02fcc5a9047ff81a045eda1cb37386240e6b5d8755a2f955b751e78e03597d6e
Go
2,938
117
package main import ( "fmt" "sync" "testing" "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/interval" "github.com/vertgenlab/gonomics/vcf" ) const ( testSelectFile string = "testdata/imbalance.bed.gz" testInputFile string = "testdata/imbalan...
5f1f0da11dbf1955ba0e75011327da7b1e1122444b6021a8acb90368aa6f2fd3
Go
2,940
100
package main import ( "os" "testing" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" ) var bedToWigTests = []struct { InFile string RefFile string OutFile string ExpectedFile string Method string DefaultValue float64 UseRange ...
0b6245ddf46a824f45442c61bab12942f0b57cf6a7f6e01988a77add96e75ac3
Go
2,947
78
package dnaThreeBit import ( "testing" "github.com/vertgenlab/gonomics/dna" ) //func BasesToUint64(seq []dna.Base, start int, end int, padding ThreeBitBase) uint64 { //func basesToUint64WithOffset(seq []dna.Base, start int, end int, padding ThreeBitBase, offset int) uint64 { //func GetThreeBitBase(fragment *ThreeB...
bbd3076be24ecd785b92f8707dd5e13e8a59a7bbb0f52c8464fda5549af6b12d
Go
2,960
107
// Command Group: "FASTA and Multi-FASTA Tools" // Pull sub-sequence from multiple Fasta alignment for each entry package main import ( "flag" "fmt" "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/fasta" "github.com/vertgenlab/gonomics/numbers/parse" "log" ) func multiFaExtract(s Settings)...
a7d4bf71d61deaac320ccf498d1cdb46598fce187c23754a5ee43cedb4f15b84
Go
2,973
116
package obo import ( "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "os" "testing" ) var ToDotTests = []struct { InFile string OutFile string ExpectedFile string }{ {InFile: "testdata/test.obo", OutFile: "testdata/out.dot", ExpectedFile: "testdata/expect...
dd60e1c15e3bc753765067d4aef1a81fc5be86c2723f0d8d6a63e3ab0f5dfc43
Go
2,977
130
package interval import ( "fmt" "log" ) const ( xMin = 0 xMax = 10_000_000_000 // maximum size of genome ) // TestValidRelationship tests that the input relationship string for a query is supported. func TestValidRelationship(op string) bool { switch op { case "o": case "oi": case "d": case "di": case "m":...
c79b54425cc62b560c44680eaa7bdce2a4464f80bda0fef170d48e0e28b321ae
Go
2,993
102
package interval import ( "fmt" "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/numbers" "os" "testing" ) var CoordsToStringTests = []struct { I Interval Expected string }{ {I: bed.Bed{Chrom: "chr1...
27b2a032f8a031c713f4eb025bf3ce0b198317f69d7a25a9f8b4fc923e333692
Go
3,022
98
// Command Group: "Data Conversion" // Convert axt alignments to sam format package main import ( "flag" "fmt" "log" "sync" "github.com/vertgenlab/gonomics/axt" "github.com/vertgenlab/gonomics/chromInfo" "github.com/vertgenlab/gonomics/fasta" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/go...
4304f470fd642df4bd1518692565d4c9b8cf7f70e56cd0d321f556d233affbb6
Go
3,044
95
// Copyright 2020 Google Inc. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in wr...
a03930f52fb147e6a550d57746daa0097a6d21892f359f9731152a4d41f5240a
Go
3,065
129
package gtf import ( "strings" ) // AllAreEqual returns true if all of the entries in a GTF map contain the same information, false otherwise. func AllAreEqual(a map[string]*Gene, b map[string]*Gene) bool { if len(a) != len(b) { return false } for k := range b { if _, ok := a[k]; !ok { return false } els...
1ef2f85c7b392e4c547251401afd844c97d90b7b058824e5012f4eda1793ff20
Go
3,070
88
package main import ( "flag" "fmt" "github.com/vertgenlab/gonomics/fasta" "github.com/vertgenlab/gonomics/motif" "log" ) type Settings struct { InFile string MatrixFile string OutFile string MatrixFileType string PropMatch float64 Pseudocounts float64 Outp...
f22c24a4c250920ea1ad5d4a4f162a3a7a0e95c96d7adf889d9e69149b9dc41e
Go
3,072
84
package simulate import ( "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/numbers" "log" ) // CountWindows counts the total viable windows of length regionLength in the sequence searchSpace func CountWindows(searchSpace []bed.Bed, regionLength int) int { var length, totalWindows int for i :=...
9338bcd29b55140c32113f9d07ca81af3e4bd1807ab2ebdc21f047ce4f84fc23
Go
3,083
106
package bedGraph import ( "fmt" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/numbers/parse" "io" "strings" "sync" ) // BedGraph stores information about genomic regions, including their location and an associated float DataValue. // As with ...
beaee15f144b42e2dd511a309cc47ca141f4524b1ffb31bf2e56cb2f9d376a30
Go
3,094
87
package dnaThreeBit import ( "log" "math/bits" ) // countRightMatches counts the number of perfectly matching bases between seqOne and seqTwo, starting // a position startOne in seqOne and startTwo in seqTwo. The slices must be encoded with the threeBit format // and in register with each other. The first compari...
10ff3bae805626110dd14b8aaba8a860a098fc5d0a03bbc25abf1e419c2fc3f6
Go
3,109
101
package main import ( "os" "testing" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" ) var BranchLengthsMultiFaBedTests = []struct { Chrom string InFaFile string InBedFile string VelLengthBedFile string Init...
cac87b1b0c04a0b934cce556c1fe5c4e73610289517be92b18775f37df2df845
Go
3,127
134
package logspace import ( "math" "testing" ) func TestToBase10(t *testing.T) { var inputs = []float64{0, 1.5} var observed float64 for _, v := range inputs { observed = ToBase10(math.Log(v)) if observed != math.Log10(v) { t.Errorf("Error in ToBase10. Expected: %v. Observed: %v.\n", math.Log10(v), observed...
d2fb559419987568a1516c39e7206e69e3ef978e323d84a505e35e0bd82c1c6f
Go
3,134
69
package main import ( "flag" "fmt" "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/bed/bedpe" "github.com/vertgenlab/gonomics/chromInfo" "github.com/vertgenlab/gonomics/ontology" "github.com/vertgenlab/gonomics/ontology/gaf" "github.com/vertgenlab/gonomics/ontology/obo" "log" ) func onto...
6e8cba5f6ca3f09df6280d00b3ad3939e5a49ea07ccf36c0f51dcd2a42d3b786
Go
3,136
128
package dna import ( "log" ) // Count returns the number of each base present in the input sequence. func Count(seq []Base) (ACount int, CCount int, GCount int, TCount int, NCount int, aCount int, cCount int, gCount int, tCount int, nCount int, gapCount int) { for _, b := range seq { switch b { case A: ACoun...
d41103a96eb3c5a637f0c18ba0399d3d3e22b824d7addc1a7d802eb455d9daba
Go
3,164
99
package main import ( "flag" "fmt" "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/wig" "log" "math" "os" ) // StatsSettings defines the usage settings for the wigTools stats subcommand. type StatsSettings...
bbb80875b3e2c4bee4d47c28b2be4c3a14525d0ec05a77f6625a1635f71e1fe4
Go
3,176
93
package main import ( "flag" "fmt" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/motif" "log" "math/rand" "os" ) // ShuffleSettings defines the usage options for the pwmTools shuffle subcommand. type ShuffleSettings struct { InFile stri...
f6209c4b4290cfa7758fad34bb86afbab367c6f7e7b24b68947c3f20f2ef18ca
Go
3,186
109
package main import ( "bytes" "log" "net/http" "os" "strings" "testing" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/vcf" ) func TestVcfWebAnnotate(t *testing.T) { if !pingServer() { return } testfile := "tmp_testfile.vcf" vcfs, he...
e9e771987a0a25eb41603a237a903f3a25ed584ae7e59d32290ed913a2498704
Go
3,218
124
package main import ( "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "math" "os" "testing" ) var BedpeFilterTests = []struct { InFile string OutFile string ExpectedFile string MinScore int MaxScore int MinDistance int MaxDistance int ...
34708b9b4e2460cf9431f35d06a5cee74a1b41e4fc663f9a1da8ad72dce6e61e
Go
3,220
113
// Package hic is written to process output from the aidenlab functions // straw function: https://github.com/aidenlab/straw // note: this package only reads and does not write this file type package hic import ( "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenl...
1a01ca88dcece115a0f00da1ffaed42e57186e2ec01d9ff96aa6c7f8cc4955a3
Go
3,221
87
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/fileio" "os" "testing" ) func TestFill3dSpace(t *testing.T) { var genes = []bed.Bed{{C...
fa6ad52fb65e12c96ae920d97e303e7987e39faf5c58671f873a262f10e963e1
Go
3,231
99
package chain import ( "log" "strings" "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/numbers" ) // OverlapChainBed returns true if the provided chain and bed overlap // in genomic coordinates. If check target is true, this calculation // is done on the chain's target, and otherwise on the...
ac357c1b015d678aad0e44ce4b60597746a9b3a86c3a46d08f7dfd6732159c20
Go
3,239
131
package expandedTree import ( "fmt" "math" "testing" ) func initializeMyRoot() *ETree { var myRoot, firstLeft, firstRight, secondLeft, secondRight ETree myRoot = ETree{ Name: "myRoot", Up: nil, Left: &firstLeft, Right: &firstRight, } firstLeft = ETree{ Name: "firstLeft", BranchLength: ...
a21fa422de712382e016a651136d6fccf238854f0d66fcc0917a85c786c56e23
Go
3,245
83
// Command Group: "Data Conversion" // Generates a VCF file from an input pairwise or three-way multiFa alignment with the first entry as the reference package main import ( "flag" "fmt" "log" "github.com/vertgenlab/gonomics/convert" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fa...
9a76197198d21b464578d7d6a92013ae0ce1a2677bf0a8b3886488006feff46a
Go
3,263
111
package fasta import ( "os" "testing" "github.com/vertgenlab/gonomics/dna" ) var seqOneA = dna.StringToBases("ACGTacgTCATCATCATTACTACTAC") var seqOneB = dna.StringToBases("acgtACGTACGT") var seqOneC = dna.StringToBases("ACGTACGTACGTT") var readWriteTests = []struct { filename string // input data []Fasta }{...
3f92885ac9fed63d49e7db8e15cd1bcbb7faf48270eabd575077bdd99456a89b
Go
3,278
75
// Command Group: "Statistics & Population Genetics" // Performs maximum likelihood estimation of selection on variants from an input VCF format file package main import ( "flag" "fmt" "log" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/popge...
e9d9bb922d2c81da17ab2fa95b49dee25acbe762fd24e7d2248ee5674f1b8199
Go
3,281
82
package main import ( "log" "path/filepath" "strings" "sync" "time" "github.com/vertgenlab/gonomics/fastq" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/genomeGraph" "github.com/vertgenlab/gonomics/giraf" "github.com/vertgenlab/gonomics/sam" ) func GswToGirafPair(ref *genomeGraph....
67b972ef0e72652bff6b53916e02ee6928619f4aa1e0fd45becbfd8f15f6deed
Go
3,285
113
package motif import ( "fmt" "os" "testing" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" ) var ScoreWindowTests = []struct { MatrixFile string Seq [][]dna.Base AlnStart []int ExpectedScores [][]float64 Expected...
db669f156a83b9375daeac0b1dccdeb29ca62898477078af3cd61383cbb7fd3c
Go
3,290
81
package lift import ( "github.com/vertgenlab/gonomics/axt" "github.com/vertgenlab/gonomics/numbers" "testing" "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/interval" ) var ReadingTests = []struct { Infile string Expected []Lift }{ {"testdata/elements1.bed", []Lift{bed.Bed{Chrom: "chr...
b19d694248b18595aaa5b5f49f24c1ad44de4b62111f041c7af9a23f1df67cfd
Go
3,319
79
package numbers import ( "testing" ) func TestRandExp(t *testing.T) { expectedMean := 1.0 expectedVariance := 1.0 var input []float64 input = make([]float64, 100000) for i := 0; i < 100000; i++ { input[i], _ = RandExp() } ave := AverageFloat64(input) variance := VarianceFloat64(input) if ave < expected...
888dcc048ac09f87d6502b0d33c21f10df2954133103e491fee7575fdfd4846a
Go
3,325
55
package fastq import ( "testing" "github.com/vertgenlab/gonomics/dna" ) func TestTrimmingBarcodes(t *testing.T) { var nameOneFwd string = "ST-E00545:471:HVJ32CCXY:2:1101:6705:1538_UMI:AGGTGG_BX:NTCGGACGTGGGAAGG" var bxOne []dna.Base = dna.StringToBases("NTCGGACGTGGGAAGG") var umiOne []dna.Base = dna.StringToBas...
e9fe6a3c4da6470f1f01fef1353cb63d7554065380c3bb52d43da06150a756f3
Go
3,327
236
package main import ( "os" "testing" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" ) var StatCalcTests = []struct { Args []string Normal string Binomial string Poisson string Beta string Gamma string SampleAfs string SampleBeta...
14e72e307deaff3fe4cf87d95a9c4932d7389162849bb69c5f234373362431be
Go
3,341
147
// Command Group: "BED Tools" // Performs comparative arithmetic operations on float values in bed files 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/parse" "log...
3011897f97c80731b2e7cc4d62e5afa0a852974cbdef1d4c8521f841c9f29e34
Go
3,348
68
package bed import ( "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/fasta" "log" "strings" ) // ToLower converts bases in a fasta sequence to lowercase in specified bed regions, where the bed chrom name matches the fasta record name func ToLower(records []fasta.Fasta, regions []Bed, ignoreEx...
71dc8386832d20bff0bc64f4a7fccb6fe82f7b132a2521d42fc682c9b42c8286
Go
3,364
124
package main import ( "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "os" "testing" ) var ToBedTests = []struct { InFile string OutFile string ExpectedFile string Tss bool FirstTwoCodonBases bool ChromSizesFile string Merge...
9ae2bfae0d74f2ad262d1ab8c85b2ec41e1f19085785ddfaa2a131b2ba02d43f
Go
3,366
88
package popgen import ( "log" "math/rand" "github.com/vertgenlab/gonomics/numbers" "github.com/vertgenlab/gonomics/vcf" ) // SimulateSegSite returns a segregating site with a non-zero allele frequency sampled from a stationarity distribution with selection parameter alpha. // the second returns true if the site ...
4d8214e59ccef3e5df08b414f0d1085dc84d3a87302ab6fa71efed4ef509e539
Go
3,371
89
// Package popgen contains functions for analyzing population genetic statistics from variation or alignment data. package popgen import ( "math" "github.com/vertgenlab/gonomics/align" "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/fasta" "github.com/ve...
f92ded70b1153077b3c7949e80008903e75cd21255ae21c343753fa43da99a65
Go
3,393
132
// Command Group: "Sequence Evolution & Reconstruction" // Determine the mutation spectrum for divergent sites in each region of an input bed file package main import ( "flag" "fmt" "log" "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "g...
c0564ef2a6ea722eaae6add796b8bad3aa8035a063108dd428759e13972f6f31
Go
3,402
103
package dna import ( "log" "math" ) // nnTable is a map that has nearest neighbor dinucleotides and they're corresponding deltaH () and deltaS () values, respectively. // Entropy/enthalpy values were empirically determined in: Allawi and SantaLucia (1997), Biochemistry 36: 10581-10594 var nnTable = map[string][]flo...
c9426defe2e29ccf9638f2ce770d11c28d1e37e3c3ec5f9737c7178533f27937
Go
3,405
131
package popgen import ( "fmt" "io" "strconv" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fasta" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/vcf" ) type WrightFisherSettings struct { PopSize int MutRate float64 NumGen int G...
476bb789ed1489591b4b3ca9dae2ee5f72e10800461955dab43d07043be9f0d3
Go
3,425
93
package simulate import ( "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/expandedTree" "github.com/vertgenlab/gonomics/fasta" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/numbers/parse" "log" "math/rand" "strings" ) // Jukes-Cantor matrix, medium distance. var ...
754cbb8a361feb241c47554acc37bb8d9ca615c4843593f7ff4b3d68ede0489e
Go
3,427
95
package numbers import ( "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/numbers/parse" "log" "math" "sort" "strings" ) // McmcTrace is a general struct for Mcmc trace output. Used for discarding burn-in and calculating the mean and credible interval. type McmcTrace struct { Parameter [...
5b466bfab8058b0cf1e1f8d0d7dc23332d7ef086d3b2fdbd68e1e9ea2ee14f61
Go
3,433
128
package fileio import ( "bytes" "testing" ) func TestByteioReader(t *testing.T) { answer := ezReaderTest("testdata/big.fa.gz") reader := NewByteReader("testdata/big.fa.gz") var i int = 0 for line, done := ReadLine(reader); !done; line, done = ReadLine(reader) { if line.String() != answer[i] { t.Errorf("Err...
c3bb6c88d74c447dd0e00d2432c51625a47f1956e1b6d4da6c2351d642ea48db
Go
3,445
97
package vcf import ( "testing" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/fasta" ) var AncestorAlleles []dna.Base = []dna.Base{dna.A, dna.T, dna.G, dna.C, dna.A, dna.A, dna.C} func TestVcfQueryAncestor(t *testing.T) { reader, _ := GoReadToChan("testdata/AncestorTest.vcf") var input []...
7e57be6d1fd5460bdb1898c93536f9ccadcc82375f095412fbb0d493a2dda055
Go
3,448
76
package main import "github.com/vertgenlab/gonomics/sam" // CacheStruct contains a collection of all caches used for the likelihood and // prior calculations in samAssembler. type CacheStruct struct { DiploidBasePriorCache [][]float64 DiploidIndelPriorCache []float64 HaploidBasePriorCache [][]float64 HaploidInd...
dd99cb8a60e281003c0eeb9ba603631fea4475af74936ce3a965862b0fd0d01a
Go
3,466
122
// Command Group: "Data Conversion" // Find and replace gene IDs with gene names according to an input table or preset NCBI RefSeq / ENSEMBL ID conversion tables package main import ( "flag" "fmt" "log" "strings" "github.com/vertgenlab/gonomics/cmd/geneIdToName/presets" "github.com/vertgenlab/gonomics/exceptio...
df182640e0bc667f061d10ab9707610f2f4a8438d8e9a941ceba3e61d00d3617
Go
3,475
114
package wig import ( "log" "math" //DEBUG: "fmt". "math/rand" "sort" "strings" "github.com/vertgenlab/gonomics/numbers" ) // isEqual returns true if two Wig data structures contain the exact same data values and returns false otherwise. func isEqual(alpha Wig, beta Wig, precision float64) bool { if strings....
691524a0080c79015498364d9ea3d4b7b331a7283e2ec08b60b22d788044cf5b
Go
3,507
116
package bed import ( "github.com/vertgenlab/gonomics/numbers" "log" ) // TrimSlice trims each element in a slice of bed entries by an input left and right amount. func TrimSlice(b []Bed, trimLeft int, trimRight int) { for i := range b { b[i] = Trim(b[i], trimLeft, trimRight) } } // Trim shortens bed entries on...
4304e90eb353f136ec99222f71d5410c9bba9e5421aacd319aff4f3485d14f6a
Go
3,508
114
package lift import ( "testing" ) var ElementOverlapProbabilityTests = []struct { elements1File string elements2File string NoGapRegionsFile string Expected []float64 }{ {"testdata/EnrichmentElement1.bed", "testdata/EnrichmentElement2.bed", "testdata/EnrichmentNoGap.bed", []float64{0.0578231...
e2a00bacf767b355067b9622ed3bc7f64df1754e390cd96d069b80569eec6967
Go
3,525
48
package simulate import ( "fmt" "github.com/vertgenlab/gonomics/expandedTree" "math/rand" "strings" "testing" ) var ETreeTests = []struct { NumNodes int GammaAlpha float64 GammaBeta float64 SetSeed int64 Expected string }{ {NumNodes: 9, GammaAlpha: 2, GammaBeta: 20, SetSeed: 14, Expecte...
1b12327a195b11647805f3e6a057ab99d8a65f2711ba3f77294ee5e5f0f497d1
Go
3,534
90
package gtf import ( "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/chromInfo" "github.com/vertgenlab/gonomics/numbers" "github.com/vertgenlab/gonomics/vcf" ) // FilterVariantGtf takes a vcf record, a gene list from a gtf, ChromInfo to know the length of chromosomes, and whether the function...
5802c8e41f7c09cc90f57476c1f5b63cfa842865e1f8ad71e2d06b3f89124842
Go
3,550
154
package vcf import "testing" var VcfMethodsTests = []struct { v Vcf expectedChr string expectedStart int expectedEnd int newChr string newStart int newEnd int }{ {v: Vcf{Chr: "chr1", Pos: 2, Ref: "A", Alt: []string{"T"}}, expectedChr: "chr1", expectedStart: 1, expect...
55f2debc559cd773fcd12403f20c199e28a8a44852a519e3af91a34f5cd974c3
Go
3,551
86
// Command Group: "Data Simulation" // Simulate a multiallelic, haplotic Wright-Fisher population (discrete, non-overlapping generations) package main import ( "flag" "fmt" "log" "math/rand" "github.com/vertgenlab/gonomics/fasta" "github.com/vertgenlab/gonomics/popgen" ) func simulateWrightFisher(outFile stri...
79e055d50819c1750225a5e301944147482a1966e19d63c8ec06f0576e8a5cce
Go
3,572
96
package sam import ( "testing" "github.com/vertgenlab/gonomics/dna" ) var HaploidCallFromPileTests = []struct { P Pile RefBase dna.Base Gamma float64 Delta float64 Epsilon float64 Kappa float64 Lambda float64 Expected HaploidCall }{ {P: Pile{CountF: [13]int{30, 0, 0, 0, 0, 0, 0, 0, 0, ...
362063155df8ced30c015660f7955e8192e58307ea7636a597a4bfc2687dab6f
Go
3,585
89
// Command Group: "Statistics & Population Genetics" // Returns allele frequency spectrum information in a text file for graphing package main import ( "flag" "fmt" "log" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/popgen" ) type Settings ...
afe6123d6ea15db635e17b6332e56a8892d92e84f59da5f7d753cbdf91b6f6c8
Go
3,590
126
package vcf import ( "io" "strconv" "strings" "github.com/vertgenlab/gonomics/dna" ) // String implements the fmt.Stringer interface for easy printing of Vcf with the fmt package. No trailing newline character // is added to the end of the string func (v Vcf) String() string { // TODO: Consider reducing allocat...
baa912a9a3b3343036fcd783df060a91e5496c4a00627e03901a1f648a05c880
Go
3,606
91
package cigar import ( "testing" ) func TestAppend(t *testing.T) { tests := []struct { alpha []Cigar beta Cigar expected []Cigar }{ {[]Cigar{{2, Deletion}, {30, Match}}, Cigar{20, Match}, []Cigar{{2, Deletion}, {50, Match}}}, {[]Cigar{{1, Deletion}, {10, Match}}, Cigar{2, SoftClip}, []Cigar{{1, De...
7748fad533c7f388d468cdf075e011c321377b910c665264730fa890f082fdc2
Go
3,613
165
package genomeGraph import ( "fmt" "log" "testing" "github.com/vertgenlab/gonomics/cigar" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/dna/dnaTwoBit" "github.com/vertgenlab/gonomics/giraf" ) // TestGraph Structure // n2 e0 = 1 // e1/ \e2 e1 = 0.05 /...
b331adc47bd84b1e435677bf57209e81ec0e4a2edfa864330048b5f757bde3d4
Go
3,624
125
package main import ( "flag" "fmt" "os" ) // Genome Graph Gonomics. func usage() { fmt.Print( "GSW - Graph Smith Waterman:\n\nGenome Graph Software\n" + "Author: Eric Au\n\tCraig Lowe\n\n" + "Vertebrate Genetics Laboratory: http://www.vertgenlab.org\n" + "Source code: https://github.com/vertgenlab/gono...
3f97738c4d144a76340af08b75f7061978f249ee95b28d59d6b21c14e3d19f09
Go
3,626
157
package vcf import ( "log" "sort" "strings" //"github.com/vertgenlab/gonomics/dna". "github.com/vertgenlab/gonomics/numbers" ) const debugMode = 0 //set debugMode to 1 to enable prints // CompareCoord compares two VCF structs by Pos for sorting or equality testing. func CompareCoord(alpha Vcf, beta Vcf) int { ...
da343584caeac8f07bc83e8f39dfcd831ab0d4f8511e88509a1a70b2624c5aac
Go
3,626
129
// Command Group: "SAM Tools" // Count bases from sequencing data package main import ( "flag" "fmt" "log" "strings" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/sam" ) func usage() { fmt.Print( "pi...
d8dd452d6e0ba4c37c56d5bac5c06a41b0fb30970f8a1cda25e5bf069c3873a5
Go
3,647
95
package main import ( "flag" "fmt" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fasta" "github.com/vertgenlab/gonomics/simulate" "log" "math/rand" "os" ) type WithIndelsSettings struct { FastaFile string OutFile string BranchLength float64 PropIndels float64...
89a5771ca62bc5f6c60d3f9530de83a5a32374ce470d2f039e04446b4812a8ca
Go
3,655
107
package main import ( "bytes" "github.com/vertgenlab/gonomics/exception" "io" "log" "path/filepath" "strings" "sync" "time" "github.com/vertgenlab/gonomics/fastq" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/genomeGraph" "github.com/vertgenlab/gonomics/giraf" "github.com/vertge...
697439883d495478619b1dc79e3d53d3e12db06e2f8a673208e53b7689d30a6c
Go
3,663
99
package gtf import ( "github.com/vertgenlab/gonomics/chromInfo" "github.com/vertgenlab/gonomics/vcf" ) // VariantArrayOverlap takes a vcf record and a map of bool slices (chrom name maps to a bool for each base in that chrom). // The bool slice encodes the presense/absense of some genomic feature and true is return...
aa161bdc1a800d607373974c44f841935389be4d2bfed5f209229c9262413cab
Go
3,699
112
package main import ( "os" "testing" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" ) var OverlapEnrichmentsTests = []struct { Method string Elements1File string Elements2File string SearchSpaceFile string OutFile string ExpectedFile s...