annotate SeqSero/libs/splitPairedEndReads.pl @ 0:b0e627ec0dda draft

Uploaded
author estrain
date Wed, 06 Dec 2017 15:17:29 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
b0e627ec0dda Uploaded
estrain
parents:
diff changeset
1 use strict;
b0e627ec0dda Uploaded
estrain
parents:
diff changeset
2 use warnings;
b0e627ec0dda Uploaded
estrain
parents:
diff changeset
3 my $file = $ARGV[0];
b0e627ec0dda Uploaded
estrain
parents:
diff changeset
4 open(FILE, "<$file") || die "cannot open $file\n";
b0e627ec0dda Uploaded
estrain
parents:
diff changeset
5 open(OUT1, ">$file\_1") || die "cannot open $file\_1\n";
b0e627ec0dda Uploaded
estrain
parents:
diff changeset
6 open(OUT2, ">$file\_2") || die "cannot open $file\_2\n";
b0e627ec0dda Uploaded
estrain
parents:
diff changeset
7 while(<FILE>){
b0e627ec0dda Uploaded
estrain
parents:
diff changeset
8 chomp;
b0e627ec0dda Uploaded
estrain
parents:
diff changeset
9 print OUT1 "$_\/1\n";
b0e627ec0dda Uploaded
estrain
parents:
diff changeset
10 print OUT2 "$_\/2\n";
b0e627ec0dda Uploaded
estrain
parents:
diff changeset
11 my $newline = <FILE>; chomp($newline);
b0e627ec0dda Uploaded
estrain
parents:
diff changeset
12 print OUT1 substr($newline, 0, length($newline)/2)."\n";
b0e627ec0dda Uploaded
estrain
parents:
diff changeset
13 print OUT2 substr($newline, length($newline)/2, length($newline)/2)."\n";
b0e627ec0dda Uploaded
estrain
parents:
diff changeset
14 $newline = <FILE>; chomp($newline);
b0e627ec0dda Uploaded
estrain
parents:
diff changeset
15 print OUT1 "$newline\/1\n";
b0e627ec0dda Uploaded
estrain
parents:
diff changeset
16 print OUT2 "$newline\/2\n";
b0e627ec0dda Uploaded
estrain
parents:
diff changeset
17 $newline = <FILE>; chomp($newline);
b0e627ec0dda Uploaded
estrain
parents:
diff changeset
18 print OUT1 substr($newline, 0, length($newline)/2)."\n";
b0e627ec0dda Uploaded
estrain
parents:
diff changeset
19 print OUT2 substr($newline, length($newline)/2, length($newline)/2)."\n";
b0e627ec0dda Uploaded
estrain
parents:
diff changeset
20 }
b0e627ec0dda Uploaded
estrain
parents:
diff changeset
21 close(FILE);