Skip to content

Commit

Permalink
added old perl code
Browse files Browse the repository at this point in the history
  • Loading branch information
necrolyte2 committed Dec 10, 2015
1 parent 2123f50 commit c869372
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions fixFastq.pl
Original file line number Diff line number Diff line change
@@ -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 = <IN>) {
$b = <IN>;
$c = <IN>;
$d = <IN>;

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;
}

0 comments on commit c869372

Please sign in to comment.