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
## | |
# to_dokuwiki_table.rb | |
# convert tab-delimited text to dokuwiki table | |
file = ARGV[0] | |
File.open(file).each do |l| | |
a = l.chomp.split(/\t/) | |
puts "|" + a.map{|x| "#{x} "}.join("|") + "|" | |
end |
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 'rubygems' | |
require 'active_support/core_ext/hash/conversions' | |
require 'open-uri' | |
require 'json' | |
require 'yaml' | |
require 'pp' | |
infile = ARGV[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
cosine.coef <- function(x,y){ | |
a <- sum(na.omit(x * y)) / sqrt(sum(na.omit(x)^2) * sum(na.omit(y)^2)) | |
return(a) | |
} | |
cosine.table <- function(x) { | |
numberOfPoints <- ncol(x) | |
columnNames <- colnames(x) | |
distanceTable <- matrix(data = NA, nrow = numberOfPoints, ncol = numberOfPoints, | |
dimnames = list( columnNames, columnNames ) ) |
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
require 'bio' | |
include Bio | |
#require 'pp' | |
#alias :p :pp | |
ref_proteome_file = ARGV[0] | |
# || "/home/DB/public/processed/OrthoDB/OrthoDB7/blastdb/DMELA.Drosophila_melanogaster.fas") | |
blast_res_file = ARGV[1] | |
# || "BLAST_DMELA/RsGM3.evm.out.combined.pep.vs.DMELA.Drosophila_melanogaster.fas.blastp.fmt7c.txt") |
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/ruby | |
$pp = true # pretty print | |
$head = true # display header | |
$targetdir = ( ARGV[0] || "fastqc") | |
files = Dir["#{$targetdir}/*_fastqc/fastqc_data.txt"] | |
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
### Parse command-line options | |
require 'optparse' | |
opt = OptionParser.new | |
opt.on('-i', '--in FASTA', 'predicted protein files in fasta format [required]') {|v| $pepf = v} | |
opt.on('-d', '--db BLASTDB', 'blastdb [required]') {|v| $blastdb = v} | |
opt.on('-m', '--min [MIN_LEN]', 'min aa length to predict [default:50]') {|v| $min_len = v.to_i} | |
opt.on('-h', '--help', 'show this message'){ | |
puts opt; exit | |
} |
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/ruby | |
#=== config | |
MAX_MEMORY = 30000000000 | |
#=== | |
$sam = ARGV[0] | |
bam_unsorted = File.basename($sam, '.sam') + '.unsorted.bam' |
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
#=== | |
# taxpath.rb | |
# Obtain full path of lineage from root to target species | |
### conf ### | |
taxtab = "/home/DB/public/processed/NCBI/taxonomy/taxdump/nodes.dmp" | |
nametab = "/home/DB/public/processed/NCBI/taxonomy/taxdump/names.dmp" | |
### | |
infile = ARGV[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
#=== | |
# nr_taxinfo.rb | |
# | |
# Reading tab-delimited tables, retrieve taxonomy information. | |
# It works only with NCBI nr database. | |
# Three columns, tax_id, scientific_name and common_name, are added. | |
$infile = ARGV[0] | |
$blastdb = ARGV[1] | |
$keypos = (ARGV[2] || 1).to_i |
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
$infile = ARGV[0] | |
$blastdb = ARGV[1] | |
$keypos = (ARGV[2] || 1).to_i | |
=begin | |
counter = Hash.new(0) | |
File.open($infile).each do |l| | |
next if /^\#/.match(l) | |
a = l.chomp.split(/\t/) | |
tophit = a[2] |
NewerOlder