[Bio] / Kmers2 / mk-dna-kmers.pl Repository:
ViewVC logotype

Annotation of /Kmers2/mk-dna-kmers.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (view) (download) (as text)

1 : olson 1.1 use strict;
2 :     use Proc::ParallelLoop;
3 :     use gjoseqlib;
4 :     #
5 :     # Make DNA kmers.
6 :     #
7 :     # Given N files, each of which contains a header line with the tag for the
8 :     # set, and the rest is a set of fasta files to be processed for that set.
9 :     #
10 :     # Writes out N files with the kmers found in heach.
11 :     #
12 :    
13 :     my $nprocs = 6;
14 :     my @files = @ARGV;
15 :    
16 :     for my $inp (@files)
17 :     {
18 :     open(I, "<", $inp) or die "Cannot open $inp: $!";
19 :    
20 :     my $tag = <I>;
21 :     chomp $tag;
22 :    
23 :     my @work = <I>;
24 :     chomp @work;
25 :    
26 :     @work = map { [$tag, $_] } @work;
27 :    
28 :     pareach \@work, sub {
29 :     my $ent = shift;
30 :     my($tag, $file) = @$ent;
31 :    
32 :     open(my $fh, "<", $file) or die "Cannot open $file; $!";
33 :    
34 :     while (my($id, $def, $seq) = read_next_fasta_seq($fh))
35 :     {
36 :     print "Got $id for $tag\n";
37 :     }
38 :    
39 :     close($fh);
40 :     }, { Max_Workers => $nprocs };
41 :    
42 :     }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3