pandaspgs.trait_category.TraitCategory

An object that stores data of type TraitCategory. To understand the significance of each column of the DataFrame. Please visit "TraitCategory" in PGS Catalog Documentation for details.

Attributes:
  • raw_data

    list. Convert from obtained JSON data

  • efotraits

    DataFrame. It only exists if the parameter mode of constructor is Fat.

  • trait_categories

    DataFrame. It only exists if the parameter mode of constructor is Fat.

from pandaspgs.get_trait import get_trait_categories

ch = get_trait_categories()
ch
ch.raw_data
ch.mode
ch.efotraits
ch.trait_categories

Subset object s by either identifier or position

all_df = get_trait_categories()
all_df[0].efotraits
all_df[0:3].efotraits
all_df['Biological process'].efotraits
all_df[('Biological process','Body measurement','Cancer')].efotraits

Objects can be manipulated like sets in the mathematical sense.

all_df = get_trait_categories()
one = all_df[0]
two = all_df[1]
three = all_df[2]
one_and_two = one+two
two_and_three = two+three
only_one = one_and_two - two_and_three
only_two = one_and_two & two_and_three
one_and_two_and_three = one_and_two | two_and_three
one_and_three = one_and_two ^ two_and_three

__init__

__init__(data: list = [], mode: str = 'Fat')
Parameters:
  • data (list, default: [] ) –

    Raw JSON data.

  • mode (str, default: 'Fat' ) –

    Fat or Thin. Specifies the mode of the object.