#!/usr/local/bin/perl -w # Print the marker names for a list of marker indexes. # # Copyright (C) 1995, 1996 Humberto Ortiz Zuazaga and Rosemarie Plaetke. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # See the file licence.html for a copy of the GNU GPL use strict; use English; my @names = readnames($ARGV[0]); my @map = readmap($ARGV[1]); my $i; for $i (@map) { print "$names[$i - 1]\n"; } ### sub readnames { my ($filename) = @ARG; my $markers; my @names; my $line; my $i; open(CHROM, $filename) or die "readchrom: can't open $filename"; $markers = ; chomp $markers; for $i (0 .. $markers - 1) { $names[$i] = ; chomp $names[$i]; } close CHROM; return @names; } ### sub readmap { my ($file) = @ARG; my $line; my @map; open(MAP, $file) or die "readmap: can't open $file"; while ($line = ) { push @map, split ' ',$line; } return @map; }