Sha256: 317d8ba90af50680e1604389db1ec54023c432b4854838f75cf4ed0f41dd1dd2
Contents?: true
Size: 1.48 KB
Versions: 1
Compression:
Stored size: 1.48 KB
Contents
#!/usr/bin/env ruby # load required libraries require 'scbi_mapreduce' # in order to load fastq files require 'scbi_fastq' # modify include path $: << File.join(File.dirname(__FILE__),'lib') require 'find_mids' include FindMids # check arguments if ARGV.count != 1 puts "Usage #{File.basename($0)} fastq_file" puts "" puts "#{File.basename($0)} iterates over all sequences in fastq_file (a file in FastQ format) and removes a KNOWN_MID from it" exit end fastq_file_path=ARGV[0] if !File.exists?(fastq_file_path) puts "Error, #{fastq_file_path} doesn't exists" exit end # make processing # open files @@fastq_file=FastqFile.new(fastq_file_path) @@results=FastqFile.new('./results2.fastq','w+') # process # iterate over file begin seqs=[] 1000.times do # read data from file name,fasta,qual,comments=@@fastq_file.next_seq if name.nil? break end seqs<<[name,fasta,qual,comments] end if !seqs.empty? # process it find_mid_with_blast(seqs) # # find a known MID position # pos=fasta.upcase.index(KNOWN_MID) # # if pos # # # keep fasta from pos to end # fasta.slice!(0,pos + KNOWN_MID.length) # # keep qual from pos to end # qual.slice!(0,pos + KNOWN_MID.length) # # end # # write data to disk seqs.each do |name,fasta,qual,comments| @@results.write_seq(name,fasta,qual,comments) end end end until seqs.empty? # close files @@fastq_file.close @@results.close
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
scbi_mapreduce-0.0.45 | skeleton/old/sequences_blast/linear_implementation.rb |