Pennsylvania lost 2,900 pharmaceutical jobs — or nearly 20 percent — in recent years, as big drugmakers shed workers to cut costs, consolidate, or relocate to other states.

While jobs in big pharma declined — Merck, GlaxoSmithKline, and AstraZeneca have all laid off in the region — Pennsylvania life-sciences jobs overall were up slightly, 0.6 percent, in the last five years, according to a report released Tuesday by Life Sciences Pennsylvania, an industry trade group.

Across the country, pharmaceutical manufacturers shed less than 2 percent of their employment, "illustrating that Pennsylvania has become less attractive for pharmaceutical manufacturers compared with other regions of the country during the last five years," said the report prepared by tax and audit firm KPMG.

As big pharma companies contracted and shed workers, many scientists and former executives stayed in Pennsylvania to work in, or start, companies developing new medicines, doing contract research for pharma manufacturers, biotechnology research and development, and medical testing. The net effect has been a modest increase in jobs, as younger companies expanded into the life-sciences space.

Total life-sciences jobs in Pennsylvania grew from 111,430 in 2011 to 112,068 in 2016, the study said. The average annual salary in 2016 was $137,976, up 13.9 percent.

Today more than half the life-sciences companies in Pennsylvania have 10 employees or fewer. "So, the landscape looks very different," said Christopher Molineaux, president and CEO of the statewide group, formerly called Pennsylvania Bio.

"It has been an evolution, and, to some degree, a modernization of life sciences around here," said Roy Rosin, chief innovation officer at Penn Medicine. "Those pharma companies are still a pretty critical part of the ecosystem. They have a lot of talent so that even when they have layoffs, a lot of those people have really important skills to help build the next generation of life-sciences companies."

The KPMG report said that Pennsylvania has failed to attract and retain entrepreneurial venture capital compared to states like California and Massachusetts. The study noted "a dearth in Pennsylvania-based entrepreneurs with experience in life-sciences ventures" has limited expansion and growth. In 2016, the state secured $147 million in venture capital funding, ranking 13th nationally. California was No. 1 with $5.5 billion, followed by Massachusetts with $3 billion, and Maryland with $2.2 billion.

Pennsylvania received $27.9 million in funding from the National Science Foundation (NSF), although California ($92.6 million) and New York ($69.7 million) received considerably more. Pennsylvania receives significant National Institutes of Health (NIH) funding — $1.6 billion in 2016.

The KPMG study noted "the latest signs suggest the pace of commercialization activity is accelerating." The University of Pennsylvania Penn Center for Innovation has seen research and development expenditures from all corporate sponsorships double from 2013 to 2016, with much of the increase tied to life sciences.

Similarly, the University of Pittsburgh Innovation Institute has recorded a "sharp increase" in both the number of patents issued and start-up companies formed, both university-led and student-run, indicating research is increasingly translating into new ventures, the study said.

Barbara Schilberg, managing director and CEO of BioAdvance in Philadelphia, which since 2003 has invested in early-stage life-sciences companies, said Pennsylvania has "always had to import venture capital funding. We've always had to bring in venture capital."

But companies can do fine without raising venture capital, she said. "Because family offices [private wealth management advisory firms] have popped up, foundations are funding, the NIH is funding. There are a lot of sources of funding. Venture is just one part."

Schilberg said that former pharma employees who are now consultants and entrepreneurs have been "converted" to helpers for small companies.

Rosin, at Penn, who previously worked in the Silicon Valley and Boston, said he sees a "growing ecosystem" in Philadelphia. "Venture capitalists and investors go where the interesting and compelling companies are. There's been a lot more attention paid to some of the work coming out of Philadelphia now, particularly in immune therapy, some medical devices companies, and smaller drug-development and drug-testing companies. There's a lot of activity now.

"It poses an interesting question. If there is all this phenomenal activity and brilliant work going on, where's the venture money? It's here, but it's growing. I think we are still in the early phases of that development."