Sha256: beacbe318cce4db639b30239d1336e77ae303ad822df70123f4bf66e63d02baa

Contents?: true

Size: 788 Bytes

Versions: 28

Compression:

Stored size: 788 Bytes

Contents

#!/usr/bin/env ruby

require 'scbi_fastq'

class Array
 def count
	self.length
 end

end

if ARGV.count < 3
  puts "#{$0} FASTA OUTPUT_NAME SEQ_NAME_FILE [MORE_SEQ_NAMES]"
  exit
else
  
  fasta = ARGV.shift
  qual = ARGV.shift
  output_name = ARGV.shift
  seqs=ARGV
  puts seqs.join(';')
  
	fqr=FastaQualFile.new(fasta,qual)
	
	output_fasta=File.new(output_name+'.fasta','a')
	output_qual=File.new(output_name+'.fasta.qual','a')

	fqr.each do |seq_name,seq_fasta,seq_qual|
  	if seqs.index(seq_name)
  	    output_fasta.puts ">#{seq_name}"
  			output_fasta.puts seq_fasta
  	    output_qual.puts ">#{seq_name}"
  			output_qual.puts seq_qual
  			seqs.delete(seq_name)
  			if seqs.empty?
  			  break
			  end
  	end
  end
  
  output_qual.close
  output_fasta.close
  fqr.close

end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
seqtrimnext-2.0.68 bin/extract_seqs.rb
seqtrimnext-2.0.66 bin/extract_seqs.rb
seqtrimnext-2.0.62 bin/extract_seqs.rb
seqtrimnext-2.0.61 bin/extract_seqs.rb
seqtrimnext-2.0.60 bin/extract_seqs.rb
seqtrimnext-2.0.59 bin/extract_seqs.rb
seqtrimnext-2.0.57 bin/extract_seqs.rb
seqtrimnext-2.0.56 bin/extract_seqs.rb
seqtrimnext-2.0.55 bin/extract_seqs.rb
seqtrimnext-2.0.54 bin/extract_seqs.rb
seqtrimnext-2.0.52 bin/extract_seqs.rb
seqtrimnext-2.0.51 bin/extract_seqs.rb
seqtrimnext-2.0.50 bin/extract_seqs.rb
seqtrimnext-2.0.49 bin/extract_seqs.rb
seqtrimnext-2.0.48 bin/extract_seqs.rb
seqtrimnext-2.0.46 bin/extract_seqs.rb
seqtrimnext-2.0.45 bin/extract_seqs.rb
seqtrimnext-2.0.42 bin/extract_seqs.rb
seqtrimnext-2.0.41 bin/extract_seqs.rb
seqtrimnext-2.0.39 bin/extract_seqs.rb