In the following interactive session, we assume the FASTA file data.fna1 to be located in the current directory.
>>> pattern2number('AGT') 11 >>> pattern2number('CTTCTCACGTACAACAAAATC') 2161555804173 >>> from Bio import SeqIO >>> pattern2number(*SeqIO.parse('data.fna', 'fasta')) 401677730568729587