View benchmark.rb
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/env ruby | |
require 'set' | |
require 'google_hash' | |
require 'benchmark' | |
set = Set.new | |
hash = Hash.new(0) | |
ghashd = GoogleHashDenseIntToInt.new | |
ghashs = GoogleHashSparseIntToInt.new |
View bp.rb
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/env ruby | |
require 'biopieces' | |
p = BP.new. | |
read_fastq(input: "in1.fq", input2: "in2.fq"). | |
clip_primer(primer: "GTGCCAGCMGCCGCGGTAA", direction: :forward, mismatch_percent: 20, search_distance: 50). | |
clip_primer(primer: "GGACTACHVGGGTWTCTAAT", direction: :forward, mismatch_percent: 20, search_distance: 100). | |
trim_primer(primer: "GTGCCAGCMGCCGCGGTAA", direction: :forward, mismatch_percent: 20, overlap_min: 1). | |
trim_primer(primer: "GGACTACHVGGGTWTCTAAT", direction: :forward, mismatch_percent: 20, overlap_min: 1). |
View bleh.bash
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
# Function to assert no difference between | |
# two given files. | |
function assert_no_diff | |
{ | |
local src=$1 | |
local dst=$2 | |
if [ ! -f $src ]; then | |
echo_red "FAIL" | |
log "FAIL" |
View prodigal_pfam_merger.rb
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/env ruby | |
require 'pp' | |
prodigal_file = ARGV[0] | |
hmmsearch_file = ARGV[1] | |
hash_id = {} | |
File.open(hmmsearch_file) do |ios| | |
ios.each_line do |line| |
View sortfq
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/env perl | |
# Martin A. Hansen (mail@maasha.dk), September 2011 | |
use strict; | |
use warnings; | |
use IPC::Open2; | |
use File::Which; |
View reconstruct_index.rb
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/env ruby | |
require 'pp' | |
require 'maasha/fastq' | |
require 'maasha/seq' | |
map_file = "/home/maasha/Data/KimMagnussen/20130904_hiseq2a_rescue/sample_table.txt" | |
barcode_hash = {} | |
barcode1_hash = {} |
View hamming_dist.rb
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/env ruby | |
require 'narray' | |
# http://en.wikipedia.org/wiki/Nucleic_acid_notation | |
nuc_str = "ACGTUWSMKRYBDHVNacgtuwsmkrybdhvn" | |
bin_str = "\x08\x04\x02\x01\x01\x09\x06\x0c\x03\x0a\x05\x07\x0b\x0d\x0e\x0f\x08\x04\x02\x01\x01\x09\x06\x0c\x03\x0a\x05\x07\x0b\x0d\x0e\x0f" | |
str1 = "ATCGatcg" |
View gist:5567819
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/perl -w | |
use strict; | |
use Getopt::Long; | |
use Data::Dumper; | |
# Lea Benedicte Skov Hansen, Apr May 2013 | |
# Variables that should eventually be defined by user!! |
View gist:5567720
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/perl -w | |
use strict; | |
use Getopt::Long; | |
use Data::Dumper; | |
# Lea Benedicte Skov Hansen, Apr May 2013 | |
# Variables that should eventually be defined by user!! |
View gist:5567347
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/perl -w | |
use strict; | |
use Getopt::Long; | |
use Data::Dumper; | |
# Lea Benedicte Skov Hansen, Apr May 2013 | |
# Variables that should eventually be defined by user!! |
NewerOlder