ParserFilter

class pyham.ham.ParserFilter[source]

Object containing a list of queries (hogs/genes ids) that will be used by the FilterOrthoXMLParser to collect in the orthoxml file the required information for the OrthoXMLParser to only parse data related to this sub-dataset of interest.

The ParserFilter first collect top level HOG ids, unique or external genes ids that are related to the hogs of interest (FilterOrthoXMLParser queries) then run the FilterOrthoXMLParser to built the list of all genes and hogs (OrthoXMLParser queries) required to be able to work on this subset.

Attributes:
HOGId_filter (set): set of HOG ids used by the FilterOrthoXMLParser.
GeneExtId_filter (set): set of external genes ids used by the FilterOrthoXMLParser.
GeneIntId_filter (set): set of unique genes ids used by the FilterOrthoXMLParser.
geneUniqueId (set): set of all required unique gene ids build by the FilterOrthoXMLParser.
hogsId (set): set of all required top level hog ids build by the FilterOrthoXMLParser.
add_hogs_via_GeneExtId(list_id)[source]
Parameters:

list_id

add_hogs_via_GeneIntId(list_id)[source]
Parameters:

list_id

add_hogs_via_hogId(list_id)[source]
Parameters:

list_id

buildFilter(file_object, type_hog_file='orthoxml')[source]

This function will use the FilterOrthoXMLParser with the *_filter queries to build geneUniqueId and hogsId.

Args:
hog_file (str): Path to the file that contained the HOGs information.
type_hog_file (str): File type of the hog_file. Can be “orthoxml or “hdf5”. Defaults to “orthoxml”.