Mercurial > repos > charles_s_test > seqsero2
diff libs/splitPairedEndReads.pl @ 0:6895de35a263 draft
planemo upload commit 844a891e4eaf732830043204ac636907eefb011d-dirty
author | charles_s_test |
---|---|
date | Thu, 19 Oct 2017 18:16:51 -0400 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libs/splitPairedEndReads.pl Thu Oct 19 18:16:51 2017 -0400 @@ -0,0 +1,21 @@ +use strict; +use warnings; +my $file = $ARGV[0]; +open(FILE, "<$file") || die "cannot open $file\n"; +open(OUT1, ">$file\_1") || die "cannot open $file\_1\n"; +open(OUT2, ">$file\_2") || die "cannot open $file\_2\n"; +while(<FILE>){ + chomp; + print OUT1 "$_\/1\n"; + print OUT2 "$_\/2\n"; + my $newline = <FILE>; chomp($newline); + print OUT1 substr($newline, 0, length($newline)/2)."\n"; + print OUT2 substr($newline, length($newline)/2, length($newline)/2)."\n"; + $newline = <FILE>; chomp($newline); + print OUT1 "$newline\/1\n"; + print OUT2 "$newline\/2\n"; + $newline = <FILE>; chomp($newline); + print OUT1 substr($newline, 0, length($newline)/2)."\n"; + print OUT2 substr($newline, length($newline)/2, length($newline)/2)."\n"; +} +close(FILE);