Let $X$ be a quasi-projective variety. Suppose that we (perhaps partially, if either enough is known) compactify to $\bar{X}$ with $\bar{X}\setminus X=D$ is a divisor. Say that we know the canonical bundle $K_X$. Then $K_{\bar{X}}=K_X+nD$ for some $n$.

- Is $n$ always negative? The examples I'm thinking of are for $X=\mathcal{M}_g,\mathcal{A}_g$
- Is there a good method for computing this $n$?

In both cases, I'm particularly interested in finite covers of $\mathcal{M}_g,\mathcal{A}_g$ and other moduli spaces, if that helps to know how the variety is given.

unknownpointed out below, there's no reason that $K_{\bar{X}} = K_X + nD$ where you use the same $n$. You certainly do have $K_{\bar{X}} = K_X + \sum n_i D_i$. And it's possible that some $n_i$ can be positive while others are negative. – Karl Schwede Dec 11 '10 at 21:03