Their avocado project began in 2012 with a $2.5 million grant from the Mexican agriculture ministry. Three years later, however, the government — which has grown increasingly resistant to genetic research and biotechnology over the years — declined to renew the funding, forcing the team to cobble together money from other sources. Mexico’s agriculture ministry did not respond to a request for comment.

“We could have finished three years ago if we had the money to pay the people to do the analysis,” Dr. Herrera-Estrella said.

The researchers also faced scientific hurdles. Unlike crops such as corn or maize, the avocado has a complex structure that makes it difficult to grow in a laboratory. To collect samples of the different varieties, Dr. Herrera-Estrella and his team had to travel to remote regions of Mexico, including areas where drug cartels control the local economy.

Analyzing the genetic material in those samples was like gluing together a document that had gone through a paper shredder, Dr. Herrera-Estrella said. Scientists extracted fragments of the genome from the various avocado samples — a string of code here, a few short sequences there — and then assembled those disparate pieces into a coherent whole.

“If you have a 2,000-page book and someone has ripped it into small pieces, it’s exactly the same as what we have to do,” Dr. Herrera-Estrella said. “You start to assemble a phrase, then you have to assemble a paragraph, then you assemble a page.”

After the project got underway, advances in biotechnology made genome sequencing significantly less labor intensive, allowing the team to broaden its initial ambitions and sequence a couple of additional avocado varieties. A group of researchers in Mexico is now mapping the genomes of about a hundred more.

With those genetic maps, scientists will be able to analyze the differences among various types of avocados and identify particular segments of DNA that promote disease resistance or other desirable characteristics.