A discrete unit of hereditary information consisting of a specific nucleotide sequence in DNA (or RNA, in some viruses).