This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Requires Pandas, Numpy | |
Example: | |
In: data = {"primary_key": ["a", "a", "a", "b", "b", "b", "b", "c", "c"], | |
"target": ["x", "y", "z", "w", "x", "y", "z", "t", "u"]} | |
In: example_df = pd.DataFrame.from_dict(data) | |
Out: | |
primary_key target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/usr/bin/python | |
from pysam import VariantFile | |
import sys | |
import os | |
import argparse | |
parser = argparse.ArgumentParser() | |
bcf_in = VariantFile(sys.argv[1], 'r') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
i=0; | |
for f in /media/GTCoutput/*; | |
do | |
d=split_$(printf %03d $((i % 5+1))); | |
mkdir -p $d; | |
bn=$(basename "$f"); | |
ln -s "$f" "$PWD/$d/$bn"; | |
i=$((i+1)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import os | |
import pysam | |
import argparse | |
import errno | |
def main(): | |
parser = argparse.ArgumentParser(description="Splits BAM file into two BAM files, putting p reads into one BAM and (1-p) into the other") | |
parser.add_argument('-b', '--bam-file', dest='bam_file', required=True, help='Input BAM file') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
import os | |
from sets import Set | |
def create_file_set(filename, file_extension): | |
with open(filename, "r") as in_f: | |
result_set = Set() | |
for line in in_f: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
# used to set time zone for logging date/time | |
export TZ=":America/Los_Angeles" date | |
# sets max number of processes to launch in a batch | |
MAX_NUM_PROCS=24 | |
# directory holding the .sra files | |
SRA_FILES=/hdfs1/FlintData/*.sra | |
# directory to save the .fastq files to |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`timescale 1ns/100ps | |
module relu_backward_layer_tb(); | |
`include "/home/b/FPGA-CNN/test/test_data/relu_backward_test_data.vh" | |
parameter CYCLE = 5; //clk period: 5ns = 200Mhz signal | |
parameter NEG_SLOPE = 0.0; //negative slope param | |
parameter WIDTH = 8; //width of input/output vec | |
parameter NUM_TESTS = 4000; //number of test iterations | |
parameter MEM_SIZE = NUM_TESTS*WIDTH; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`timescale 1ns/100ps | |
module conv_forward_layer_tb(); | |
`include "/home/b/FPGA-CNN/test/test_data/conv_forward_test_data.vh" | |
parameter CYCLE = 5; //clk period: 5ns = 200 Mhz | |
parameter MULT_DELAY = 5; //#clks to complete a mult | |
parameter ADD_DELAY = 7; //#clks to complete an add | |
parameter WIDTH = 8; //input vector width | |
parameter NUM_TESTS = 5000; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`ifndef RELU_BACKWARD_TEST_H | |
`define RELU_BACKWARD_TEST_H | |
reg [31:0] test_input [32]; | |
reg [31:0] test_output [32]; | |
initial begin | |
test_input[0:7] = '{32'h4263335c, 32'h40c5e004, 32'hc10ecd76, 32'hc234574d, 32'h429a1ec3, 32'hc29511fd, 32'hc230bfa6, 32'hc1e3c527}; | |
test_output[0:7] = '{32'h4263335c, 32'h40c5e004, 32'h0, 32'h0, 32'h429a1ec3, 32'h0, 32'h0, 32'h0}; | |
//############ DEBUG ############ | |
test_input[0:7] = '{56.8001540825, 6.1835958546, -8.92516122294, -45.0852558653, 77.0600843176, -74.5351342745, -44.1871555525, -28.4712667127}; | |
test_output[0:7] = '{56.8001540825, 6.1835958546, 0.0, 0.0, 77.0600843176, 0.0, 0.0, 0.0}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`ifndef CONV_FORWARD_TEST_H | |
`define CONV_FORWARD_TEST_H | |
reg [31:0] test_input [32]; | |
reg [31:0] test_weights [32]; | |
reg [31:0] test_bias [4]; | |
reg [31:0] test_output [4]; | |
initial begin | |
test_input[0:7] = '{32'h42bc08ea, 32'hc117d9b4, 32'h41b9931d, 32'hc1886216, 32'hc0d38e20, 32'hc2748491, 32'hc29456ce, 32'h42a2e80b}; | |
test_weights[0:7] = '{32'h42bbbbd4, 32'hc1604072, 32'hc1e94116, 32'h4110a30e, 32'h4199d5f3, 32'hc2611d3f, 32'hc2bcf717, 32'hc189631a}; | |
test_bias[0] = '{32'h0}; |
NewerOlder