Added function to calculate sequence depth

Added function to be used from kiaragen in order to calculate a sequence's
depth (number of levels os nested sequences).