in reply to Help with function, count matches and store in hash & retrieve sorted
to make my input files I used the following code:
sub get_index(){ my $file = shift; my $indexfile; open FILE,$file; while(<FILE>){ chomp; my @array = split /\,/,$_; if($#array){ $indexfile->{$array[1]} = $array[0]; } } close FILE; return $indexfile;
on a .txt file that looks like this :
1,TCGCCTTA
2,CTAGTACG
3,TTCTGCCT
4,GCTCAGGA
5,AGCGTAGC
6,CATGCCTA
7,GTAGAGAG
8,CCTCTCTG
9,TAGATCGC
10,CTCTCTAT
11,TATCCTCT
12,AGAGTAGA
13,GCGTAAGA
14,ACTGCATA
15,AAGGAGTA
16,CTAAGCCT
along with input files that are added as I iterate over a while loop. These files look like:
p1='CTAAGCCT'
I suppose its possible that p1 is occasionally an empty string, I am not sure how I would print my entire list of query strings.
please let me know if you need more information.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Help with function, count matches and store in hash & retrieve sorted
by Marshall (Canon) on Jul 03, 2017 at 01:49 UTC | |
|
Re^2: Help with function, count matches and store in hash & retrieve sorted
by huck (Prior) on Jul 03, 2017 at 02:03 UTC | |
|
Re^2: Help with function, count matches and store in hash & retrieve sorted
by AnomalousMonk (Archbishop) on Jul 03, 2017 at 12:51 UTC |