sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
13594dc3c29004f76da8e54f24c6ad4dbdae0640ebfcd760b9dadb413f7ee65a
Go
5,222
153
package align import ( "fmt" "math" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/fasta" ) func fastaListToIndividualGroups(records []fasta.Fasta) [][]fasta.Fasta { answer := make([][]fasta.Fasta, len(records)) for i := range answer { answer[i] = make([]fasta.Fasta, 1) answer[i][0] =...
3d645a77bbbccb54e034f96a5dddeed2e1a5781ba2ecdb78744df885dfecd0b6
Go
5,225
152
package main import ( "flag" "fmt" "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fasta" "github.com/vertgenlab/gonomics/fileio" "log" "strings" ) type restrictionEnzyme struct { name string cutStrin...
ca728f4270a748e199c6a3a113216cfbc58b446737d98da9c7d933f531460bbe
Go
5,271
234
package fileio import ( "bytes" "fmt" "io" "os" "strings" "testing" "github.com/klauspost/pgzip" "github.com/vertgenlab/gonomics/exception" ) // example going straight to file. func writeDnaFile(file *os.File) { var fakeDna string = "ACGTACGTACGTACGTACGTACGTACGTACGTACGTACGT" var err error _, err = fmt.Fpr...
64895be8be3434e6bbfce8611a2c278fc90002f86a03da993a2e3e2f4f847b61
Go
5,323
172
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 string WindowSize int RefChrom...
1030bc80835f798bfee3f406685936f0907f17e428765f4ab7082edb5f0958fa
Go
5,353
96
package main import ( "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/numbers" "github.com/vertgenlab/gonomics/vcf" "os" "strings" "testing" ) var VcfFilterTests = []struct { inputFile string tmpOutFile string expectedOutputFile ...
6480e11058353c752275fda4fa355316646e8a93bd72eb3382d5d40d7d2e5cd0
Go
5,355
181
// Package bed provides functions for reading, writing, and manipulating Browser Extensible Data (BED) format files. // More information on the BED file format can be found at https://genome.ucsc.edu/FAQ/FAQformat.html#format1 package bed import ( "fmt" "github.com/vertgenlab/gonomics/exception" "github.com/vertgen...
4a15452a79485d8d8454734fbead70665d81a84698c9ea1edb88f91340af3492
Go
5,363
263
package vcf import ( "testing" ) var expectedFormat = map[string]interface{}{ "FormatF": [][]int{{1}, {2}}, "FormatJ": [][]rune{{'F', 'E'}, {'D', 'A'}}, "FormatK": [][]string{{"the,quick,brown,fox"}, {"jumps,over,the,lazy,dog"}}, } var expectedInfo = map[string]interface{}{ "InfoA": [][]int{{10}}, "InfoB"...
fcdf8784122618643098c49cfbbd37b9b661077fbe2d757ef46f5c392642eb5d
Go
5,403
155
// package psl defines the Psl struct containing alignment data as well as functions and methods that operate on the Psl struct package psl import ( "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/numbers/parse" "log" "strings" ) // Psl struct declares data fields and types for Psl struct....
fa120d8de08ff31e32968d32d73224ea27f795e338820ef01128f808ad8d9b1a
Go
5,420
148
package sam import ( "io" "log" "sort" "github.com/vertgenlab/gonomics/chromInfo" "github.com/vertgenlab/gonomics/exception" ) // SeekBamRegion returns a slice of reads that overlap the input region. SeekBamRegion will advance the // reader as necessary so beware continuing linear reading after a call to SeekBa...
dc5abea5b0ee2f4744a51305031f36134fceaf5811d52ca249698d171ee5a529
Go
5,428
153
// Command Group: "Data Simulation" // Simulates Vcf data, partitioned by divergence-based ascertainment package main import ( "flag" "fmt" "log" "math/rand" "sort" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/simulate" "github.com/vertge...
9a75ac4ca52d8fc7988665bbe3acd10abff68e000ed032357d20fd09b052062c
Go
5,430
147
package fastq import ( "fmt" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "log" "strings" "sync" ) // PairedEnd is a struct that contains two paired Fastq structs, marked Fwd and Rev. type PairedEnd struct { Fwd Fastq Rev Fastq } // ...
a2eca262ba52f3269018162558ec232772a042edf422d92c49394c7d16b45acb
Go
5,457
196
package genomeGraph import ( "log" "github.com/vertgenlab/gonomics/cigar" "github.com/vertgenlab/gonomics/dna" ) var HumanChimpTwoScoreMatrixNoGap = [][]int64{ {90, -330, -236, -356}, {-330, 100, -318, -236}, {-236, -318, 100, -330}, {-356, -236, -330, 90}, } func swMatrixSetup(size int64) ([][]int64, [][]by...
ecb52f2f2fe903d3a6af19048f93dc3bc337a7ab9fdbbb5d70186a18b0a63e80
Go
5,550
119
package dna import "testing" var revCompTests = []struct { input []Base // input expected []Base // after applying reverseComplement }{ {[]Base{A, C, G, T, N, LowerA, LowerC, LowerG, LowerT, LowerN}, []Base{LowerN, LowerA, LowerC, LowerG, LowerT, N, A, C, G, T}}, {[]Base{A, C, G, T, N, A, C, G, T, N}, []Base{N...
aa1b4fa62cb330ac368e0a44da5af802f29272ee9a0561acff74fbf5a86e3dff
Go
5,578
170
package vcf import ( "log" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/variant" ) // SmallVariantChans wraps channels for all of the small variants that // are valid variant.Mutators and variant.Effectors. All channels except // for Records sends a parsed version of a given Vcf record tha...
9acda5995d4576b303c174deeec2be84953735d387885b300fbb85f93aef60d7
Go
5,585
190
// Package cigar contains functions to manipulate cigar data in the SAM file format. // More information on cigars can be found in http://samtools.github.io/hts-specs/SAMv1.pdf package cigar import ( "log" "strconv" "strings" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/numbers/pars...
7eb783996e347c5643431c86e3268417ad9688cf6226e5bd2c66c616059956a4
Go
5,610
183
package dna // CompareBases returns an integer related to the lexographical order of nucleotides. // i.e. A < C < a < c < Dot < Gap. func CompareBases(alpha Base, beta Base, ignoreCase bool) int { if ignoreCase { alpha = ToUpper(alpha) beta = ToUpper(beta) } if alpha < beta { return -1 } else if alpha > beta...
fc7dba167e910b09ddcd57efad5e06c093cb9f272ff78a289f5abd1a873e2bb1
Go
5,612
131
package simulate import ( "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fasta" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/numbers" "github.com/vertgenlab/gonomics/popgen" "github....
0b63ba7cd41b5b38b910aa37bff95c9c266f5b52077af87eb6bdb524027bb87a
Go
5,613
166
package lastZWriter import ( "log" "os" "strings" "testing" "github.com/vertgenlab/gonomics/fileio" ) var parClose = []string{"O=600", "E=150", "H=2000", "T=2", "M=254", "K=4500", "L=3000", "Y=15000"} var parDefault = []string{"O=400", "E=30", "H=2000", "T=1", "M=254", "K=3000", "L=3000", "Y=9400"} var parFar =...
a4efd3e2a3ec9d7fff8c15c656392d1329286523154faeb78f9abcda2de44720
Go
5,627
134
package bigWig import ( "encoding/binary" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "log" ) // Read parses a BigWig struct from an input filename. func Read(filename string) BigWig { var err error var answer = BigWig{} file := fileio.EasyOpen(filename) answer.BbiHeader...
389248a9938e6d93e8c7bab180257826ba7ab86e2a36f5cf08d5cd58e427760d
Go
5,628
168
package reconstruct import ( "github.com/vertgenlab/gonomics/fasta" "github.com/vertgenlab/gonomics/genePred" "github.com/vertgenlab/gonomics/simulate" "log" ) // ReconAccuracy returns the percentage accuracy by base returned by reconstruct of each node and of all reconstructed nodes combined. // If calcBaseAcc =...
58c6e7e4f60dbd074b166e7f72bb17981a566c540967b857b101cd82cdc4c3e8
Go
5,651
173
package obo import ( "fmt" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "log" ) // buildTree is a helper function of Read that takes a map of string to *Obo structs and builds a tree, setting // the Parents and Children fields to point to related nodes. // If 'force' is true,...
d6046ac1e5b8fa006400e172fb6c2f7a0c23001b0a3de5cfb6f4cc0d72697847
Go
5,652
171
package interval import ( "fmt" "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/numbers" "log" "sort" "strings" ) // CoordsToString takes in a interval and returns a string in the format of chr:start-end func CoordsToString(i Interval) string { return fmt.Sprintf("%s:%v-%v", i.GetChrom(), ...
e3f353567a282cbebccb5ff7e67992c980f7067c2c7bba821e5b72239677ecd2
Go
5,654
232
package main import ( "fmt" "io" "log" "strconv" "strings" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/vcf" ) func writeTableHeader(outfile io.Writer, header vcf.Header, maxAlts int) (infoOrder []vcf.InfoHeader, formatOrder []vcf.FormatHeader) { s := new(strings.Builder) if le...
1c45f40f11bcbc0915c0f3ceefecd3c23f5260b3abfb0040ee9fd493ffddf753
Go
5,659
140
// Command Group: "Sequence Evolution & Reconstruction" // Command Usage: "Simulate evolution along a tree and perform ancestral reconstruction" // Simulates evolution from the root of a newick tree to the extant species of the trees and then uses the leaf nodes to reconstruct the ancestral nodes and compares the answ...
81afdab494c09875614ed56bf37cae4ba23f893abe38b55aa5724e4231cd5009
Go
5,661
151
// Command Group: "General Tools" // Produces a binary matrix for accessibility breadth analysis package main import ( "flag" "fmt" "log" "sort" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/interval" ) func intervalSubsetMatrix(unionFile s...
6f2f28c27178f99b751a21cac49ac1f65d64af66887f4f132c4aef78212ab061
Go
5,714
137
package dnaThreeBit import ( "log" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/numbers" ) // ThreeBit is a struct to represent long DNA sequences in a memory efficient format // Seq holds the encoded DNA sequence. The left-most three bits of Seq[0] hold the // first base. The first base...
3e16b30caf44db1754b64049082fb928a6ecf1cbef620c0f7c831b46a39f1614
Go
5,810
217
// Package numbers provides a variety of functions related to statistics package numbers import ( "log" "math" "github.com/vertgenlab/gonomics/numbers/logspace" ) // carefulMultDivFloat tries to gracefully handle the case when you have a // bunch of numbers being multiplied together in a numerator (numer) // and ...
bdd6be1b5dfae4d9f14a5ccd5dbddb56ff62a5cd3f1031f2929a0e5d272e4885
Go
5,827
220
// Package fileio provides wrappers of the builtin golang Reader/Writer utilities for ease of use and automatic gzip handling. package fileio import ( "bufio" "errors" "fmt" "io" "log" "os" "sort" "strings" "github.com/vertgenlab/gonomics/exception" ) // MustCreate creates a file with the input name. // Fat...
c6a056a1098b75d73793cd80f306db2cbf07eb4c154a81d223ca6a2af6e72597
Go
5,830
174
// Command Group: "SAM Tools" //TODO: Input-normalization. // Generate count matrix from single-cell sequencing data package main import ( "flag" "fmt" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/gtf" "...
80c672d5da8e8069eee7f20b8a41178ec76fb1ce9358f197363cfa2b301a5e6c
Go
5,861
186
// Package genePred is a package for reading, writing, and manipulating genePred structs package genePred import ( "fmt" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/numbers/parse" "io" "log" "strings" "github.com/vertgenlab/gonomics/fileio" ) // GenePred is a data struct which d...
17f8dab3542de79123328b6f66a2199de6cacfa473bfb3043df3ebf86b5f8614
Go
5,868
157
package genomeGraph import ( "fmt" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/dna/dnaTwoBit" "github.com/vertgenlab/gonomics/fastq" "github.com/vertgenlab/gonomics/numbers" "github.com/vertgenlab/gonomics/numbers/parse" "log" ) func RandomPairedReads(genome *GenomeGraph, readLength in...
443d7e28f594e247470737b2da1a4f7cf5d2f1c9d46f2469124442ae08978ece
Go
5,879
240
package dna import ( "log" "strings" "testing" "unicode/utf8" ) var equalStringsAndBases = []struct { characters string // first input bases []Base // second input }{ {"ACGTNacgtn", []Base{A, C, G, T, N, LowerA, LowerC, LowerG, LowerT, LowerN}}, {"ACACGGGGNNNNNN", []Base{A, C, A, C, G, G, G, G, N, N, N, ...
ca96176a985158e152bf099678276caee11c7c0f619412b47ba8135e6d6b417e
Go
5,898
191
// Package bedpe provides functions for handling Bed Paired End format files, used for // handling pairs of genomic regions. package bedpe import ( "fmt" "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/numbers...
615493ddbad38333f5704f66b8ca4d6f57d6f9cac40e7048e38b28308b5bd69e
Go
5,899
178
// Package axt provides the struct and functions that operate on alignments in Axt format. package axt import ( "fmt" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/numbers/parse" "io" "log" "strings" ) //...
81c507d7b2f8595b9c0b86879aff06fe29691d71f88fe6332dcac4d578c8d309
Go
5,939
190
// Command Group: "General Tools" // Finds values in a file and replaces them, processes the input as a string package main import ( "flag" "fmt" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "log" "regexp" "strings" ) func readFindReplacePairs(filename string, delim strin...
b9af70e1d7a0bba93d8ad59f9c4c9a9fa34be8784a66820f15221cee5e85b5b2
Go
5,943
196
package main import ( "os" "testing" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fasta" "github.com/vertgenlab/gonomics/fileio" ) var FaFormatTests = []struct { InputFile string OutputFile string ExpectedFile string LineLength ...
68a79ebe562000423c18d82cc72bb9e07121581e4e610f43c1e786b6787c4309
Go
5,954
186
// Command Group: "BED Tools" // Returns bed file with entries annotated based on the values corresponding to the region in a wig file package main import ( "flag" "fmt" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "log" "math" "github.com/vertgenlab/gonomics/bed" "githu...
867cf3f7793549fd93edca948f5a5e4eedea06ce4f82c5d6464e002fb3d64561
Go
5,978
229
package genomeGraph import ( "bytes" "fmt" "strings" "github.com/vertgenlab/gonomics/cigar" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/giraf" "github.com/vertgenlab/gonomics/numbers/parse" "github.com/vertgenlab/gonomics/sam" ) func PathToSeq(p giraf.Path, genome *GenomeGraph) []dna...
eaed7983e171943a47c0c1fe8f17e074566c4b549d86507abc7fffc53a19bcfd
Go
6,009
150
// Command Group: "Sequence Evolution & Reconstruction" // For two pFasta sequences, calculate a score at each base for the divergence between the two pDNA bases, convert the score to a binary substitution/non-substitution call, and return the calculations over a given window size package main import ( "flag" "fmt"...
24649931abffb473f3a07ae558b808532c5859ee465e77576ff0a77492bc4d1e
Go
6,087
165
package popgen import ( "fmt" "log" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" ) // PlotAfsF writes the Allele Frequency F function (AfsSampleDensity) to an output file for downstream visualization. func PlotAfsF(alpha float64, n int, outFile string, integralError float64)...
448764e0161afdad50e7d5b275210b63232e6a878377d53fc7602b412add6f48
Go
6,087
191
package sam import ( "log" "strconv" "strings" "github.com/vertgenlab/gonomics/chromInfo" ) // Metadata stores semi-parsed header data with several explicitly // parsed fields (e.g. Version) and the rest of the header encoded in // the AllTags field as a HeaderTagMap. type Metadata struct { Version string ...
64f0a8e7c02959a54e1468cb479e35ed64d3d2bd4769fbd6658cdac0061b1cce
Go
6,129
239
package gene import ( "testing" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/fasta" "github.com/vertgenlab/gonomics/gtf" ) func TestPointMutation(t *testing.T) { g := gtf.Read("testdata/test.gtf") f := fasta.Read("testdata/test.fasta") var answerPos, answerNeg EffectPrediction var er...
db59ebfb42b036ae878cc3cc92c1a0bdd16f7fe88e023f7a2f827c85551c94ef
Go
6,177
149
package main import ( "log" "math/rand" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/numbers" "github.com/vertgenlab/gonomics/sam" ) // diploidInsertion performs insertion variant calling on an input pile. If an insertion is found, it is added to // the answer structs, ans and mlt. // Th...
380c6e9eb853f90970f53831d09d045683729b87c46f8c10935e3a9c98de424b
Go
6,220
184
// Package motif provides functions for reading, writing, and manipulating position matrices for transcription factor binding site motif analysis. package motif import ( "fmt" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/numbers/parse" "log" "...
a1253c4688ca687e3b11d6977f52b72f238a510e86e1530069fd23456190713f
Go
6,232
193
package bed import ( "testing" ) var CompareDistanceTests = []struct { A Bed B Bed expectedDistance int expectedError bool }{ {A: Bed{Chrom: "chr1", ChromStart: 10, ChromEnd: 20, Name: ""}, B: Bed{Chrom: "chr2", ChromStart: 21, ChromEnd: 30, Name: ""}, expectedDistance: -1, expe...
f3dc0c2ad1c7dc0a9003ef9d545f62d47ba4b12b33a3a79197b43c136bc32d86
Go
6,259
192
package genomeGraph import ( "fmt" "github.com/vertgenlab/gonomics/cigar" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/fastq" "github.com/vertgenlab/gonomics/sam" ) func GraphSmithWatermanMemPool(gg *GenomeGraph, read fastq.FastqBig, seedHash map[uint64][]uint64, seedLen int, stepSize in...
644da4ae7486e819ebeaf634b391d3c88db08fb67428854a57d8f0c81e11d5b3
Go
6,272
107
// Command Group: "FASTA and Multi-FASTA Tools" // Takes pairwise alignment maf and finds insertions in species_ins not present in species_del but flanked by continuous alignments package main import ( "flag" "fmt" "log" "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/fileio" "github.com/v...
0866e295dde55703b4108c7dd452989a5b8c023aa88528b16abedd2d212db6c4
Go
6,274
143
package gtf import ( "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/chromInfo" "github.com/vertgenlab/gonomics/numbers" ) // GeneToTssBed returns the positions of all TSSs from a Gene as a slice of single base-pair bed entries. func GeneToTssBed(g Gene, c map[string]chromInfo.ChromInfo) []bed...
112bdfdc50de0688c3af0cb15dde024fb937fa78e9b0cabaf35163647aabb623
Go
6,287
256
package main import ( "log" "strconv" "strings" "github.com/vertgenlab/gonomics/vcf" ) type operator string const ( equal operator = "=" notEqual operator = "!=" greater operator = ">" less operator = "<" greaterEqual operator = ">=" lessEqual operator = "<=" present opera...
9ad62f2c80b896ddb3b256b5ff956a8b7c9c51a6af13e87cbb0e21af7a1b8dd8
Go
6,312
140
package main import ( "flag" "fmt" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/expandedTree" "github.com/vertgenlab/gonomics/fasta" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/numbers" "github.com/vertgenlab/gonomics/simulate" "log" "math/rand" "os"...
472a039fa4871847a91c8860b5ee999926a2797773f104ba5d2039dab56a7145
Go
6,316
198
// Package matrix provides tools for operations on matrices. This package relies heavily on // the gonum mat package, which implements high performance linear algebra operations. package matrix import ( "github.com/vertgenlab/gonomics/exception" "gonum.org/v1/gonum/mat" "log" "math" ) // FractionalSymmetricMatri...
aaa294f8ef84cbb28007f91b39ddfcc105ff01799e84deee2674a8657bd090ca
Go
6,329
102
package bigWig // Note that package bigWig is written to parse bigWig format version 4. // specs for version 4 are found in this file: https://github.com/ucscGenomeBrowser/kent/blob/master/src/inc/bbiFile.h // the official documentation for the bigWig file format (version 3) // can be found in the supplementary materi...
3627d439545d96b80b02b8a04e4fbd1db3664a8877471a8139e6a9ba36d7c1ce
Go
6,330
189
// Command Group: "FASTA and Multi-FASTA Tools" // Reformat the sequences in a fasta file package main import ( "flag" "fmt" "log" "strings" "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fasta" "github.com/vertgenlab/gonomics/fileio" ) type S...
53c59454820cb61851fed6f5f909abe84e3a0f0a0bddac3a17289d56e9bd071b
Go
6,336
210
package main import ( "flag" "fmt" "log" "os" "strings" "github.com/vertgenlab/gonomics/axt" "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/chain" "github.com/vertgenlab/gonomics/fasta" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/genomeGraph" "github.com/v...
ccfcb24a6c2f11d42935db3988fb217659de4c632e25af2a4afd9207183fad5b
Go
6,353
203
package dnaTwoBit import ( "testing" "github.com/vertgenlab/gonomics/dna" ) type seedTest struct { SeqA []dna.Base SmallA *TwoBit SeqB []dna.Base SmallB *TwoBit StartA int StartB int TrueMatchesLeft int TrueMatchesRight int } var longDnaOne ...
497c64badbd893d6b883edad79ba98bdc442fc4b14d15fb46e603157e2b8a611
Go
6,368
268
package sam import ( "runtime" "testing" "time" "github.com/vertgenlab/gonomics/chromInfo" "github.com/vertgenlab/gonomics/cigar" "github.com/vertgenlab/gonomics/dna" ) func BenchmarkPileupLinkedList(b *testing.B) { for i := 0; i < b.N; i++ { b.StopTimer() reads, header := GoReadToChan("testdata/peak.bam"...
f6cb5368fb0cae82a71fd04fbfb9a6054efbfa4807948a0367bb203121f23188
Go
6,374
221
package vcf import ( "fmt" "io" "log" "strconv" "strings" "sync" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" ) // Read parses a slice of VCF structs from an input filename. Does not store or return the header. func Read(filename string) ([]Vcf, Header) { var answer []...
89ef2e596f8f415c35fb7a0e4d43c2e34452a69d3f37ce7c0fcef61f1e6b0ef9
Go
6,392
179
package fasta import ( "testing" "github.com/vertgenlab/gonomics/dna" ) var seqThreeA = dna.StringToBases("ACGTacgTCATCATCATTACTACTAC") var seqThreeB = dna.StringToBases("acgtACGTACGT") var seqThreeC = dna.StringToBases("ACGTACGTACGTT") var rcSeqThreeA = dna.StringToBases("GTAGTAGTAATGATGATGAcgtACGT") var rcSeqThr...
e978416791c65d0cd3c881799d4136718b4f6926f878465b0e04c97445badbc3
Go
6,422
204
package vcf import ( "log" "math/rand" "github.com/vertgenlab/gonomics/dna" ) // IsHeterozygous returns true if more than 1 allele is present in the sample. func IsHeterozygous(s Sample) bool { if len(s.Alleles) == 0 { return false } alleleBase := s.Alleles[0] for i := 1; i < len(s.Alleles); i++ { if s.Al...
2eb10ff6fdcb0e5cce0220ae3c0cb10074d45fd90820be1599f51a221a5ad09b
Go
6,438
200
// Command Group: "General Tools" // Utilities for axt alignments package main import ( "flag" "fmt" "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/interval" "github.com/vertgenlab/gonomics/interval/lift" "log" "github.com/vertgenlab/gonomics/a...
6f4affd75bac42c57b2e3c045c11897e8f5efdabfc9d4c868c3297f5d60766ab
Go
6,480
196
package main import ( "math" "os" "testing" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/numbers" ) var BedFilterTests = []struct { InFile string OutFile string ExpectedFile string MinScore ...
f956863f7c69b1ad9086f8afba82482ff8d6491dfdf02025361a8b26c0be8977
Go
6,491
190
// Package genomeGraph has structs and tools for reading, writing, editing and aligning graph representations of genomes package genomeGraph import ( "fmt" "io" "log" "strings" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/dna/dnaTwoBit" "github.com/vertgenlab/gonomics/exception" "githu...
e02eab2c07956e138cf93675144ee69282d70fdd2430e52e7c02ee19f0597f09
Go
6,502
163
package sam import "testing" var DiploidIndelCallFromPileTests = []struct { P Pile Delta float64 Epsilon float64 Kappa float64 ExpectedInsertion DiploidInsertion ExpectedDeletion DiploidDeletion }{ {P: Pile{CountF: [13]int{30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
25404d7a8453b9c8067962419427e143763b8104decfa24c921cac658f3f1206
Go
6,621
203
package dnaThreeBit import ( "testing" "github.com/vertgenlab/gonomics/dna" ) type seedTest struct { SeqA []dna.Base SmallA *ThreeBit SeqB []dna.Base SmallB *ThreeBit StartA int StartB int TrueMatchesLeft int TrueMatchesRight int } var longD...
d00e69ba7ebd84b514727272badb5c70e23472872463aba908229e36b9892a4f
Go
6,624
139
// Command Group: "Linear Alignment Tools" // Align two FASTA files, each with only 1 sequence package main import ( "flag" "fmt" "log" "os" //raven added this line for MSA Fasta output "strings" //raven added this line for CountSeqIdx "github.com/vertgenlab/gonomics/align" "github.com/vertgenlab/gonomic...
c46b7c161b255cf5452cf4de501b6b65008abc1185cb51a0cda315f9f38d75cd
Go
6,654
210
// Package fasta provides functions for reading, writing, and manipulating fasta files. package fasta import ( "bytes" "errors" "fmt" "io" "log" "strings" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" ) // Fasta stores the name and se...
f2abecab361e1434fe831b2031941ee2a5838b5617dce1d2b9399e4019f5ebdd
Go
6,691
209
package main //TODO : add check for self-overlap bed files //TODO: add enrichment calculations import ( "flag" "fmt" "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/interval" "log" "strings" ) type setting...
a38d637bb5a7ed884fe7c8f245ddfb98590d45b81bdf25288450f5e55bde014c
Go
6,697
224
package net import ( "fmt" "github.com/vertgenlab/gonomics/chromInfo" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/numbers/parse" "strconv" "strings" "sync" ) // Net represents an alignment block built off of chains, it represents the UCSC ...
7fa8a8528b4e837b2aa8c4e29629974e2d471c204b61b7d14773f1a8bc11f46d
Go
6,831
191
package motif import ( "log" "math" "math/rand" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/fasta" ) // PfmToPpm creates a position probability matrix from an input position frequency matrix. // Pseudocounts may be applied for Laplace smoothing. The input float represents the value adde...
35e4ccb751be68f8633b523a1ce499dfbf20ede9bf2ad821f4e810630e40766d
Go
6,899
245
// A collection of tools that use the gonomics core library package main import ( _ "embed" "flag" "io/fs" "io/ioutil" "log" "os" "os/exec" "path/filepath" "strings" "github.com/vertgenlab/gonomics/exception" ) //go:embed command_cache.txt var cache string // getBin returns the path to binary executables ...
ef15b794466a3e9804aaa600e8b5fc315ac8f5306503776b9682d190d0712b90
Go
6,915
239
// Package sort holds structs and functions for sorting genomic data types package sort import ( "container/heap" "fmt" "github.com/vertgenlab/gonomics/exception" "log" "os" "sort" "strconv" "sync" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/giraf" ) const ( maxTmpFilesAllowed ...
db9dc683d99c7872d0e762a9446843cb456a5d3617bd938459cd4303740a0e90
Go
7,056
169
package sam import ( "math" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/numbers" "github.com/vertgenlab/gonomics/numbers/logspace" ) // HaploidCall is a struct to represent the data of a haploid genotype called // from a Pileup from a haploid genome. type HaploidCall struct { Base ...
2bd31f9a927cedfccf74d8e82d2c8ef7b98a5168e558a29352bc2b164bc45317
Go
7,067
209
package main import ( "os" "testing" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" ) var BedFormatTests = []struct { InFile string OutFile string CoordName bool ExpectedFile string UCSCToEnsembl boo...
5209217a7c19730f90a2d9de9a8e19aa6c2e1ae2969a00aa82aa0b30af88f116
Go
7,112
211
// Package gaf provides functions for reading, writing, and manipulating GO Annotation File (GAF) format files. // This package uses the GAF 2.2 file format as specified at the following URL: http://geneontology.org/docs/go-annotation-file-gaf-format-2.2/ // Files in this format can be downloaded after fileting for des...
995b199479f29e3c1234acbe48de61dfe496e21068d6221033daafa4076901af
Go
7,130
317
package sam import ( "os" "reflect" "sync" "testing" "github.com/vertgenlab/gonomics/cigar" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/fileio" ) var r001 = Sam{ QName: "r001", Flag: 99, MapQ: 30, RName: "ref", Pos: 7, Cigar: cigar.FromString("8M2I4M1D3M"), RNext: "=", PNe...
da2a183575e2700ef12727b8ac0beb57972dafed63f88df85939515a7f10cbf0
Go
7,136
218
package convert import ( "os" "strings" "testing" "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/sam" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fasta" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/g...
7aa1272901d427b963edfb7b285d4a2f4c2e0e8e5ac3cdbfa63d06f77cea1bf4
Go
7,145
193
package dna import ( "testing" ) var expected []Codon = []Codon{{A, A, G}, {T, G, A}, {A, A, C}} var testSeq = StringToBases("AAGTGAAAC") var test2DNA = StringToBases("atgcagatttttgtgaaaaccctgaccggcaaaacctga") var expectedShortProtein string = "MQIFVKTLTGKT*" var expectedProtein string = "MetGlnIlePheValLysThrLeuTh...
53bce33a90b7316b4f2bb0130f12c0d664f67c92b10174c4fe426e4ab6211153
Go
7,149
266
package pDna import ( "github.com/vertgenlab/gonomics/dna" "log" "math" "math/rand" ) // Float32Base encodes a DNA base as a probability vector using float32 precision. // Note that gap probabilities can be stored implicitly as 1 - (A + C + G + T). type Float32Base struct { A float32 C float32 G float32 T flo...
e6c8e7cb4fd16aa691414d7c3e654d08d243e24d7ff52d6f030ac8bd77b88f8b
Go
7,170
134
package popgen import ( "log" "math" "github.com/vertgenlab/gonomics/numbers" "github.com/vertgenlab/gonomics/numbers/logspace" ) // BuildFCache builds a slice of len(n) where each index i contains log(F(i | n, alpha)), where F is popgen.AFSSampleDensity. func BuildFCache(n int, alpha float64, binomCache [][]flo...
1c0cc7be8a8a76146cc5d1353e953db1b4b9cd49c44fcd02b54271f4dfeafb71
Go
7,227
198
package numbers import ( "log" "math" "math/rand" ) // SampleInverseNormal returns a simulated value from a normal distribution. func SampleInverseNormal(mu float64, sigma float64) float64 { return rand.NormFloat64()*sigma + mu } // InitializeFastRejectionSampler takes in the parameters of a rejection sampler an...
2fd535f75394963f9a9ebefeb0156d9cfa0018ed8d9ae1a503ddfa35cdf6606d
Go
7,235
177
// Package lastZWriter takes in alignment information and creates a file that contains all necessary lastz jobs with all required parameters for any species listed, as well as creating all the directories where data will be stored when those jobs are run. package lastZWriter import ( "github.com/vertgenlab/gonomics/f...
80f70638e0c2584c7a6c1e4ff388a5ed81ca8777bac3266638d6d141b500ce9d
Go
7,281
125
package sam import ( "math" "testing" ) var AncientBaseLikelihoodTests = []struct { aCount int cCount int gCount int tCount int epsilon float64 lambda float64 ExpectedValues []float64 }{ { aCount: 13, cCount: 5, gCount: 0, tCount...
cdb3a6957d87d975253fbdcd355c3cd2664400b7094f0a9e08be82c5e939827b
Go
7,281
255
package interval import ( "bytes" "fmt" "log" "os" "strings" "testing" "github.com/vertgenlab/gonomics/axt" "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/chain" "github.com/vertgenlab/gonomics/cigar" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/fileio" "gith...
740ade9fe7c3654d8c34b6e87fee2f7ccb4d68bd4395e64dfdff8d3d241b873e
Go
7,298
192
package graphReconstruct import ( "log" "testing" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/dna/dnaTwoBit" "github.com/vertgenlab/gonomics/expandedTree" "github.com/vertgenlab/gonomics/genomeGraph" ) var ( allAlign []graphColumn humanGraph = genomeGraph.EmptyGraph() humanNode1 =...
2204ba9f6e4341fe437b67461c4c7e27809994f4fb0ce799ef6797e68767d9a6
Go
7,405
511
package pFasta import ( "fmt" "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/dna/pDna" "testing" ) // ExtractTests tests a valid input to Extract var ExtractTests = []struct { Input []PFasta Start int End int OutputName string Chrom string TakeCoords bool Expecte...
49cb515a5bbcb4bca10f90afc3894b17aecfeb4543a0db2f41d78e9e3a432f89
Go
7,413
229
// Command Group: "Data Conversion" // Convert a pairwise multiFa format alignment to a chain file. First species is the target by default package main import ( "flag" "fmt" "log" "github.com/vertgenlab/gonomics/chain" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/fasta" ) type State by...
8ef52300223ac99c6816a5fe2211ca670c74ee77554438aee32c093097aace5f
Go
7,434
286
//# GONOMICS: testse package main import ( "fmt" "log" "os" "os/exec" "runtime" "sort" "strings" "text/tabwriter" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "golang.org/x/exp/slices" ) var Reset = "\033[0m" var Red = "\033[31m" var Green = "\033[32m" var Yellow = "...
691d122ae813aebcf5142bf6cd61297d49285a4b5489ff501294a5712346e333
Go
7,494
211
// Command Group: "Data Simulation" // Simulate alignments to a reference sequence package main import ( "flag" "fmt" "log" "math/rand" "sort" "strings" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fasta" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/...
e02656544220e00d65f95232019da52a2ffd904ed763fa8250cfc56de44cd612
Go
7,508
201
// Command Group: "BED Tools" // Output a subset of a bed file using score, name, position, and length package main import ( "flag" "fmt" "log" "math" "math/rand" "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/go...
2aaf6719cc6cba24e08074173acdb43e6549b6ed33712338faeb1ff0c34e1830
Go
7,585
196
package gene import ( "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/fasta" "github.com/vertgenlab/gonomics/gtf" ) // GtfToGene converts a gtf record into a Gene data structure. // If multiple isoforms are present, only the isoform with the longest CDS is used. func GtfToGene(g *gtf.Gene, ref...
9fafeb6cf2fcfb05b573aef90eeedd3d816e7094b582bb07241c7f71ca5dad36
Go
7,594
220
package sam import ( "fmt" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/numbers" ) // consensusType represents the possible types of consensus variants in a Pile, // which includes Bases, INDELs, or undefined (in the case where the Pile contains no data). type consensusType byte const ( ...
dc818f2ac111f60de21ea81bb42f116decc45568dfd414dc586644b0c9d2a37e
Go
7,638
211
package align import ( "fmt" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fasta" "testing" ) var affineAlignTests = []struct { seqOne string seqTwo string aln string }{ {"ACGT", "ACGT", "ACGT\nACGT\n"}, {"ACGT", "CGT", "ACGT\n-CGT\n"}, {...
15e408676b0a5394a8549705e395d6bd091ea3f33211a09c6a59345b8f71838a
Go
7,655
215
package numbers import ( "fmt" "math" "testing" ) //All expected values are calculated from online calculator tools or in the R programming language. func ExplicitBinomialDist(n int, k int, p float64) float64 { return float64(BinomCoefficient(n, k)) * math.Pow(p, float64(k)) * math.Pow(1-p, float64(n-k)) } func...
20b85963600fe751f7261b58861a9ebfaedf5c95d3976f17e7bf9695cdf6ac2d
Go
7,668
192
package main import ( "flag" "fmt" "log" "math" "math/rand" "os" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fasta" "github.com/vertgenlab/gonomics/fileio" "github.com/vertgenlab/gonomics/wig" ) // ToTrainingSetSettings defines the usage ...
f6e54c68534a8561494936946d03e2d2071e8d88c9319abad6edcfd26dd489f7
Go
7,689
250
package fasta import ( "log" "github.com/vertgenlab/gonomics/dna" ) // BinGenomeNoBreaks takes in an entire genome which is sorted largest to smallest contig and breaks up the fasta so // that smaller contigs get combined into a single fasta, while large contigs become a single fasta on their own. The user // must...
e886ff5d3c53a20026ba7a5d01dda2b205d25d11d642fb9a36c511f74fb6e802
Go
7,735
260
// Package tree provides a struct and functions that allow for creating binary trees // modifying them, and doing calculations on them. package tree import ( "bytes" "errors" "fmt" "github.com/vertgenlab/gonomics/exception" "log" "os" "strconv" "strings" "github.com/vertgenlab/gonomics/fileio" ) // A Tree i...
671e69cd5d201c6cb6814d75b3f0715ea3ba39303de82f2b5b6017d097ca9963
Go
7,767
251
// Command Group: "FASTQ Tools" // Returns a filtered fastq based on option parameters package main import ( "flag" "fmt" "log" "math/rand" "sync" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fastq" "github.com/vertgenlab/gonomics/fileio" "...
96972c2afb345360d2d7d00f1da293bd7308ce6405552de1fe4fcae65a2d60de
Go
7,769
267
// Command Group: "Data Simulation" // Predict amplicon products generated from PCR package main import ( "flag" "fmt" "log" "math" "runtime" "sort" "strings" "sync" "github.com/vertgenlab/gonomics/bed" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab...
737663117f7d4db684899158e646b9f6e3d33ea13c8b43ffd0016ba315193fa8
Go
7,782
234
package main import ( "os" "testing" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" ) var ancoraBuildTests = []struct { SamFileName string RefFile string OutFileA string OutFileB string MultiFaDir string qNameA...
684f629f601ba82badf8a6ecb18a276b3d2acd1a10c9beeb3cda8b9f93d408da
Go
7,861
310
package cigar import ( "bytes" "log" "os" "strings" "testing" ) var c1 Cigar = Cigar{RunLength: 35, Op: Match} var c2 Cigar = Cigar{RunLength: 2, Op: Insertion} var c3 Cigar = Cigar{RunLength: 16, Op: Deletion} var c4 Cigar = Cigar{RunLength: 5, Op: Match} var c5 Cigar = Cigar{RunLength: 2, Op: Mismatch} var c6 ...