From c869372c6043ff60ab6fb99d2be6491c99c45438 Mon Sep 17 00:00:00 2001 From: Tyghe Vallard Date: Thu, 10 Dec 2015 14:24:25 -0500 Subject: [PATCH] added old perl code --- fixFastq.pl | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 fixFastq.pl diff --git a/fixFastq.pl b/fixFastq.pl new file mode 100755 index 0000000..13b620f --- /dev/null +++ b/fixFastq.pl @@ -0,0 +1,32 @@ +#!/usr/bin/perl -w + +use strict; + +my ($in, $out, $a, $b, $c, $d, $l, $r, $n); + +if (!-d "output") { + `mkdir output`; +} + +foreach $in (`ls *.fastq`) { + chomp $in; + $out = "output/new_" . $in; + open (OUT, ">$out") or die "cannot open $out: $!"; + + open (IN, "$in") or die "cannot open $in: $!"; + while ($a = ) { + $b = ; + $c = ; + $d = ; + + chomp $a; + ($l, $r) = split(/\s+/, $a); + $n = substr($r,0,1); + print OUT $l, '#0/', "$n \($a\)\n"; + + print OUT $b, $c, $d; + } + close IN; + close OUT; +} +