Somalis are the same Berber people as those in Morocco:
https://en.wikipedia.org/wiki/Moroccan_genetics
"E1b1b1b1(E-M81), formerly E1b1b1b, E3b1b, and E3b2, is the most common Y chromosome haplogroup in Morocco, dominated by its sub-clade E-M183. It is thought to have originated in North Africa 5,600 years ago. His parent clade E1b1b (E-M215) are believed to have first appeared in Horn of Africa about 22,400 years ago.[41][42] This haplogroup reaches a mean frequency of 85% In North Africa, decreasing in frequency from approximately 80% or more in some Moroccan Berber populations, including Saharawis, to approximately 10% to the east of this range in Egypt.[42][46] Because of its prevalence among these groups and also others such as Mozabite, Riffians, Chleuhs, Middle Atlas, Kabyle and other Berber groups, it is sometimes referred to as a genetic Berber marker."
https://en.wikipedia.org/wiki/Names_of_ ... ber_people
"Because the Berbers were called Al-Barbar by the Arabs, the early modern Barbary seems to be a re-adoption of the name from Arabic.[citation needed] Muslim historiography has an eponymous Barbar as the ancestor of the Berbers, "the Berbers were the descendants of Barbar, the son of Tamalla, the son of Mazigh, the son of Canaan, the son of Ham, the son of Noah" (Ibn Khaldun, The History of Ibn Khaldun, Chapter 3).
Another people called Berbers by medieval Arab and ancient Greek geographers, respectively, were the ancestors of the Somalis. Barbara, an ancient region on the northern coast of Somalia was referred to as Bilad al-Barbar (Land of the Berbers).[3][4][5]"
From a genetic perspective, the Horn is part of North Africa.