### Import Example Data Source: https://sigprofilersuite.github.io/SigProfilerExtractor/3.%20Using%20the%20Tool%20-%20Input.html Use the importdata function to load example data of a specified type. This is useful for running initial examples and verifying your setup. ```python data = sig.importdata(datatype) ``` -------------------------------- ### Clone and install from GitHub Source: https://sigprofilersuite.github.io/SigProfilerExtractor/1.%20Installation.html Use these commands to clone the repository and install the package from the source directory. ```bash $ git clone git@github.com:AlexandrovLab/SigProfilerExtractor.git ``` ```bash $ cd SigProfilerExtractor $ pip install . ``` -------------------------------- ### Download Example Data using wget Source: https://sigprofilersuite.github.io/SigProfilerExtractor/2.%20Quick%20Start%20Example.html Use this command to download the example dataset '21BRCA.zip' if you are using the command line on OS X or Unix systems. ```bash $ wget ftp://alexandrovlab-ftp.ucsd.edu/pub/tools/SigProfilerExtractor/Example_data/21BRCA.zip ``` -------------------------------- ### Install SigProfilerExtractor via pip Source: https://sigprofilersuite.github.io/SigProfilerExtractor/1.%20Installation.html Use this command to install the latest stable release of the package. ```bash $ pip install SigProfilerExtractor ``` -------------------------------- ### Start Python Interactive Shell and Import SigProfilerExtractor Source: https://sigprofilersuite.github.io/SigProfilerExtractor/2.%20Quick%20Start%20Example.html Begin by starting a Python 3 interactive shell and importing the SigProfilerExtractor library's sigpro module. ```python $ python3 >>> from SigProfilerExtractor import sigpro as sig ``` -------------------------------- ### importdata Function Source: https://sigprofilersuite.github.io/SigProfilerExtractor/3.%20Using%20the%20Tool%20-%20Input.html The importdata function allows users to import example data paths provided by the SigProfilerExtractor package to verify environment setup. ```APIDOC ## importdata ### Description Imports the path to example data provided by SigProfilerExtractor to ensure the environment is correctly configured. ### Parameters #### Arguments - **datatype** (String) - Required - The format of example data to be imported. ### Request Example ```python from SigProfilerExtractor import sigpro as sig data = sig.importdata('example_data_type') ``` ``` -------------------------------- ### Estimate Best Solution Source: https://sigprofilersuite.github.io/SigProfilerExtractor/3.%20Using%20the%20Tool%20-%20Input.html Run the estimation of the optimum solution (rank) among different numbers of solutions. Ensure the necessary input files and parameters are correctly configured. ```python ebs.estimate_solution() ``` -------------------------------- ### Run SigProfilerExtractor with Matrix Input Source: https://sigprofilersuite.github.io/SigProfilerExtractor/2.%20Quick%20Start%20Example.html Extract mutational signatures from a mutational matrix file. Update 'path/to/21BRCA.txt' with the correct file path. This function requires specifying the reference genome and allows CPU core allocation. ```python >>> sig.sigProfilerExtractor("matrix", "results", "path/to/21BRCA.txt", reference_genome="GRCh37", minimum_signatures=1, maximum_signatures=10, nmf_replicates=100, cpu=-1) ``` -------------------------------- ### Run SigProfilerExtractor with VCF Input Source: https://sigprofilersuite.github.io/SigProfilerExtractor/2.%20Quick%20Start%20Example.html Extract mutational signatures from VCF files. Ensure you update 'path/to/21BRCA_vcf' with the actual directory path. This function requires specifying the genome build. ```python >>> sig.sigProfilerExtractor("vcf", "results", "path/to/21BRCA_vcf", genome_build="GRCh37", minimum_signatures=1, maximum_signatures=10, nmf_replicates=100) ``` -------------------------------- ### Import SigProfilerExtractor Source: https://sigprofilersuite.github.io/SigProfilerExtractor/3.%20Using%20the%20Tool%20-%20Input.html Import the necessary module to use SigProfilerExtractor functions. This is typically done at the beginning of a Python script. ```python from SigProfilerExtractor import estimate_best_solution as ebs ``` -------------------------------- ### estimate_best_solution.estimate_solution Source: https://sigprofilersuite.github.io/SigProfilerExtractor/3.%20Using%20the%20Tool%20-%20Input.html Estimates the optimum solution (rank) among different number of solutions using statistical analysis of previous extraction results. ```APIDOC ## estimate_solution ### Description Estimates the optimum solution (rank) among different number of solutions. ### Parameters #### Query Parameters - **base_csvfile** (String) - Optional - Path to a csv file that contains the statistics of all solutions. Default is "All_solutions_stat.csv". - **All_solution** (String) - Optional - Path to a folder that contains the results of all solutions. Default is "All_Solutions". - **genomes** (String) - Optional - Path to a tab delimilted file that contains the mutation counts for all genomes. Default is "Samples.txt". - **output** (String) - Optional - Path to the output folder. Default is "results". - **title** (String) - Optional - Sets the title of the selection_plot.pdf. Default is "Selection_Plot". - **stability** (Float) - Optional - The cutoff thresh-hold of the average stability. Default is 0.8. - **min_stability** (Float) - Optional - The cutoff thresh-hold of the minimum stability. Default is 0.2. - **combined_stability** (Float) - Optional - The cutoff thresh-hold of the combined stability. Default is 1.0. - **exome** (Boolean) - Optional - Defines if exomes samples are used. Default is "False". ``` -------------------------------- ### Extract Mutational Signatures Source: https://sigprofilersuite.github.io/SigProfilerExtractor/3.%20Using%20the%20Tool%20-%20Input.html Call the main extraction function with the required input parameters. ```python sig.sigProfilerExtractor(input_type, output, input_data) ``` -------------------------------- ### Import SigProfilerExtractor Package Source: https://sigprofilersuite.github.io/SigProfilerExtractor/3.%20Using%20the%20Tool%20-%20Input.html Import the SigProfilerExtractor package within your Python script or an interactive Python 3 session to begin using its functions. ```python from SigProfilerExtractor import sigpro as sig ``` -------------------------------- ### sig.sigProfilerExtractor Source: https://sigprofilersuite.github.io/SigProfilerExtractor/3.%20Using%20the%20Tool%20-%20Input.html The primary function for extracting mutational signatures from input data. ```APIDOC ## sig.sigProfilerExtractor ### Description Extracts mutational signatures from an array of samples using NMF. ### Parameters #### Request Body - **input_type** (String) - Required - The type of input: "vcf" or "matrix". - **output** (String) - Required - The name of the output folder. - **input_data** (String) - Required - Name of the input folder (for vcf) or input file (for table). - **reference_genome** (String) - Optional - The name of the reference genome (default: "GRCh37"). - **opportunity_genome** (String) - Optional - The build or version of the reference signatures. - **context_type** (String) - Optional - Mutational contexts to consider (default: "96,DINUC,ID"). - **exome** (Boolean) - Optional - Defines if exomes will be extracted (default: False). - **minimum_signatures** (Positive Integer) - Optional - Minimum number of signatures (default: 1). - **maximum_signatures** (Positive Integer) - Optional - Maximum number of signatures (default: 25). - **nmf_replicates** (Positive Integer) - Optional - Number of iterations for NMF (default: 100). - **resample** (Boolean) - Optional - If True, add poisson noise by resampling (default: True). - **seeds** (String) - Optional - Path to seeds file or "random" (default: "random"). - **matrix_normalization** (String) - Optional - Normalization method (default: "gmm"). - **nmf_init** (String) - Optional - Initialization algorithm (default: "random"). - **precision** (String) - Optional - "single" or "double" (default: "single"). - **min_nmf_iterations** (Integer) - Optional - Min iterations for convergence (default: 10000). - **max_nmf_iterations** (Integer) - Optional - Max iterations for convergence (default: 1000000). - **nmf_test_conv** (Integer) - Optional - Iterations between convergence checks (default: 10000). - **nmf_tolerance** (Float) - Optional - Tolerance to achieve convergence (default: 1e-15). - **cpu** (Integer) - Optional - Number of processors (default: -1). - **gpu** (Boolean) - Optional - Use GPU if available (default: False). - **batch_size** (Integer) - Optional - NMF replicates per CPU during parallel processing (default: 1). ### Request Example ```python from SigProfilerExtractor import sigpro as sig sig.sigProfilerExtractor("vcf", "output_folder", "input_data_folder") ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.