hapsburg.postprocessing ======================= .. py:module:: hapsburg.postprocessing .. autoapi-nested-parse:: Class for calling ROH from Posterior Data. Saves results as a .csv created by Pandas. Contains Sub-Classes, as well as factory Method. Pls always change parameters with set_params method! @ Author: Harald Ringbauer, 2019 Attributes ---------- .. autoapisummary:: hapsburg.postprocessing.folder Classes ------- .. autoapisummary:: hapsburg.postprocessing.PostProcessing hapsburg.postprocessing.PostProcessingX hapsburg.postprocessing.MMR_PostProcessing Functions --------- .. autoapisummary:: hapsburg.postprocessing.load_Postprocessing Module Contents --------------- .. py:class:: PostProcessing(folder='', load=False, output=True, save=True) Bases: :py:obj:`object` Class that does PostProcessing of HAPSBURG output. Has Methods to save the output as .. py:attribute:: folder :value: '' .. py:attribute:: roh_df :value: [] .. py:attribute:: cutoff_post :value: 0.999 .. py:attribute:: roh_min_l_initial :value: 0.02 .. py:attribute:: roh_min_l_final :value: 0.05 .. py:attribute:: min_len1 :value: 0.02 .. py:attribute:: min_len2 :value: 0.04 .. py:attribute:: max_gap :value: 0.005 .. py:attribute:: snps_extend :value: 0 .. py:attribute:: merge :value: True .. py:attribute:: output :value: True .. py:attribute:: save :value: True .. py:attribute:: post :value: True .. py:method:: set_params(**kwargs) Set the Parameters. Takes keyworded arguments .. py:method:: load_data(folder='') Load and return genetic Map [l], positions [l] and Posterior0 [l] .. py:method:: merge_called_blocks(df, max_gap=0) Merge Blocks in Dataframe df and return merged Dataframe .. py:method:: snp_extend(df, r_map, snps_extend=0) Extend Blocks in df by # n_snps. Return dataframe of same size but with modified blocks .. py:method:: modify_posterior0(posterior0) Load and return the posterior. .. py:method:: create_df(starts, ends, starts_map, ends_map, l, l_map, iid, ch, roh_min_l, starts_pos=[], ends_pos=[]) Create and returndthe hapROH dataframe. .. py:method:: call_roh(ch=0, iid='') Call ROH of Homozygosity from Posterior Data bigger than cutoff log: Whether Posterior is given in log space .. py:method:: clean_up(full=True) Removes all additional Data other than the ROH Calls and the ROH Ground Truth (To save space) .. py:class:: PostProcessingX(folder='', load=False, output=True, save=True) Bases: :py:obj:`PostProcessing` Class to post-process IBD on the X of two males. Only difference: Two iids, which will get stored seperately. .. py:method:: create_df(starts, ends, starts_map, ends_map, l, l_map, iid, ch, roh_min_l, starts_pos=[], ends_pos=[]) Create and returndthe hapROH dataframe. Difference: Here it is a IBD, so two iids are saved. .. py:class:: MMR_PostProcessing(folder='', load=False, output=True, save=True) Bases: :py:obj:`PostProcessing` Class that does PostProcessing of HAPSBURG output. Same as PostProcessing but load Posterior differently .. py:method:: modify_posterior0(posterior0) Load and return the posterior. Don't do anything .. py:function:: load_Postprocessing(folder='', method='Standard', output=True, save=True) Factory Method for PostProcessing class .. py:data:: folder :value: './Simulated/1000G_Mosaic/TSI/ch3_10cm/output/iid0/chr3/'