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

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