Expectations of continued success for American science were shaken this year when the Trump administration cut billions of dollars in funding and fired thousands of scientists.