I've had countless bouts of depression, and it was this that started me toward thinking of Asperger's being an issue.
It never made sense to me that I just had depression and anxiety, and when I found that both were common to those on the ASD spectrum, it got me to the point where I am now, seeking formal diagnosis.
Regardless of the cause or other factors, it's always a good idea to take depression seriously, and get along to a doctor or psychologist to help you deal with it.
Ignoring it won't make it go away, and you could lose more than just your job if you wait to see what happens.
You will need to find the technique that works for you in dealing with this, but you're not alone, and there is help available.