This file contains hidden or 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 'rubygems' | |
require 'bio' | |
blaster = Bio::Blast.local("tblastx", "/Users/philipp/Dropbox/IDP/ESTs/Ephydatia_muelleri/Ephydatia_muelleri", "", "/Users/philipp/Downloads/blast-2.2.25/bin/blastall") | |
sequence = ">EM1c1_molpal [Ephydatia_muelleri]\nGTTTTGTACAAGAAGACCATTCATAAGAACAATATTGATGACCACACAGTACACTAGAAG" | |
fasta = Bio::FastaFormat.new(sequence) | |
result = fasta.query(blaster) | |
puts result.hits.length | |
fasta.entry() | |
result = fasta.query(blaster) |
This file contains hidden or 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 'rubygems' | |
require 'bio' | |
seq = Bio::Sequence::NA.new("atgcagctctttgtccgcgcccaggagctacacaccttcgaggtgaccggccaggaaacggtcgcccagatcaaggctcatgtagcctcactggagggcattgccccggaagatcaagtcgtgctcctggcaggcgcgcccctggaggatgaggccactctgggccagtgcggggtggaggccctgactaccctggaagtagcaggccgcatgcttggaggtaaagtccatggttccctggcccgtgctggaaaagtgagaggtcagactcctaaggtggccaaacaggagaagaagaagaagaagacaggtcgggctaagcggcggatgcagtacaaccggcgctttgtcaacgttgtgcccacctttggcaagaagaagggccccaatgccaactcttaa") | |
remote = Bio::Blast.remote('blastn', 'genes-nt', '-e 0.01') | |
blobj = remote.query(seq) | |
blobj.each_hit do |hit| | |
puts "#{hit.target_def} #{hit.evalue}" | |
end |
This file contains hidden or 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 static org.junit.Assert.assertEquals; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Iterator; | |
import java.util.List; | |
import org.junit.Test; | |
class Merger { |
This file contains hidden or 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
f = File.open("B-large-practice.in") | |
num_testcases = f.readline.to_i | |
(1..num_testcases).each do |casenumber| | |
words = f.readline.split(' ') | |
print "Case #" + casenumber.to_s + ": " | |
words.reverse.each { |word| print word + " "} | |
print "\n" |
This file contains hidden or 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
f = File.open("A-large-practice.in") | |
num_testcases = f.readline.strip.to_i | |
casenumber = 1 | |
num_testcases.times do | |
credit = f.readline.strip.to_i | |
num_items = f.readline.strip.to_i | |
prices = f.readline.split(' ').collect {|x| x.to_i} |
NewerOlder