Package: pyrarecomb
Pythonic version of RareCombRareComb is a tool to find oligogenic combinations of genes with rare variants that are enriched in individuals with a specific phenotype. RareComb was orginally developed in R (https://github.com/girirajanlab/RareComb). Here we provide a pythonic version of RareComb with some additional utilities.Installation$pipinstallpyrarecombUser interfaceThe pythonic version of RareComb currently has 3 user facing functions:compare_enrichment: Checks for oligogenic combinations of rare genetic variants that are enriched in cases but not in controls.compare_enrichment_depletion:  Checks for oligogenic combinations of rare genetic variants that are enriched in cases but depleted in controls.compare_enrichment_modifiers: Checks for oligogenic combinations of rare genetic variants that are enriched in cases but not in controls where one of the items in a combination must be within an user-defined set of genes.All these functions have the followingrequiredarguments:boolean_input_df: A dataframe where rows are the number of samples and columns include sample ids (represented by the column name: "Sample_Name") along with one hot encoded information about the sample genotype (presence or absence rare deleterious mutation within a gene; these columns should start with the prefix "Input_") and phenotype (presence or absence of a phenotype; this column should start with the prefix "Output_"). Example dataframe is as follows:Sample_NameInput_GeneAInput_GeneBInput_GeneC...Output_phenotypeSample_1111011...1Sample_2198010...0...Sample_N001...0combo_length: The number of items to mine within a combination.min_indv_threshold: The minimum number of individuals to consider that must possess a combination before checking for enrichment.max_freq_threshold: The maximum fraction of the cohort size that possess a combination (to filter out highly frequent combinations).Along with the other required arguments,compare_enrichment_modifiershas an additional required argument:primary_input_entities: List of genes that must be part of the enriched combinationsAll these functions have the followingoptionalarguments:input_format: The prefix of the input columns in the boolean matrix; default="Input_"output_format: The prefix of the output column in the boolean matrix; default="Output_"pval_filter_threshold: The p-value significance threshold that the combinations must satisfy; default=0.05adj_pval_type: The adjusted p-value method to run for multiple testing, one of bonferroni/BH; default="BH"min_power_threshold: The minimum power threhsold that the significant combinations must satisfy; default=0.7sample_names_ind: Add samples who possess each combo, one of "Y"/"N"; default="Y"method: The frequent itemset mining method, one of "fpgrowth"/"apriori"; default="fpgrowth"Usage examplesPlease refer to the notebooks dir in repo.CitationPounraja VK, Girirajan S. A general framework for identifying oligogenic combinations of rare variants in complex disorders. Genome Res. 2022 May;32(5):904-915. doi: 10.1101/gr.276348.121. Epub 2022 Mar 17. PMID: 35301265; PMCID: PMC9104696.Modifications in v0.1.0MajorOptions between apriori and fpgrowth algorithms for frequent itemsets miningRefining control frequency step correctly added before running multiple testingMinorAfter filter, raise ValueError check introduced if there is no data)Optional arguments bug fixedBetter logging using a log fileMethod verbose during tree generationPandas applymap changed to map due to deprecation warningGet counts helper function with pandas query fixed for hyphenated gene namesNo longer rounding off statistical values to 3 places of decimalPossible modifications for v0.2.0Refining control frequencies step may not be requiredCreate function for getting exp and obs prob for combosCreate function for calculating p valuesDiscuss the nominal significance filtration strategyCreate multiple testing functionRounding adjusted p-values to 3 digits not a good ideacompare enrichment modifiers why are we checking for primary entities only as consequents?Internal usePackage creation$python3-mpipinstall--upgradepip
$python3-mpipinstall--upgradebuild
$python3-mpipinstall--upgradetwine
$python-mbuild
$python3-mtwineupload--skip-existingdist/*