A computer implemented method for identifying a horizontally transferred gene, the method comprising: defining a cuboid in a three dimensional space, wherein the cuboid encompasses fragment points corresponding to genomic fragments from a plurality of sequenced microbial genomes, wherein the fragment points within the cuboid are obtained by transforming genomic fragments based on a set of reference points, wherein the set of reference points is obtained by computing pairwise dot products between unit cluster vectors determined from a plurality of reference genomes; dividing the cuboid into a plurality of grids, wherein dividing comprises dividing a dense grid in the plurality of grids into a plurality of smaller grids using a second set of reference points, wherein number of fragments points in the dense grid is more than a predefined percentage of total number of genomic fragments; selecting one or more grids corresponding to a selected genome from the plurality of grids; classifying each of the selected grids as one of majority, minority, and mixed grids, based on number of fragment points corresponding to the selected genome in each of the selected grids, wherein the classifying includes computing thresholds for classifying the one or more selected grids based on quartile values and a genome-specific value, wherein the genome-specific value for the selected genome is based on a number of grids occupied by the fragment points belonging to the selected genome and size of the selected genome; and identifying, from the minority and the mixed grids, at least one compositionally distinct genomic fragment corresponding to the horizontally transferred gene as a horizontally transferred gene fragment based on a distance ratio assessment, wherein the distance ratio assessment includes computing, for each neighboring grid, a ratio of distance of a fragment point from a centroid of a home grid to distance of the centroid of the home grid from a centroid of the neighboring grid. defining a cuboid in a three dimensional space, wherein the cuboid encompasses fragment points corresponding to genomic fragments from a plurality of sequenced microbial genomes, wherein the fragment points within the cuboid are obtained by transforming genomic fragments based on a set of reference points, wherein the set of reference points is obtained by computing pairwise dot products between unit cluster vectors determined from a plurality of reference genomes; dividing the cuboid into a plurality of grids, wherein dividing comprises dividing a dense grid in the plurality of grids into a plurality of smaller grids using a second set of reference points, wherein number of fragments points in the dense grid is more than a predefined percentage of total number of genomic fragments; selecting one or more grids corresponding to a selected genome from the plurality of grids; classifying each of the selected grids as one of majority, minority, and mixed grids, based on number of fragment points corresponding to the selected genome in each of the selected grids, wherein the classifying includes computing thresholds for classifying the one or more selected grids based on quartile values and a genome-specific value, wherein the genome-specific value for the selected genome is based on a number of grids occupied by the fragment points belonging to the selected genome and size of the selected genome; and identifying, from the minority and the mixed grids, at least one compositionally distinct genomic fragment corresponding to the horizontally transferred gene as a horizontally transferred gene fragment based on a distance ratio assessment, wherein the distance ratio assessment includes computing, for each neighboring grid, a ratio of distance of a fragment point from a centroid of a home grid to distance of the centroid of the home grid from a centroid of the neighboring grid.