How to compute the exact weight of single-strand DNA using Python

You can compute the exact molecular weight of single-stranded or double-stranded DNA (ssDNA or dsDNA) using UliEngineering’s DNARNA module

How to install

Install UliEngineering using:

pip install -U UliEngineering

Example: Calculating ssDNA weight

Here’s how you can compute the exact weight of a single-stranded DNA sequence using DNARNA:

from UliEngineering.Chemistry.DNARNA import *

length = 100  # Number of nucleotides
weight = dnarna_molecular_weight(length, fractions=equal_dna_fractions)
print(f"Molecular weight of ssDNA ({length} nt, equal base composition): {weight:.2f} Da")

Example output

Molecular weight of ssDNA (100 nt, equal base composition): 30974.00 Da

Calculation Method

See Thermo Fisher’s guide for details on the calculation method.