I have a big file with ~ 1000 columns. The first 2 columns are chromosome and SNP (single nucleotide polymorphism)position, the rest are samples. Here is the first few line and rows:
#CHROM POS P0431 P432 P433 P434 P435 Chr01 180349 G G G N G Chr01 180372 N N N N A Chr01 180389 A N A N N
There are samples from 3 different groups in this data-set and I want to separate and store in a separate file.
here is a file that I have ample IDs for group1.
$ head group1 P0431 P434 P435
So, I want to find these samples in my main data and store them as group1.data.
$ head group1.data #CHROM POS P0431 P434 P435 Chr01 180349 G N G Chr01 180372 N N A Chr01 180389 A N N