Python APIs created for this project¶
OncoTree module¶
OncoTree class¶
-
class
OncoTree.OncoTree.OncoTree(file_path=False)¶ A OncoGxOne class to consume a tab delimited table of cancer type and construct tree structure class
Example: >>> from OncoTree import * >>> OT = OncoTree >>> print dir(OT) # Check all methods applicable to OncoTree class >>> ['OT', '__doc__', '__init__', '__module__', 'distance', 'homo', 'inclusion', 'url'] >>> print OT.url >>> 'https://raw.githubusercontent.com/cBioPortal/oncotree/master/tumor_tree.txt' # This is default cancer type input >>> print OT.abbrev['Leukemia'] # Check cancer type abbreviation. Note that the dictionary key has to be exact match. Since the cancer type terminology is mostly heterogeneous, please double check the cancer type metadata on url page specified by OT.url >>> 'LEUK' >>> print OT.OT >>> OT.OT # Return networkx clasee >>> networkx.classes.digraph.DiGraph object at 0x21f0450> >>> print OT.OT.successors('ALL') # Check the successors of queried cancer type >>> ['TALL', 'BALL'] >>> print OT.OT.predecessors('ALL') # Check the predecessors of queried cancer type >>> ['LEUK'] >>> print OT.inclusion('ALL') # Check if input cancer type exist in OncoTree >>> True >>> print OT.homo('BALL', 'NSCLC') # Check if two input cancer types are within same lineage >>> False >>> print OT.distance('BALL', 'NSCLC') # Calculate the distance between two inpit cancer types >>> 6
-
distance(cop, coc)¶ Function to calculate distance between two input cancer types
-
homo(cop, coc)¶ Function to check if two input cancer types in the same lineage
-
inclusion(cop)¶ Function to check if cancer type exist in oncotree
-