How programmatically filter text?
This post on stackoverflow describes how to do this programmatically. 

Just call check_markup and pass in your text and the filter id.

check_markup($text, $format_id = NULL, $langcode = '', $cache = FALSE)



  Run all the enabled filters on a piece of text.