trviz.main

Module Contents

Classes

TandemRepeatVizWorker

class trviz.main.TandemRepeatVizWorker
generate_trplot(tr_id: str, sample_ids: List[str], tr_sequences: List[str], motifs: List[str], skip_alignment: bool = False, rearrangement_method: str = 'clustering', sample_order_file: str = None, output_dir: str = './', figure_size: Tuple[int, int] = None, output_name: str = None, dpi: int = 300, hide_xticks: bool = False, hide_yticks: bool = False, hide_dendrogram: bool = True, population_data: str = None, allele_as_row: bool = True, xlabel_size: int = 8, ylabel_size: int = 8, xlabel_rotation: int = 0, ylabel_rotation: int = 0, private_motif_color: str = 'black', frame_on: Dict[str, bool] = None, verbose: bool = True)

A method to generate a plot of tandem repeat motif composition. This executes the following modules sequentially and finally output the plot. 1. Decomposition 2. Encoding 3. Alignment 4. Rearrangement (if specified) 5. Visualization For detail, please check out each module

Parameters
  • tr_id – a ID for the tandem repeat

  • sample_ids – a list of sample IDs corresponding to the tandem repeat sequences

  • tr_sequences – a list of tandem repeat sequences

  • motifs – a list of motifs to be used for decomposition

  • skip_alignment – if true, skip the multiple sequence alignment

  • rearrangement_method – options: {‘clustering’ (default), ‘name’, ‘motif_count’, ‘simulated_annealing’, ‘manually’}

  • sample_order_file – a file containing sample order

  • output_dir – base directory for output files

  • figure_size – figure size

  • output_name – output file name

  • dpi – DPI for the plot

  • hide_xticks – if true, hide xticks

  • hide_yticks – if true, hide yticks

  • hide_dendrogram – if true, hide the dendrogram

  • population_data – population data file name

  • allele_as_row – if true, plot allele as row (default is true)

  • xlabel_size – x label size (default is 8)

  • ylabel_size – y label size (default is 8)

  • xlabel_rotation – x label rotation (default is 0)

  • ylabel_rotation – y label rotation (default is 0)

  • private_motif_color – the color for private motifs. Default is black

  • frame_on – a dictionary mapping sample to frame on. Default is {‘top’: False, ‘bottom’: True, ‘right’: False, ‘left’: True}

  • verbose – if true, output detailed information