Runtimewarning: invalid value encountered in cast

Hello Nextstrain Team,

I see the following warning message during processing of my local SARS-CoV-2 build:

/usr/local/lib/python3.10/site-packages/pandas/core/ RuntimeWarning: invalid value encountered in cast
  return np.asarray(self._values, dtype)

It appears right after the “Mask bases in alignment” steps. Although the build seems to complete without issue, wondering whether this is something that can/should be addressed?


This is a warning from pandas, it’s hard to say where exactly it happens and why. You should be fine but it’s good to double check that the results make sense (you seem to have done that).

Could you share the full command you ran where this happened and the version of augur you have installed?

Hi @corneliusroemer,

Thanks for the response. Running with nextstrain cli 7.0.1 via docker with augur 22.0.1. Here is the script w/ arguments ran just prior to seeing the message:

 python3 scripts/             --alignment results/hawaii_2023/aligned.fasta             --mask-from-beginning 100             --mask-from-end 200             --mask-sites 21987 21846             --mask-terminal-gaps             --output results/hawaii_2023/masked.fasta 2> logs/mask_hawaii_2023.txt

Thanks for the extra info! I haven’t seen that particular warning before. There’s a good chance that you can ignore the warning.

I’d compare the input and output of the masking script, by e.g. running both through Nextclade to see whether the masking works as expected. If it does, all is good.

Which workflow are you using? Is this vanilla ncov or have you made your own changes and are no longer on master of that repo? Since you’re invoking a script that’s not part of Augur, it could be anything.