in reply to Re^2: Deconvolutinng FastQ files
in thread Deconvolutinng FastQ files
Line 120 of your data file contains a record where the key field (characters 4 through 7) are not one of "TTGT" "GGTT" "ACCT"
To handle that, try this modified version:
#! perl -sw use strict; my %outFHs = map { open my $fh, '>', "$_.fastQ" or die $!; $_ => $fh; } qw[ TTGT GGTT ACCT other ]; until( eof() ) { my @lines = map scalar <>, 1 .. 4; my $barcode = substr $lines[1], 0, 9; my $tag = substr $barcode, 3, 4; print { $outFHs{ $tag } // $outFGs{ other } } @lines; } __END__ usage: thisScript theBigfile.fastQ ## outputs to TTGT.fastQ GGTT.fastQ ACCT.fastQ ## Unrecognised records are put into "other.fastQ"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Deconvolutinng FastQ files
by snakebites (Initiate) on Aug 07, 2012 at 14:49 UTC | |
by BrowserUk (Patriarch) on Aug 07, 2012 at 15:01 UTC | |
|
Re^4: Deconvolutinng FastQ files
by snakebites (Initiate) on Aug 08, 2012 at 02:45 UTC |