def remove(self, line_data, root_type=None):
roots = [ld for ld in self.ancestors(line_data) if (root_type and ld['<STR_LIT>'] == root_type) or (not root_type and not ld['<STR_LIT>'])] or [line_data]<EOL>for root in roots:<EOL><INDENT>root['<STR_LIT>'] = '<STR_LIT>'<EOL>root_descendants = self.descendants(root)<EOL>for root_descendant in root_descendants:<EOL><INDENT>root_descendant['<STR_LIT>'] = '<STR_LIT>'<EOL><DEDENT>root_ancestors = self.ancestors(root) <EOL>for root_ancestor in root_ancestors:<EOL><INDENT>if len([ld for ld in root_ancestor['<STR_LIT>'] if ld['<STR_LIT>'] != '<STR_LIT>']) == <NUM_LIT:0>: <EOL><INDENT>root_ancestor['<STR_LIT>'] = '<STR_LIT>'<EOL><DEDENT><DEDENT><DEDENT>
Marks line_data and all of its associated feature's 'line_status' as 'removed', does not actually remove the line_data from the data structure.
The write function checks the 'line_status' when writing the gff file.
Find the root parent of line_data of type root_type, remove all of its descendants.
If the root parent has a parent with no children after the remove, remove the root parent's parent recursively.

:param line_data:
:param root_type:
:return: