DNA-testing company 23andMe has filed for bankruptcy in the U.S. and announced the resignation of its chief executive.