Hi Guys,
Does anyone know how to compare pairs of key/value in two hashtables ? I'm currently working with two tab files. Each one contains list of SNPs with their location and position as information. I need to compare both files and get the common location/position between two files. Input files looks like :
-File1:
LOCATION POSITION
LOC105032014 221
LOC105032014 222
LOC105032014 371
LOC105032014 434
LOC105032014 1271
-File2:
LOCATION POSITION
LOC105032014 193
LOC105032014 371
LOC105032014 1097
LOC105032014 1102
LOC105032014 1111
LOC105032014 1119
LOC105032014 1271
My output should give something like:
LOCATION POSITION
LOC105032014 1271
LOC105032014 371
Any help will be welcome. Thanks !
It seems your key is both, the location and the position. I would use a hash like
$hash{"$location:$position"} = 1
.Not so much an issue here, probably, but watch out for duplicate keys when you make a custom key like this.