Mercurial > repos > konradpaszkiewicz > preppereadsforveletfasta
comparison shuffleSequences_fasta.pl @ 0:4d237a31970b default tip
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
author | konradpaszkiewicz |
---|---|
date | Tue, 07 Jun 2011 17:42:21 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4d237a31970b |
---|---|
1 #!/usr/bin/perl | |
2 | |
3 if (!@ARGV) { | |
4 print "Usage: $0 forward_reads.fa reverse_reaads.fa outfile.fa\n"; | |
5 print "\tforward_reads.fa / reverse_reads.fa : paired reads to be merged\n"; | |
6 print "\toutfile.fa : outfile to be created\n"; | |
7 system.exit(0); | |
8 } | |
9 | |
10 $filenameA = $ARGV[0]; | |
11 $filenameB = $ARGV[1]; | |
12 $filenameOut = $ARGV[2]; | |
13 | |
14 die "Could not open $filenameA" unless (-e $filenameA); | |
15 die "Could not open $filenameB" unless (-e $filenameB); | |
16 | |
17 open FILEA, "< $filenameA"; | |
18 open FILEB, "< $filenameB"; | |
19 | |
20 open OUTFILE, "> $filenameOut"; | |
21 | |
22 my ($lineA, $lineB); | |
23 | |
24 $lineA = <FILEA>; | |
25 $lineB = <FILEB>; | |
26 | |
27 while(defined $lineA) { | |
28 print OUTFILE $lineA; | |
29 $lineA = <FILEA>; | |
30 while (defined $lineA && $lineA !~ m/>/) { | |
31 print OUTFILE $lineA; | |
32 $lineA = <FILEA>; | |
33 } | |
34 | |
35 print OUTFILE $lineB; | |
36 $lineB = <FILEB>; | |
37 while (defined $lineB && $lineB !~ m/>/) { | |
38 print OUTFILE $lineB; | |
39 $lineB = <FILEB>; | |
40 } | |
41 } |