I am not sure if it is good solution to replace such characters in the alignment with gap. What you do to deal with such undetermined amino acids/ nucleotides?
I don't think replacing undetermined characters with gap is a good option as it will change the total scoring for a particular sequence. If you using some software for multiple alignment and phylogenetics like MEGA then you don't have to do that. Manual alteration of a sequence in multiple alignment will create ambiguity in in result.
Don't replace N with gaps. Is a completely different information. A gap can be considered as an additional state by some software, being a evolutive novelty . Meanwhile N (undetermined) is an unknown state (e.g. A, C, T, G), but is not a gap.
However, the "N" can be sequencing ambiguities. There is not need to reject a sequence because it contains some "N". In all case, the "N" should not be replaced by gaps.
Wouldn't be problematic to model an "N" in the context of the phylogeny? Specially given the burden of selecting a particular evolutionary model. I used to avoid such ambiguities trimming the alignment (using Gblocks) or avoiding such "N" sites in the alignment.
Effectively, Gblocks, trimmal and BMGE can help to keep only the informative sites. In fact, if you have many sites, some "N" will no make a big difference. Almost all the time, the best fit model is GTR+Gamma. The gamma distribution shape is governed by the alpha parameter which is the rate variation among the sites. I think the "N" will be considered as neutral and consequently without effect.
Technically it is not correct to replace N by Gaps.
There are three important sites in MSA for phylogenetic analysis. ie Informative site,Invariable site and singleton sites.
for phylogenetic analysis we concentrate on informative site, which is the representation of substitutions. one parametric and two parametric substitution models mostly used in phylogenetic analysis which are depends upon A,T,G,C. no issue about presence of N in alignment.