Mercurial > repos > estrain > seqsero_v1
comparison SeqSero/libs/splitPairedEndReads.pl @ 0:c577b57b7c74 draft
Uploaded
author | estrain |
---|---|
date | Wed, 06 Dec 2017 15:59:29 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:c577b57b7c74 |
---|---|
1 use strict; | |
2 use warnings; | |
3 my $file = $ARGV[0]; | |
4 open(FILE, "<$file") || die "cannot open $file\n"; | |
5 open(OUT1, ">$file\_1") || die "cannot open $file\_1\n"; | |
6 open(OUT2, ">$file\_2") || die "cannot open $file\_2\n"; | |
7 while(<FILE>){ | |
8 chomp; | |
9 print OUT1 "$_\/1\n"; | |
10 print OUT2 "$_\/2\n"; | |
11 my $newline = <FILE>; chomp($newline); | |
12 print OUT1 substr($newline, 0, length($newline)/2)."\n"; | |
13 print OUT2 substr($newline, length($newline)/2, length($newline)/2)."\n"; | |
14 $newline = <FILE>; chomp($newline); | |
15 print OUT1 "$newline\/1\n"; | |
16 print OUT2 "$newline\/2\n"; | |
17 $newline = <FILE>; chomp($newline); | |
18 print OUT1 substr($newline, 0, length($newline)/2)."\n"; | |
19 print OUT2 substr($newline, length($newline)/2, length($newline)/2)."\n"; | |
20 } | |
21 close(FILE); |