sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
1e8afe5f0f428fca649559757fe8fcf87e84e262c196d1999a859a748e9f7996 | CUDA | 1,537 | 60 | //---------------------------------------------------------------------------//
// Copyright (c) 2013-2014 Kyle Lutz <kyle.r.lutz@gmail.com>
//
// Distributed under the Boost Software License, Version 1.0
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
// See http://boosto... |
0182b666a132c8f66ed5cb9a0af43662f1e0ef196c027cb57572594ed9444cc0 | CUDA | 1,618 | 51 | //---------------------------------------------------------------------------//
// Copyright (c) 2013-2014 Kyle Lutz <kyle.r.lutz@gmail.com>
//
// Distributed under the Boost Software License, Version 1.0
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
// See http://boosto... |
0c2b5cef0cb286653a73be6a7f2017268a37dbff43a026062a5665b6ef638025 | CUDA | 1,857 | 65 | //---------------------------------------------------------------------------//
// Copyright (c) 2015 Jakub Szuppe <j.szuppe@gmail.com>
//
// Distributed under the Boost Software License, Version 1.0
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
// See http://boostorg.gi... |
b56a886af415709f0f5181569d92fe2fe4db3a155bd65eff7f5844cfe3416736 | CUDA | 1,872 | 61 | //---------------------------------------------------------------------------//
// Copyright (c) 2013-2014 Kyle Lutz <kyle.r.lutz@gmail.com>
//
// Distributed under the Boost Software License, Version 1.0
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
// See http://boosto... |
935724438d626cd3132178343c16aedc0f24209938475844d5a09df208aac29b | CUDA | 1,900 | 63 | //---------------------------------------------------------------------------//
// Copyright (c) 2013-2014 Kyle Lutz <kyle.r.lutz@gmail.com>
//
// Distributed under the Boost Software License, Version 1.0
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
// See http://boosto... |
d54fcb0b8bc6b0a486ba41b1a9503b750be970081fff0be5b36a31da6edbdedc | CUDA | 1,947 | 63 | //---------------------------------------------------------------------------//
// Copyright (c) 2013-2014 Kyle Lutz <kyle.r.lutz@gmail.com>
//
// Distributed under the Boost Software License, Version 1.0
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
// See http://boosto... |
7a0daffbcdce89854da3542c54e1f3972866960322cc3f4f7af635a41a1d9090 | CUDA | 2,513 | 82 | /*
Copyright (c) Microsoft Corporation.
Licensed under the MIT License.
*/
/*
Kernel implementation for blocking repeated n-grams.
*/
#include <cuda.h>
#include <cuda_runtime.h>
#include <math.h>
#include <torch/extension.h>
#include <vector>
// Ban repeated ngrams of length = 'no_repeat_ngram_size'
__global__ void ... |
3b01914732ceac285557be4c13c0c35c177a387a1d977e711608a8fb341f123a | CUDA | 2,788 | 92 | //---------------------------------------------------------------------------//
// Copyright (c) 2015 Jakub Szuppe <j.szuppe@gmail.com>
//
// Distributed under the Boost Software License, Version 1.0
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
// See http://boostorg.gi... |
eff5f56358c0fb8e7ad6cca7aab3a9a2f4ed61888662eaad446fd474503b646d | CUDA | 5,298 | 176 | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "../cuda_utils.cu"
#include "dynamicconv_cuda.cuh"
#include "dynamicconv_cuda_backward.cu"
#include "dynamicconv_cuda_for... |
481ef940cde0042a3fc18dcba59833b1c70f276a83f51a3689d9171a9ef4f426 | CUDA | 5,871 | 202 | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
template <typename U, typename V>
constexpr __host__ __device__ auto divUp(U a, V b) -> decltype(a + b) {
return (a + b - 1) / b... |
76bd62fe90d89e78fa08314da1c179a5342be83d0914933ccf407e5d6e121242 | CUDA | 6,909 | 187 | // BSD 3-Clause License
//
// Copyright (c) 2019, Karan Aggarwal (karan@iisc.ac.in)
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the a... |
bc18295e109ff5925a45f628bcfdcb393d95e3c098b7d2b0857172459503bbc8 | CUDA | 10,598 | 344 | /**
* Copyright 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "edit_dist.h"
#include <c10/cuda/CUDAStream.h>
#include <cuda.h>
#include <cuda_runtime.h>
#include <device_la... |
70e3b79a1f3a4bee7dd26cddb7716314aca14ae1b8e93afe5cfcdfd39cfdcd79 | CUDA | 10,609 | 400 | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "../cuda_utils.cu"
#include "lightconv_cuda.cuh"
#include "lightconv_cuda_backward.cu"
#include "lightconv_cuda_forward.c... |
5ff8c682cd4a04bf1cf1ac51c8440c00c0f1dcde8b790d47226972bf64801dc8 | CUDA | 10,763 | 354 | /**
* Copyright 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <ATen/ATen.h>
#include <ATen/cuda/CUDAContext.h> // @manual=//caffe2/aten:ATen-cu
#include <cuda_runtime.h>
#in... |
d25338bbe645fded6e7c5689b4ecc72ce6328efb1be19507e368dd8561689ad3 | Go | 126 | 6 | package bedGraph
// String converts a BedGraph struct to a string.
func (b BedGraph) String() string {
return ToString(b)
}
|
f5df6e80f2951c951f2ec8577eabd9e30b298af3a38593b602373c10b76a6174 | Go | 199 | 12 | package numbers
import (
"testing"
)
// Uncomment to print random variates for plotting.
func TestRandGeometric(t *testing.T) {
for i := 0; i < 10; i++ {
//fmt.Println(RandGeometric(0.5))
}
}
|
22ad98d0c5eb2e45147d78d5064b4542db878e15f3a1745cda8681edff6825e0 | Go | 344 | 10 | package main
import "fmt"
func main() {
fmt.Print(
"This directory contains deprecated commands, preserved for backwards compatability.\n" +
"Each deprecated command should point to an intended replacement program, and should\n" +
"describe how the usage of a deprecated program can be transferred to usage in... |
80444589065869c5ed6c3460ec42695655790e5e6492ceed0a21b6ed35dc5a8b | Go | 357 | 13 | package align
import (
"github.com/vertgenlab/gonomics/dna"
)
func ungappedRegionScore(alpha []dna.Base, alphaStart int64, beta []dna.Base, betaStart int64, length int64, scores [][]int64) int64 {
var answer int64 = 0
for i, j := alphaStart, betaStart; i < alphaStart+length; i, j = i+1, j+1 {
answer += scores[al... |
991df92e50956f390a89b873d3314725524f07524e633e340d68fab82061baf8 | Go | 365 | 16 | package main
import (
"io/ioutil"
"os"
"testing"
)
// minimal test for now until more complex functionality is implemented
// correctness is tested in the Sam package.
func TestPileup(t *testing.T) {
tmpfile, _ := ioutil.TempFile("", "")
pileup("../../sam/testdata/peak.bam", tmpfile.Name(), Settings{minDp: 0})
... |
ac06d4110ad6a3091f1f4b788e950a5edb049c355f7e4a29cb149d990ba2bac0 | Go | 390 | 27 | package axt
import (
"io"
)
func (a Axt) GetChrom() string {
return a.RName
}
func (a Axt) GetChromStart() int {
return int(a.RStart - 1)
}
func (a Axt) GetChromEnd() int {
return int(a.REnd)
}
func (a *Axt) UpdateLift(c string, start int, end int) {
a.RName = c
a.RStart = start
a.REnd = end
}
func (a Axt)... |
b1b72151a07aa490cef8a9ef7b70a2fe1a3949862626509f509c0a1c01d676d9 | Go | 390 | 16 | package bedpe
// GetChrom returns the chrom of a half of the bedpe struct.
func (b BedPeHalf) GetChrom() string {
return b.Chrom
}
// GetChromStart returns the starting coordinates of the bed struct.
func (b BedPeHalf) GetChromStart() int {
return b.ChromStart
}
// GetChromEnd returns the end coordinates of the be... |
10937bb50afd462eb38dfe0b1cd2d4c48b467e53ce781e843ef414f2ebf006d7 | Go | 393 | 19 | package cigar
// equal asserts equality between two Cigar structs
func equal(a, b Cigar) bool {
return a.Op == b.Op && a.RunLength == b.RunLength
}
// AllEqual performs a comparison between two slices of cigars
func AllEqual(a []Cigar, b []Cigar) bool {
if len(a) != len(b) {
return false
}
for i := 0; i < len(a... |
fc048ee0a91c147397fdbde29d92e6f5275580af7519127dedc787cdd5e795d6 | Go | 421 | 22 | package tree
import (
"math"
)
func numLeaves(node *Tree) int {
if node == nil {
return 0
} else {
return 1 + numLeaves(node.Left) + numLeaves(node.Right)
}
}
// Height returns the maximum cumulative branch length from the input tree node to a leaf node.
func Height(node *Tree) float64 {
if node == nil {
... |
ecb4f2e6d75cebbb33e700f128e078932590987d09ffc235a05ee22c11dcd9f0 | Go | 428 | 20 | package vcf
import (
"strings"
)
// Snp checks SVTYPE and returns true if the value is SNP
func Snp(v Vcf) bool {
return strings.Contains(v.Info, "SVTYPE=SNP")
}
// Ins checks SVTYPE and returns true if the value is INS
func Ins(v Vcf) bool {
return strings.Contains(v.Info, "SVTYPE=INS")
}
// Del checks SVTYPE a... |
24ee1dcc5e1ac95123ce14167286da706870b0f0e61f1a56fae91ce6d642bfef | Go | 452 | 20 | package main
import (
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"log"
"os"
"testing"
)
func TestOboToDot(t *testing.T) {
oboToDot("testdata/go.obo", "GO:0140110", "testdata/out.dot")
if fileio.AreEqualIgnoreOrder("testdata/out.dot", "testdata/expected.dot") {
err := ... |
1f09a23aa3ffe80b49ec738fb4c3c3d8c03f99c9cb4aaddf015e162d9af7e614 | Go | 468 | 16 | package net
// GetChrom returns the target chromosome name. This helps implement the Interval interface
func (n Net) GetChrom() string {
return n.TName
}
// GetChromStart returns the target chromosome start. This helps implement the Interval interface
func (n Net) GetChromStart() int {
return n.TStart
}
// GetChro... |
35ca507d9d14648687188819dcb6afe7e0c879e390fd668d24d04100b6320ed9 | Go | 471 | 23 | package net
import (
"github.com/vertgenlab/gonomics/bed"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"os"
"testing"
)
func TestToBed(t *testing.T) {
exp := "testdata/exp.NTB.bed"
out := "testdata/out.NTB.bed"
nets, _ := Read("testdata/test.in.net")
beds := ToBed(nets)
... |
513afdcba2a19d689da6fa5bf7541b68fd264e6dae4bfa381821a5761fb42835 | Go | 480 | 27 | package parse
import (
"log"
)
// StringToStrand returns true if s is '+', false if '-', and fatal error otherwise.
func StringToStrand(s string) bool {
switch s {
case "+":
return true
case "-":
return false
default:
log.Fatalf("Error: expecting %s to be a strand that is either '+' or '-'\n", s)
return ... |
615ea9b748a8ab9f3db41c0e1f35a90739080a01a495badc53192a4ca77fe5a0 | Go | 495 | 21 | package phylo
import (
"github.com/vertgenlab/gonomics/bed"
)
// MakeBitArrayFromSearchSpaceBed.
func MakeBitArrayFromSearchSpaceBed(searchSpaceFile string, referenceLength int, Chrom string) []bool {
searchSpace := bed.Read(searchSpaceFile)
bitArray := make([]bool, referenceLength)
var j int
for i := range sea... |
c2a1ebbaa485a3973c37fdbc12033f909d0eb1e777f23ce347b6d263a21cfa1b | Go | 507 | 24 | package main
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
func TestFaUniq(t *testing.T) {
inputFile := "testdata/test_in.fa"
outputFile := "testdata/test_out.fa"
expectedFile := "testdata/expected_out.fa"
var err error
faUniq(inputFile, output... |
22e2a3c06ae6c5b14129bd256de8c2129a55b445ebe37ee6f7790f69ab351b72 | Go | 511 | 27 | package fastq
import (
"os"
"reflect"
"testing"
)
var readWriteTests = []struct {
filename string // input
}{
{"testdata/test.fastq"},
}
func TestRead(t *testing.T) {
var tmpFilename string
for _, test := range readWriteTests {
tmpFilename = test.filename + ".tmp"
fastq := Read(test.filename)
Write(tmpF... |
25f3ebf77e537ffc399efbba60f6d277fab2694e30f69c0f341df6e14a34c92d | Go | 518 | 19 | package gaf
// RemoveDuplicates filters Gaf records that have the same GoId/DbObjectSymbol pairing.
func RemoveDuplicates(records []Gaf) []Gaf {
var seenPair = make(map[string]bool) //maps a string of "GeneIdGoTerm" to bool
var answer []Gaf
var currPair string
var foundInMap bool
for i := range records {
currP... |
2e1c905170c8be4dcdf78d328dad9255f9bde3417eb3d5ab4337f3ff7b5e13e5 | Go | 520 | 31 | package main
import (
"log"
"os"
"testing"
)
var (
genome = "testdata/testGenome.fa"
)
func TestBinGenome(t *testing.T) {
faBin(genome, "testdata", 0, 6, "")
err1 := os.Remove("testdata/chr1.fa")
err2 := os.Remove("testdata/testGenome.bin1.fa")
if err1 != nil || err2 != nil {
log.Panic(err1, err2)
}
f... |
b45e50215b5091cf554b7e8f6eac4a7e53fa61476e4ca221cec2b52a36680803 | Go | 532 | 30 | package vcf
import (
"strings"
"testing"
"github.com/vertgenlab/gonomics/dna"
)
func TestFixVcf(t *testing.T) {
ref := map[string][]dna.Base{
"test": {dna.A, dna.C, dna.G, dna.T}}
vcfTest := Vcf{
Chr: "test",
Pos: 2,
Ref: "C",
Alt: strings.Split("-", ",")}
correctAnswer := Vcf{
Chr: "test",
Pos:... |
8926ec654df84a772d9a41c12d11329a84f0a11046a8efe736c488319bbc6262 | Go | 538 | 22 | package bedpe
import (
"github.com/vertgenlab/gonomics/fileio"
"os"
"testing"
)
func TestContactsToMidpoints(t *testing.T) {
var records []BedPe
records = Read("testdata/BedPeFileTest.bedpe")
ContactsToMidpoints(records)
Write("testdata/temp.ContactMidpoints.bedpe", records)
equal := fileio.AreEqual("testdat... |
9912f9a77440cddbc9d475ed25e8adbab2b5d5df3225255b4fb79731ac24825d | Go | 542 | 26 | package giraf
import (
"fmt"
"io"
)
func (g *Giraf) GetChrom() string {
return fmt.Sprintf("%d", g.Path.Nodes[0])
}
func (g *Giraf) GetChromStart() int {
return g.Path.TStart
}
func (g *Giraf) GetChromEnd() int {
// BEWARE this returns the end position on the final node
// There may be a gotcha if you assume ... |
b9b5e68d4f9b13c65208d7cf6e861d3202872b26af5fe383278695b56857a36b | Go | 549 | 24 | package popgen
import (
"strings"
"testing"
)
var GroupList []*Group = []*Group{{Name: "apples", Members: strings.Split("Fuji:Honeycrisp:RedDelicious", ":")}, {Name: "bananas", Members: strings.Split("Cavendish:Plantain", ":")}}
var GroupTests = []struct {
inputFile string
expected []*Group
}{
{"testdata/test.... |
05b4e5718d53433d62726fffd8b26475947280eaea4bbe0ed4ebdf94fd9cee17 | Go | 555 | 20 | package bedpe
// ContactsToMidpoints returns a bedpe where the contacts have been collapsed to their midpoints
func ContactsToMidpoints(bps []BedPe) {
var aMidpoint, bMidpoint int
for i := range bps {
aMidpoint = (bps[i].A.ChromStart + bps[i].A.ChromEnd) / 2
bMidpoint = (bps[i].B.ChromStart + bps[i].B.ChromEnd) ... |
b6350230ee28a873e8a6c0ab8186bce543ac8976a7eb8b64dfbbcfb70a27f9ab | Go | 560 | 27 | package chain
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
var dir []string = []string{"testdata/big.chain", "testdata/twoChainZ.chain"}
func TestReadAndWrite(t *testing.T) {
var tmpFile string
var err error
for _, v := range dir {
tmpFile = v... |
5680e3e9001203b0f81be14d599fbe0ea6ebaad24f4d5a2d8c90ccc79647674d | Go | 580 | 24 | package numbers
import (
"math/bits"
)
const MaxInt = 1<<(bits.UintSize-1) - 1
const MinInt = -MaxInt - 1
const MaxUint = 1<<bits.UintSize - 1
// numerals and romans are parallel arrays that map integer values to their corresponding Roman numeral symbols.
var numerals = []int{1000, 900, 500, 400, 100, 90, 50, 40, 1... |
2fd1b7aeeb50c9a771333420f5553a13509a1ad941080bb4ae1a81244be1a6ca | Go | 587 | 25 | package gtf
import (
"io"
)
// GetChrom returns the name of the chromosome where the gene is located.
func (g *Gene) GetChrom() string {
return g.Transcripts[0].Chr
}
// GetChromStart returns the genomic coordinate where the gene starts.
func (g *Gene) GetChromStart() int {
return g.Transcripts[0].Start - 1
}
//... |
a026044c8865d3d5dc593fccd2b277b350cc27316ce40c8bf85152c615b19b24 | Go | 589 | 23 | package sort
import (
"io"
"github.com/vertgenlab/gonomics/fileio"
)
// Interface for generic merge sort of file types.
type MergeSort interface {
Len() int
Swap(i, j int)
Less(i, j int) bool
Push(x interface{})
Pop() interface{}
Write(file string) // Write entire slice to file
}
type MergeSortSingle interf... |
737ac70160d2531c0232ee174945c86f5ed19088dda600aa417e708fa81d32ae | Go | 598 | 17 | package dna
import (
"math"
"testing"
)
func TestMeltingTemp(t *testing.T) {
var testSeqs [][]Base = [][]Base{StringToBases("ATCGTGACTGA"), StringToBases("GTCGTGATTCTGC"), StringToBases("GTCGTTAGATTCTGT"), StringToBases("GCTGCGAATTCGCAGC")}
var expectedTm []float64 = []float64{32.4608090067, 41.6641715041, 41.048... |
03ee52be8339af01a9240c99483613d951b5ccea0f3870ac943ea52d3e109094 | Go | 608 | 29 | package sam
import (
"testing"
)
const testfile string = "../bgzf/testdata/test.bam.bai"
func TestReadBai(t *testing.T) {
bai := ReadBai(testfile)
if len(bai.refs) != 84 {
t.Errorf("problem reading bai file")
}
tRef := bai.refs[0]
if tRef.head.children[0].id != 4681 {
t.Errorf("problem reading bai file"... |
f7ce052b7357f41a7598004b32faa7b613e51fdc176d6f00148b41e71ffeb3a2 | Go | 608 | 19 | package fasta
import (
"testing"
)
func TestCreateIndex(t *testing.T) {
actual := CreateIndex("testdata/testOne_fmt.fa")
expected := readIndex("testdata/testOne_fmt.fa.fai")
if actual.String() != expected.String() {
t.Errorf("gonomics and samtools fasta indexes do not match.\ngonomics:\n%s\n\nsamtools:\n%s\n", ... |
fd8ab2981bdcc7128ae5839bac90abb630777027879f0d0f04e0b0930f185b0d | Go | 615 | 30 | package main
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
var FaInfoTests = []struct {
inputFile string
outputFile string
expectedFile string
}{
{"testdata/input.fa", "testdata/output.fa", "testdata/expected.fa"},
}
func TestFaInfo(t *test... |
86a08d019bdc7994a8291877c472a11e9685305cee3488f45fde6d46fe7d1622 | Go | 617 | 28 | package sam
import (
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"os"
"testing"
)
func TestReadSamPeToChan(t *testing.T) {
out := "testdata/out.pe.sam"
exp := "testdata/exp.pe.sam"
ch, head := GoReadSamPeToChan("testdata/pe.sam")
o := fileio.EasyCreate(out)
WriteHeaderT... |
bbc2c229d4093a9d64c6dc96d0a427bd7cdb2fc5433865cc864de5fff1d174ab | Go | 617 | 23 | package main
import (
"github.com/vertgenlab/gonomics/fasta"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/genomeGraph"
"github.com/vertgenlab/gonomics/vcf"
)
func vcfToGenomeGraph(vcfFile, faFile string) *genomeGraph.GenomeGraph {
ref := fasta.GoReadToChan(faFile)
hashByChrom := make... |
2ab2186947b700ca70d57d61859340405dc9a1d27c85a95f39c1034222fd2d85 | Go | 621 | 22 | package numbers
import (
"math/rand"
)
// RandIntInRange returns a pseudorandom value of type int between x and y.
// Output includes x, but not y.
func RandIntInRange(x int, y int) int {
return int(rand.Float64()*float64(y-x)) + x
}
// RandInt64InRange returns a pseudorandom value of type int64 between x and y.
/... |
b9d84048cdfd16f0b1cdb6d07c1de1023a950541400190c30a95920c58bf74db | Go | 621 | 30 | package expandedTree
import (
"log"
"testing"
"github.com/vertgenlab/gonomics/exception"
)
func TestReadTree(t *testing.T) {
var actualName = "root"
var aFound = false
tree, err := ReadTree("testdata/newick.txt", "testdata/fasta.fasta")
treeNodes := GetTree(tree)
exception.FatalOnErr(err)
if tree.Name != ac... |
8ceb5e92a5f4a9c60dc439f1f141eca502343c6fe77724c85dbd25b46be6bd79 | Go | 631 | 22 | package fastq
import (
"testing"
)
// TODO: files to read was modified because others didn't exist
// would be good to make this a tougher test.
func TestReadPairChan(t *testing.T) {
fastqPipe := make(chan PairedEnd, 824)
var readOne string = "testdata/simReads_R1.fq"
var readTwo string = "testdata/simReads_R2.fq... |
073ef5295ea16b5d3c28c6742fb0118f277baa5e79d52bc2e402ce9056bb743c | Go | 633 | 28 | package main
import (
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"os"
"testing"
)
var SamToBedTests = []struct {
inFile string
outFile_expected string
fragLength int
}{
{"testdata/test1.sam", "testdata/test1.bed", -1},
{"testdata/test2.sam", "testdata/t... |
7d7419a0e2ca3ba4e415ed578bbc3f6ab425110747acf4bdf77e7eca2b3b654c | Go | 635 | 30 | package main
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
var PrcompFormatTests = []struct {
Infile string
Outfile string
ExpectedFile string
}{
{"testdata/test.fa", "testdata/tmp.tsv", "testdata/expected.tsv"},
}
func TestPrcompForm... |
cf1152b46f97fdfac1c4bfa27f105ddf857fe294ec797950ba567d854db6d521 | Go | 635 | 23 | package cigar
import (
"testing"
)
func TestAllEqual(t *testing.T) {
tests := []struct {
alpha []Cigar
beta []Cigar
expected bool
}{
{[]Cigar{{RunLength: 10, Op: Match}}, []Cigar{{RunLength: 2, Op: Deletion}, {RunLength: 5, Op: Match}}, false},
{[]Cigar{{RunLength: 150, Op: Match}}, []Cigar{{RunLe... |
285e775657d365eef04e6e389552300e6ad589117e28ccf55cccdc67ea965fec | Go | 637 | 30 | package main
import (
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"os"
"testing"
)
var MafToBedTests = []struct {
inputFile string
outputFile string
expectedFile string
reference string
}{
{"testdata/chr22.test.maf", "testdata/tmp.bed", "testdata/expected.bed", ... |
8558867901e276441b68d26299f60e96e95582db4b13de116aa9ab85c6bfaa60 | Go | 648 | 31 | package main
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
var CatMultiFaTests = []struct {
FileList []string
O string
LineLength int
Expected string
}{
{[]string{"testdata/file1.fa", "testdata/file2.fa", "testdata/file3.fa"}, "test... |
34195bf52b0456685e3de1627d2134f4bae17bf713b67479fb556e202a51243e | Go | 662 | 31 | package main
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
var DotToNewickTests = []struct {
InFile string
OutFile string
ExpectedFile string
Verbose bool
}{
{"testdata/primate.dot", "testdata/tmp.nh", "testdata/expected.nh", fal... |
e3548a1dd21871e50430243f9e2d230a88048d114c8f65ddde06fbd75d1e7c02 | Go | 662 | 25 | package fasta
import "testing"
func TestRemove(t *testing.T) {
for _, test := range readWriteTests {
rmCopy := test.data[1]
expected := []Fasta{test.data[0], test.data[2]}
actual := Remove(test.data, 1)
if !AllAreEqual(expected, actual) {
t.Errorf("The %s file was not read correctly.", test.filename)
}
... |
0198ebbd54d51498f64b9144d88f6496b6eaaefef53a46621dde4a117d747d97 | Go | 668 | 27 | package obo
import (
"github.com/vertgenlab/gonomics/exception"
"os"
"testing"
)
// I/O fidelity test.
func TestOboReadAndWrite(t *testing.T) {
var failed bool = false
records1, header1 := Read("testdata/test.obo", true)
Write("testdata/out.obo", records1, header1)
records2, header2 := Read("testdata/out.obo",... |
4ce94872f7b793553e577631d84cd216df671e829311ed62d13f7b7fdbc28ccc | Go | 668 | 31 | package main
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
var MafFilterTests = []struct {
Infile string
Outfile string
Threshold float64
ExpectedFile string
}{
{"testdata/chr22.test.maf", "testdata/tmp.maf", 10000, "testdata/expec... |
a9754a724054071df5c67605307844fdba82b3c636249200de3e8a288d81c0f1 | Go | 670 | 38 | package sam
import (
"io"
"github.com/vertgenlab/gonomics/cigar"
)
func (s Sam) GetChrom() string {
return s.RName
}
func (s Sam) GetChromStart() int {
return int(s.Pos - 1)
}
func (s Sam) GetChromEnd() int {
var runLength int = 0
if !cigar.IsUnmapped(s.Cigar) {
for i := 0; i < len(s.Cigar); i++ {
if ci... |
92b8a5e9cdb2bec3754a0a6bdc2157f3e160aeae6a715a0bbd838b6a56321d22 | Go | 690 | 28 | package maf
import (
"testing"
"github.com/vertgenlab/gonomics/fasta"
)
var toFastaTests = []struct {
inputMaf string
inputFa string
inputSpecies []string
expected string
}{
{"testdata/toFastaTest.maf", "testdata/toFastaTest.fa", []string{"hg38", "panPan2", "panTro6", "gorGor5", "ponAbe3"}, "test... |
627f3b3c723908ea5d326ed7110df35110ed9b07eece0e8bb32a30cae365ee2e | Go | 695 | 31 | package main
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
var VcfAncestorAnnotationTests = []struct {
Infile string
Outfile string
ExpectedFile string
FaFile string
}{
{"testdata/in.vcf", "testdata/tmpOut.vcf", "testdata/expect... |
dbe9e883ec50e933868cc9127fb0119cca6f21c6066d896f936160037df81402 | Go | 698 | 24 | package fastq
import (
"github.com/vertgenlab/gonomics/dna"
)
// ReverseComplement produces the reverse complement sequence and corresponding Quals for an input Fastq record.
func ReverseComplement(record Fastq) {
dna.ReverseComplement(record.Seq)
ReverseQualUint8Record(record.Qual)
}
// ReverseComplementAll reve... |
5e779fca107feadd11cea8f2ac4abe4523fc2ca936d0c955d0d496afebce74af | Go | 699 | 37 | package main
import (
"flag"
"fmt"
"log"
)
func usage() {
fmt.Printf(
"gtfTools - a collection of tools for Gene Transfer Format files.\n" +
"Usage:\n" +
"\tgtfTools filter in.gtf out.gtf\n" +
"\tgtfTools toBed in.gtf out.bed\n" +
"Enter a subcommand to view options.\n")
}
func main() {
flag.Usage... |
56a93ec80afada43b557f3821811d7df7758c4a17cde48722892d046fe579751 | Go | 703 | 35 | package numbers
import (
"strings"
)
// IntToRoman converts an integer to its Roman numeral representation returning an integer.
func IntToRoman(numeral int) string {
var answer strings.Builder
for numeral > 0 {
for i := range numerals {
if numeral >= numerals[i] {
answer.WriteString(romans[i])
numera... |
09306ea237385e71e875328504e62f8436c45cc5731aa586a4cfa93aa262c1c9 | Go | 710 | 31 | package main
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
var divergenceSpectrumTests = []struct {
InFile string
VariantsFile string
OutFile string
ExpectedFile string
}{
{"testdata/test.bed", "testdata/test.vcf", "testdata/tmp.bed",... |
8641af955a05dbb751c37c1933e878c8185ff52365d018c5fcc0b7c879238a77 | Go | 712 | 33 | package main
import (
"github.com/vertgenlab/gonomics/fileio"
"testing"
)
var ReadLengthTests = []struct {
InFile string
OutFile string
ExpectedFile string
}{
{InFile: "testdata/readLength/small.sam",
OutFile: "testdata/readLength/test.readLength.txt",
ExpectedFile: "testdata/readLength/expe... |
2a534e9a54b8ad3b9a0e79ec37c1dd02af1031303b49838e75d451d2ac1ab214 | Go | 716 | 34 | package main
import (
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"os"
"testing"
)
var HistTests = []struct {
OboFile string
GafNamesFile string
OutFile string
ExpectedFile string
}{
{OboFile: "testdata/go.obo",
GafNamesFile: "testdata/gafFiles.txt",
OutFi... |
c532a10f6c33578e202aa202ef920df93ec0bc8e8b8dd7ceda0c32368012023e | Go | 720 | 23 | package main
import (
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"os"
"testing"
)
func TestBedTrim(t *testing.T) {
bedTrim(30, "testdata/in.bed", "testdata/out.30.bed")
if !fileio.AreEqual("testdata/exp.30.bed", "testdata/out.30.bed") {
t.Errorf("Error in bedTrim: expec... |
4badcf410e276226a076aac51adfabeed4b5978564c04b5fd01cebd336ae12e2 | Go | 725 | 33 | package main
import (
"testing"
"github.com/vertgenlab/gonomics/vcf"
)
func TestExpressionFormat(t *testing.T) {
data, header := vcf.Read("testdata/headerTest.vcf")
testExp := "FormatF >= 1"
tests := parseExpression(testExp, header, true, true)
for _, v := range data {
v = vcf.ParseFormat(v, header)
if !p... |
b089b6e01a21c27264fb323e4bcca867d62d0a66a0518be8473100886239ce19 | Go | 726 | 21 | package main
import (
"github.com/vertgenlab/gonomics/bed"
"os"
"testing"
)
func TestGetPromoter(t *testing.T) {
getPromoter("testdata/uniqueGenes.txt", "testdata/gtfFileTest.gtf", "testdata/tmp.bed", "testdata/hg38.chrom.sizes", 1000, 200)
if !bed.AllAreEqual(bed.Read("testdata/expected1kb.bed"), bed.Read("tes... |
2472f2488874cfdfcd615eabd7d12170068d5896ea59894d2650f4ec5b70cc4f | Go | 732 | 31 | package main
import (
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"os"
"testing"
)
var assemblyStatsTests = []struct {
inFa string
outFile string
expFile string
lowercaseAsGaps bool
}{
{"testdata/test.fa", "testdata/outFalse.txt", "testdata/ex... |
ec7efe37bae283603d29d39f23f4ec6e86c75ba959a7b78e73e6fb3e4a6cebed | Go | 734 | 33 | package fasta
import (
"sync"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
// ReadToChan is a helper function of GoReadToChan.
func ReadToChan(file *fileio.EasyReader, data chan<- Fasta, wg *sync.WaitGroup) {
for curr, done := NextFasta(file); !done; curr, done = NextFasta... |
9dc8e5205e810a21a80c4f0de1b5cc003238d8be40f3481821a6de132f322def | Go | 741 | 33 | package gtf
import (
"math/rand"
"testing"
)
func TestCanon(t *testing.T) {
gtf := Read("testdata/gtfFileTest.gtf")
for _, i := range gtf {
SortTranscripts(i)
if CdsLength(i.Transcripts[0]) != 221 {
t.Errorf("ERROR: Problem calculating Cds Length")
}
if CdnaLength(i.Transcripts[0]) != 1239 {
t.Error... |
f6cd35459c72c155e69787ea28e9895757d6585aa977abcdd2794176d952a73c | Go | 743 | 34 | package main
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
var MergeMultiFaTests = []struct {
InAFile string
InBFile string
OutFile string
ExpectedFile string
}{
{InAFile: "testdata/testA.fa",
InBFile: "testdata/testB.fa",
... |
759e7e8b4e832336c0325e30f3c69c9863a361d85c26bd2cf1490551212f251e | Go | 745 | 22 | package main
import (
"github.com/vertgenlab/gonomics/fileio"
"log"
"os"
"strings"
"testing"
)
func TestExampleTool(t *testing.T) { //compare the output results made from the predetermined files and see if the program gives th expected result
bedToAminoAcid("testdata/test.bed", "testdata/test.fasta", "testdata/... |
fb9be539e00772f35ed1d4176a5a7b991949e90eec5638b882a82ef052c6c276 | Go | 749 | 27 | package main
import (
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"os"
"testing"
)
func TestLongReadLibStats(t *testing.T) {
var err error
longReadLibStats("testdata/in.fq", "testdata/out.stats.txt", "testdata/out.sizes.txt")
if !fileio.AreEqual("testdata/out.stats.txt", ... |
a62b2f7024f5b9d4ca3f2f77b7a37f4ba964ee9cd69ce1624e5c3bd99890b629 | Go | 750 | 32 | package simulate
import (
"github.com/vertgenlab/gonomics/numbers/matrix"
"testing"
)
var ParseSubstitutionMatrixTests = []struct {
InFile string
Expected [][]float64
Precision float64
}{
{InFile: "testdata/substitutionMatrix.txt",
Expected: [][]float64{
{0.90, 0.05, 0.02, 0.03},
{0.05, 0.90, 0.03, ... |
d0faaac5cb36f3242f895d3d1ee7b4685fd5dcdbc18e5171610e2c4deda50af9 | Go | 761 | 41 | package main
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
var GafFilterTests = []struct {
InFile string
OutFile string
ExpectedFile string
RemoveNot bool
}{
{InFile: "testdata/test.gaf",
OutFile: "testdata/tmp.gaf",
Expec... |
9201f665e5f0874f0ddc1010d71c808c128375cad6ad08aac6f56df100c16b1f | Go | 762 | 32 | package main
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
var BedGraphToWigTests = []struct {
InFile string
ChromFile string
OutFile string
Missing float64
ExpectedFile string
}{
{"testdata/test.bedGraph", "testdata/ref.chro... |
d883b090328c28569f2384fdde8197a6d078a1f809e5b6546a3b121dcb37ead5 | Go | 766 | 32 | package main
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
var FormatIdeogramTests = []struct {
InFile string
OutFile string
ExpectedFile string
NoScore bool
}{
{"testdata/test.bed", "testdata/tmp.txt", "testdata/expected.Score.t... |
5362c24a406bc5bd1f7b7b3469b50d68e654b255cf3287a06d5ce578855cb8cc | Go | 772 | 36 | package motif
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
var ReadWritePfmTests = []struct {
InFile string
OutFile string
ExpectedFile string
Type string
}{
{"testdata/jaspar.vertebrate.txt",
"testdata/tmp.jaspar.txt",
"... |
649d4f41aa8b213e70fd887bfddc9600a83224bfbeebf69fc9c7d68ca485389a | Go | 772 | 34 | package main
import (
"flag"
"fmt"
"log"
)
func usage() {
fmt.Printf(
"oboTools - a collection of tools for manipulating files in the Open Biomedical Ontologies (OBO) file format.\n" +
"Subcommands include:\n" +
"\tmapping - a tool for creating tabular maps between Obo fields.\n" +
"Enter subcommands t... |
f3fca56b582919c33af718980c4ea3b51fc92f99346e1e20b8693174bebf7acd | Go | 772 | 27 | package chain
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/axt"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fasta"
"github.com/vertgenlab/gonomics/fileio"
)
func TestToAxt(t *testing.T) {
var err error
chainfile, _ := Read("testdata/axtTest.chain")
SortByCoordinates... |
3636dc3c8e581762f27e2011bac8b0dfab24dd1b2b803b5ac031b3f6b1599383 | Go | 778 | 47 | package sam
import (
"github.com/vertgenlab/gonomics/cigar"
"github.com/vertgenlab/gonomics/dna"
)
// Equal returns true if the two input Sam structs are identical.
func Equal(a Sam, b Sam) bool {
if a.QName != b.QName {
return false
}
if a.Flag != b.Flag {
return false
}
if a.RName != b.RName {
return f... |
c9f0c42508098d6bc417d75b66f5f97566823689ca821df013498028b2183c14 | Go | 788 | 38 | package fastq
import (
"testing"
)
var fq Fastq = Read("testdata/10x.barcoded_test.fastq")[0]
func TestQualToString(t *testing.T) {
if QualString(fq.Qual) != Uint8QualToString(fq.Qual) {
t.Errorf("Error: conversion was not successful...\n")
}
}
func BenchmarkStringBuilder(b *testing.B) {
b.ReportAllocs()
b.R... |
3d6ed9913ffbf0a1fcaf8e72d882bea530a372349856ded00e39659e8501facb | Go | 795 | 43 | package sort
import (
"math/rand"
"sort"
"testing"
"github.com/vertgenlab/gonomics/vcf"
)
func TestMergeSort(t *testing.T) {
rand.Seed(1)
vcfs, _ := vcf.Read("testdata/test.vcf")
data := make(chan vcf.Vcf, len(vcfs))
rand.Shuffle(len(vcfs), func(i, j int) {
vcfs[i], vcfs[j] = vcfs[j], vcfs[i]
})
for i :... |
af88682d3ddaaa790f2a0a3c2896c213b874b53a35c2680fb95f62405f9caf97 | Go | 797 | 30 | package dnaThreeBit
import (
"testing"
"github.com/vertgenlab/gonomics/dna"
)
//func NewThreeBitRainbow(inSeq []dna.Base, padding ThreeBitBase) []*ThreeBit {
var dnaFragments = []string{
"TCATACGTTTTTTTTTTTTTCTGTC",
"TCAAAACCCCCGGGGTTTTTCTGTC",
"TCATACGTACGTACGTCCCCCTGCCCC",
"TCATGGGGGGGGCCAGTACGTTGGCT",
"TC... |
83445e97b77e10d084ace46f75d4fb17cc02ed9ae71e2f789f026219e0c0f844 | Go | 803 | 32 | package main
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
var IntervalContactsTests = []struct {
BedPeFile string
InFile string
OutFile string
ExpectedFile string
}{
{"testdata/contacts.bedpe", "testdata/input.bed", "testdata/test... |
87633c422b24f3e15b6546ea57bae62fe4d399a3b8f5c913610d5b0c272eb0b6 | Go | 805 | 43 | package main
import (
"github.com/vertgenlab/gonomics/fileio"
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
)
var MfaScanTests = []struct {
inputFile string
outputFile string
queryName string
chrom string
expectedFile string
}{
{"testdata/testInput.fa", "testdata/out.bed", "Human... |
c80e7a527b9fa5a67a18d2b3080515a6ea54013cbcd96176bbf2964756bf0366 | Go | 812 | 39 | // Package dna implements a data structure for storage and manipulation of sequences of DNA.
package dna
// Base stores a single nucleotide as a byte.
type Base byte
const (
A Base = 0
C Base = 1
G Base = 2
T Base = 3
N Base = 4
LowerA Base = 5
LowerC Base = 6
LowerG Base = 7
LowerT ... |
9d406eb131b6a4012a2af35cba8bb17887f305aa74a6aecf2d3a1b316ffb8d31 | Go | 814 | 35 | package net
import (
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
"os"
"testing"
)
func TestReadAndWrite(t *testing.T) {
var outfile, infile string = "testdata/out.net", "testdata/test.in.net"
in, mp := Read(infile)
Write(outfile, in, mp)
if !fileio.AreEqual(outfile, infi... |
e3f3e1ee2d89aa4339323bd0490cfb6e00a89d04060ac81a41e373c326eff860 | Go | 814 | 31 | package chromInfo
import (
"reflect"
"testing"
)
func TestReading(t *testing.T) {
correctChr1 := ChromInfo{"chr1", 249250621, 0}
correctChr2 := ChromInfo{"chr2", 243199373, 1}
correctChr3 := ChromInfo{"chr3", 198022430, 2}
answerSlice := ReadToSlice("testdata/chromInfo.txt")
if answerSlice[0] != correctChr1 |... |
235ed5dd96e6f247f4be554322f4cff1978761cb52c35328bdf3ce9e0d11eeb9 | Go | 815 | 37 | package hic
import (
"testing"
)
var straw1 = Straw{Bin1Start: 5000, Bin2Start: 1000, ContactScore: 5}
var straw2 = Straw{Bin1Start: 2000, Bin2Start: 10000, ContactScore: 10}
var straws = []Straw{straw1, straw2}
var readStrawTests = []struct {
filename string
data []Straw
}{
{"testdata/strawTestFile.straw", ... |
d1e74e02db1f7d9ce6eb55502dd6e77b01b11a300f3e90f5601de8be4283d8dc | Go | 815 | 33 | package main
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
var ProximityBlockVcfTests = []struct {
InFile string
OutFile string
ExpectedFile string
Distance int
SetSeed int64
}{
{"testdata/test.vcf", "testdata/tmp.vcf", "tes... |
b53e156dd4cf3668d2190fce90e956b633e4c099e08ef191c655a98b880fb716 | Go | 816 | 33 | package main
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
var BedToFastaTests = []struct {
FastaFile string
BedFile string
OutFile string
RevComp bool
ExpectedFile string
}{
{"testdata/test.fa", "testdata/test.bed", "testdata... |
10595cd259193c3b8efe7ce074529836ca9c8c030cde9d2b7dd3c1eabea8e24d | Go | 830 | 33 | package main
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
var McmcTraceStatsTests = []struct {
InFile string
OutFile string
ExpectedFile string
HdiProportion float64
BurnIn int
ParameterName string
}{
{"testdata/Rand.trac... |
ffeb6e983512ece0bb5c45e5707c7b6afceef54219c0c1ac7f29949f99046663 | Go | 845 | 31 | package sort
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/fileio"
"github.com/vertgenlab/gonomics/genomeGraph"
)
func TestGirafExternalMergeSort(t *testing.T) {
graph := genomeGraph.Read("testdata/mini.gg")
sortOrder := genomeGraph.GetSortOrder(graph)
GirafExternalMergeSort("testdata/miniReads.gira... |
cfdad2b54a779003fa9d41b675f855f5c8306f76f80e2d8ee7e0905dad948842 | Go | 849 | 37 | package main
import (
"os"
"testing"
"github.com/vertgenlab/gonomics/exception"
"github.com/vertgenlab/gonomics/fileio"
)
var BedDistanceFromChrEndsTests = []struct {
inBed string
chromSize string
outBed string
expectedBed string
}{{"testdata/input1.bed",
"testdata/test.chrom.sizes",
"testdata... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.