X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bp_bin%2Fpcr_seq;h=8700276e16287559ed9fe37f1d33b8c26c382e7a;hb=5ced0e7864e9645e56c6c618da1f04e0a4d667fc;hp=f54577373e75f7f32f24752c3a54ff31eaedafa8;hpb=e95fec9ae319e4da65e7dd5700abf7b4a036b411;p=biopieces.git diff --git a/bp_bin/pcr_seq b/bp_bin/pcr_seq index f545773..8700276 100755 --- a/bp_bin/pcr_seq +++ b/bp_bin/pcr_seq @@ -51,6 +51,7 @@ class Pcr command = "scan_for_matches" # command << " -c" + command << " -o 1" command << " #{pat_file}" command << " < #{@infile}" command << " > #{outfile}" @@ -152,14 +153,25 @@ class Pattern end casts = [] -casts << {:long=>'forward', :short=>'f', :type=>'string', :mandatory=>true, :default=>nil, :allowed=>nil, :disallowed=>nil} -casts << {:long=>'reverse', :short=>'r', :type=>'string', :mandatory=>true, :default=>nil, :allowed=>nil, :disallowed=>nil} -casts << {:long=>'max_dist', :short=>'m', :type=>'uint', :mandatory=>true, :default=>5000, :allowed=>nil, :disallowed=>"0"} +casts << {:long=>'forward', :short=>'f', :type=>'string', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil} +casts << {:long=>'forward_rc', :short=>'F', :type=>'string', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil} +casts << {:long=>'reverse', :short=>'r', :type=>'string', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil} +casts << {:long=>'reverse_rc', :short=>'R', :type=>'string', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil} +casts << {:long=>'max_dist', :short=>'m', :type=>'uint', :mandatory=>true, :default=>5000, :allowed=>nil, :disallowed=>"0"} options = Biopieces.options_parse(ARGV, casts) tmpdir = Biopieces.mktmpdir infile = File.join(tmpdir, "in.fna") +if options[:forward_rc] + options[:forward] = Seq.new("test", options[:forward_rc], 'dna').revcomp.seq +end + +if options[:reverse_rc] + options[:reverse] = Seq.new("test", options[:reverse_rc], 'dna').revcomp.seq +end + +raise ArgumentError, "no adaptor specified" unless options[:forward] or options[:reverse] Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output| Fasta.open(infile, mode="w") do |ios| input.each_record do |record|