Sha256: 1085cb71b2324154ac9cc3e79a1c91aa2698090a193e9b58d9546972602be7fa

Contents?: true

Size: 591 Bytes

Versions: 22

Compression:

Stored size: 591 Bytes

Contents

#!/usr/bin/env ruby

require 'scbi_fastq'


if ARGV.count < 3
  puts "#{$0} FASTQ OUTPUT_NAME SPLIT_BY"
  exit
end


  
fastq = ARGV.shift
output_name = ARGV.shift
split_by = ARGV.shift.to_i


file_index=1
out=FastqFile.new("#{output_name}#{file_index}.fastq",'w')

fqr=FastqFile.new(fastq)

count = 0

fqr.each do |seq_name,seq_fasta,seq_qual,comments|
  
  out.write_seq(seq_name,seq_fasta,seq_qual,comments)

  count +=1

  if (count % split_by) == 0 
      
    file_index +=1
    out.close
    out=FastqFile.new("#{output_name}#{file_index}.fastq",'w')

  end
end

out.close
fqr.close

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
seqtrimnext-2.0.57 bin/split_fastq.rb
seqtrimnext-2.0.56 bin/split_fastq.rb
seqtrimnext-2.0.55 bin/split_fastq.rb
seqtrimnext-2.0.54 bin/split_fastq.rb
seqtrimnext-2.0.52 bin/split_fastq.rb
seqtrimnext-2.0.51 bin/split_fastq.rb
seqtrimnext-2.0.50 bin/split_fastq.rb
seqtrimnext-2.0.49 bin/split_fastq.rb
seqtrimnext-2.0.48 bin/split_fastq.rb
seqtrimnext-2.0.46 bin/split_fastq.rb
seqtrimnext-2.0.45 bin/split_fastq.rb
seqtrimnext-2.0.42 bin/split_fastq.rb
seqtrimnext-2.0.41 bin/split_fastq.rb
seqtrimnext-2.0.39 bin/split_fastq.rb
seqtrimnext-2.0.38 bin/split_fastq.rb
seqtrimnext-2.0.36 bin/split_fastq.rb
seqtrimnext-2.0.35 bin/split_fastq.rb
seqtrimnext-2.0.33 bin/split_fastq.rb
seqtrimnext-2.0.32 bin/split_fastq.rb
seqtrimnext-2.0.31 bin/split_fastq.rb