options = Biopieces.options_parse(ARGV, casts)
tmp_dir = Biopieces.mktmpdir
-tmp_dir = "Sletmig"
tmp_fq = File.join(tmp_dir, "bwa.fq")
tmp_sai = File.join(tmp_dir, "bwa.sai")
tmp_sam = File.join(tmp_dir, "bwa.sam")
input.each_record do |record|
output.puts record
- if record.has_key? :SEQ_NAME and record.has_key? :SEQ and record.has_key? :SCORES
+ if record[:SEQ_NAME] and record[:SEQ] and record[:SCORES]
entry = Seq.new_bp(record)
io_fq.puts entry.to_fastq
Sam.open(tmp_sam, 'r') do |io_sam|
io_sam.each do |entry|
- output.puts Sam.to_bp(entry)
+ output.puts Sam.to_bp(entry) unless entry[:RNAME] == '*'
end
end
end