Port shutdown: These stocks likely to lose

West Coast ports are shutting for a long weekend as contract talks between shipping companies and dockworkers drag on, a suspension that will pile up ships off Los Angeles and Long Beach, California.

The current break in the action at the seaports, the largest in the country with $1 trillion in annual trade at stake, will give a peak at how a prolonged shutdown will affect retailers who could not have enough inventory to meet consumer demand during the key spring selling season.

Many of these stocks could be hurt, giving traders a chance for a short play in the coming weeks or long-term investors an opportunity to pick up consumer discretionary shares at a discount.

Even if a resolution is reached, the unofficial slowdown amid the tough negotiations is already hurting deliveries, analysts said.

CNBC.com used Kensho, a quantitative tool used by hedge funds to track the performance of retailers five trading days after seven such West Coast port disruptions since 2002. Here's the analysis:

The Money Play:

Gap was the worst performer, dropping an average 6.5 percent in the week following a shutdown, trading negatively on 86 percent of those occasions. Kohl's, Urban Outfitters, Best Buy, and Macy's were next, trading on average about 5 percent lower in those five days. Those stocks were lower on 71 percent of those occasions.

"The recent slowdown at the California ports (by some estimates port productivity has decreased by nearly 50 percent over the past several months) and the threat of a strike and West Coast port closures has created a situation similar to the one that was threatening to disrupt Holiday merchandise deliveries and as a result Holiday sales," a Stifel analyst report said Wednesday. "However, this time we believe that the situation is different. At select retailers, we believe a portion of the merchandise for the early spring and spring floorsets have been delayed as the current port slowdown is more pervasive and impactful than it was over the Holiday period."

Read MoreWest Coast ports shutting down... again

Gap and Urban Outfitters make Stifel's list of retailers that look vulnerable here as well. The firm also sees Abercrombie, Aeropostale, American Eagle, Chico's, Children's Place and Zumiez at risk.

Some retailers could actually benefit from a disruption as their peers are hit, according to Stifel.

The firm highlights TJX, Ross Stores and other "off-price" retailers as potential winners.

But big picture, the whole sector's monster gain remain at risk. The Consumer Discretionary SPDR is up 15 percent since October. On average, it lost at least a half a percent in five days after port disruptions, according to Kensho. But following similar events in 2011 and 2002, it lost more than 4 percent.

Disclosure: CNBC's parent NBCUniversal is a minority investor in Kensho.