How to find unique and common genus by comparing 4 different files containing genus ?

How to find unique and common genus by comparing 4 different files containing genus ?

0

HI,
I have 4 files having genus names in them generated from soil meta sequencing of different agricultural fields like

F1 F2 F3 F4
A B A C
D C F D
F E G Y
H T Y T
Y H I X
Z J J J

So, like this i have 4 files with genus names

And i want to find common genus i.e present in all the 4 genus files.
As well as unique one i.e present in a single file not in all other 3 for all 4 files.

So, whats my logic is to make a master file from all the 4 files and then put a loop to grep a single genus at a time and check if its present in all 4 and if present then print it in new file.

Second for unique to use same logic that grep from F1 and check if the genus is present in other 3 files or not, if present in any one of the 3 files don’t print.If not present in other 3 files only then print it in new file.

I am not good in coding. So can anyone help me solving this issue?

Thanks in advance for your valuable time and suggestion.


genus


level


diversity


unique


common

• 42 views

Read more here: Source link