fastq-factory 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
 - data/fastq-factory.gemspec +2 -2
 - data/lib/trim_and_correct.rb +5 -3
 - metadata +3 -3
 
    
        data/VERSION
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            0.1. 
     | 
| 
      
 1 
     | 
    
         
            +
            0.1.7
         
     | 
    
        data/fastq-factory.gemspec
    CHANGED
    
    | 
         @@ -5,11 +5,11 @@ 
     | 
|
| 
       5 
5 
     | 
    
         | 
| 
       6 
6 
     | 
    
         
             
            Gem::Specification.new do |s|
         
     | 
| 
       7 
7 
     | 
    
         
             
              s.name = "fastq-factory"
         
     | 
| 
       8 
     | 
    
         
            -
              s.version = "0.1. 
     | 
| 
      
 8 
     | 
    
         
            +
              s.version = "0.1.7"
         
     | 
| 
       9 
9 
     | 
    
         | 
| 
       10 
10 
     | 
    
         
             
              s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
         
     | 
| 
       11 
11 
     | 
    
         
             
              s.authors = ["Anthony Underwood"]
         
     | 
| 
       12 
     | 
    
         
            -
              s.date = "2012- 
     | 
| 
      
 12 
     | 
    
         
            +
              s.date = "2012-09-07"
         
     | 
| 
       13 
13 
     | 
    
         
             
              s.description = "This tool can process fastq files, using fastq_quality_trimmer and quake to correct fastq files and then provide a quality asssessment of the data"
         
     | 
| 
       14 
14 
     | 
    
         
             
              s.email = "anthony.underwood@hpa.org.uk"
         
     | 
| 
       15 
15 
     | 
    
         
             
              s.executables = ["fastq-factory"]
         
     | 
    
        data/lib/trim_and_correct.rb
    CHANGED
    
    | 
         @@ -2,6 +2,7 @@ def trim_and_correct_fastqs(sample_map, directory, forward_reads_suffix, forward 
     | 
|
| 
       2 
2 
     | 
    
         
             
              Dir.chdir(directory)
         
     | 
| 
       3 
3 
     | 
    
         
             
              # trimming
         
     | 
| 
       4 
4 
     | 
    
         
             
              sample_map.each do |sample_file_prefix, sample_name|
         
     | 
| 
      
 5 
     | 
    
         
            +
                next if File.exists?("paired_#{sample_file_prefix}#{forward_reads_suffix}.trimmed.#{forward_reads_file_extension}")
         
     | 
| 
       5 
6 
     | 
    
         
             
                puts "Trimming files for #{sample_name}"
         
     | 
| 
       6 
7 
     | 
    
         
             
                #determine read length
         
     | 
| 
       7 
8 
     | 
    
         
             
                read_length = calculate_read_length("#{directory}/#{sample_file_prefix}#{forward_reads_suffix}.#{forward_reads_file_extension}")
         
     | 
| 
         @@ -15,6 +16,7 @@ def trim_and_correct_fastqs(sample_map, directory, forward_reads_suffix, forward 
     | 
|
| 
       15 
16 
     | 
    
         
             
              #  quake correction
         
     | 
| 
       16 
17 
     | 
    
         
             
              # write file for quake
         
     | 
| 
       17 
18 
     | 
    
         
             
              sample_map.each do |sample_file_prefix, sample_name|
         
     | 
| 
      
 19 
     | 
    
         
            +
                next if File.exists?("#{sample_file_prefix}#{forward_reads_suffix}.trimmed.cor.#{forward_reads_file_extension}") || File.exists?(("paired_#{sample_file_prefix}#{reverse_reads_suffix}.trimmed.cor.#{forward_reads_file_extension}"))
         
     | 
| 
       18 
20 
     | 
    
         
             
                puts "Error correcting files for #{sample_name}"
         
     | 
| 
       19 
21 
     | 
    
         
             
                output_file = File.open("quake_file_list.txt","w")
         
     | 
| 
       20 
22 
     | 
    
         
             
                output_file.puts "paired_#{sample_file_prefix}#{forward_reads_suffix}.trimmed.#{forward_reads_file_extension} paired_#{sample_file_prefix}#{reverse_reads_suffix}.trimmed.#{reverse_reads_file_extension}"
         
     | 
| 
         @@ -23,9 +25,9 @@ def trim_and_correct_fastqs(sample_map, directory, forward_reads_suffix, forward 
     | 
|
| 
       23 
25 
     | 
    
         
             
                `#{quake_path} -f quake_file_list.txt -k 15 -q #{quality_scale}`
         
     | 
| 
       24 
26 
     | 
    
         
             
              end
         
     | 
| 
       25 
27 
     | 
    
         
             
              sample_map.each do |sample_file_prefix, sample_name|
         
     | 
| 
       26 
     | 
    
         
            -
                if File.exists?(" 
     | 
| 
       27 
     | 
    
         
            -
             
     | 
| 
       28 
     | 
    
         
            -
                 
     | 
| 
      
 28 
     | 
    
         
            +
                next if File.exists?("#{sample_file_prefix}#{forward_reads_suffix}.trimmed.cor.#{forward_reads_file_extension}")
         
     | 
| 
      
 29 
     | 
    
         
            +
                # remove orphans
         
     | 
| 
      
 30 
     | 
    
         
            +
                `perl /tmp/fastq-remove-orphans.pl -1 paired_#{sample_file_prefix}#{forward_reads_suffix}.trimmed.cor.#{forward_reads_file_extension} -2 paired_#{sample_file_prefix}#{reverse_reads_suffix}.trimmed.cor.#{reverse_reads_file_extension}`
         
     | 
| 
       29 
31 
     | 
    
         
             
              end
         
     | 
| 
       30 
32 
     | 
    
         | 
| 
       31 
33 
     | 
    
         
             
              # cleanup and rename files
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: fastq-factory
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.1.7
         
     | 
| 
       5 
5 
     | 
    
         
             
              prerelease: 
         
     | 
| 
       6 
6 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       7 
7 
     | 
    
         
             
            authors:
         
     | 
| 
         @@ -9,7 +9,7 @@ authors: 
     | 
|
| 
       9 
9 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       10 
10 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       11 
11 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       12 
     | 
    
         
            -
            date: 2012- 
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2012-09-07 00:00:00.000000000 Z
         
     | 
| 
       13 
13 
     | 
    
         
             
            dependencies:
         
     | 
| 
       14 
14 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       15 
15 
     | 
    
         
             
              name: trollop
         
     | 
| 
         @@ -165,7 +165,7 @@ required_ruby_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       165 
165 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       166 
166 
     | 
    
         
             
                  segments:
         
     | 
| 
       167 
167 
     | 
    
         
             
                  - 0
         
     | 
| 
       168 
     | 
    
         
            -
                  hash: - 
     | 
| 
      
 168 
     | 
    
         
            +
                  hash: -4361859413612648693
         
     | 
| 
       169 
169 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       170 
170 
     | 
    
         
             
              none: false
         
     | 
| 
       171 
171 
     | 
    
         
             
              requirements:
         
     |