It is not a violation of the 5th amendment but could be a violation of the fourth amendment if there wasn't a warrant and the sample was forcibly taken. The fourth amendment protects against unreasonable searches and seizures:
"The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no Warrants shall issue, but upon probable cause, supported by Oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized."
The Supreme Court has held that invasions of the body are searches and, thus, are entitled to the protections of the Fourth Amendment. Skinner v. Ry. Labor Executives' Ass'n, 489 U.S. 602, 616-17 (1989) (breathalyzer and urine sample); Cupp v. Murphy, 412 U.S. 291, 295 (1973) (finger nail scrapings); Schmerber v. California, 384 U.S. 757, 767-71 (1966) (blood).
However, if the sample used was hair that simply fell off or was taken from a comb that the suspect discarded, the suspect no longer has any claim over it and the police can do with it as they want.