#!/bin/bash
primers_file=$1;
results=$2;

cat $primers_file | cut -f1 >primers_names;
echo "primer Gorilla_female human_Y chimp_Y" >$results;

while read primer
	do
	echo  -n $primer >>$results;
		for dataset in ${@:3}
		do
			search=$(cat $dataset| grep -B 1 "Amplimer 1" | grep "Primer" | grep $primer)
			if [ "$search" == "" ]
			then
				echo -n " NO" >>$results;
			else
				echo -n  " YES" >>$results;
			fi
		done
	echo >>$results;
done < primers_names