What is a "mask swab"? e. collection of biological sample on absorbent material) then both "of" and "from" sound OK to me, and I don't detect any significant difference in meaning.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.