The production of a W boson in association with a single charm quark is studied using 140 fb - 1 of s = 13 TeV proton-proton collision data collected with the ATLAS detector at the Large Hadron Collider. The charm quark is tagged by the presence of a charmed hadron reconstructed with a secondary-vertex fit. The W boson is reconstructed from the decay to either an electron or a muon and the missing transverse momentum present in the event. The charmed mesons reconstructed are D + → K - π + π + and D * + → D 0 π + → ( K - π + ) π + and the charge conjugate decays in the fiducial regions where p T ( e , μ ) > 30 GeV , | η ( e , μ ) | < 2.5 , p T ( D ( * ) ) > 8 GeV , and | η ( D ( * ) ) | < 2.2 . The integrated and normalized differential cross sections as a function of the pseudorapidity of the lepton from the W boson decay, and of the transverse momentum of the charmed hadron, are extracted from the data using a profile likelihood fit. The measured total fiducial cross sections are σ fid OS - SS ( W - + D + ) = 50.2 ± 0.2 ( stat ) - 2.3 + 2.4 ( syst ) pb , σ fid OS - SS ( W + + D - ) = 48.5 ± 0.2 ( stat ) - 2.2 + 2.3 ( syst ) pb , σ fid OS - SS ( W - + D * + ) = 51.1 ± 0.4 ( stat ) - 1.8 + 1.9 ( syst ) pb , and σ fid OS - SS ( W + + D * - ) = 50.0 ± 0.4 ( stat ) - 1.8 + 1.9 ( syst ) pb . Results are compared with the predictions of next-to-leading-order quantum chromodynamics calculations performed using state-of-the-art parton distribution functions. Additionally, the ratio of charm to anticharm production cross sections is studied to probe the s - s ¯ quark asymmetry. The ratio is found to be R c ± = 0.971 ± 0.006 ( stat ) ± 0.011 ( syst ) . The ratio and cross-section measurements are consistent with the predictions obtained with parton distribution function sets that have a symmetric s - s ¯ sea, indicating that any s - s ¯ asymmetry in the Bjorken- x region relevant for this measurement is small.