MCP ExplorerExplorer

Mcps Snipflow

@rolvhdezon 20 days ago
1 MIT
FreeCommunity
AI Systems
Workflow to run snipar on the MCPS dataset.

Overview

What is Mcps Snipflow

mcps-snipflow is a workflow designed to run the SNIPAR protocol for family-based Genome-Wide Association Studies (GWAS) using the MCPS dataset. It implements imputations based on the methodologies outlined by Young et al. (2022) and Guan et al. (2025).

Use cases

Use cases for mcps-snipflow include conducting GWAS on various phenotypes, performing genetic association studies in family cohorts, and testing different imputation methods to enhance the accuracy of genetic analyses.

How to use

To use mcps-snipflow, define necessary variables in your console, create input files for FGWAS, and then run the FGWAS model of your choice. Ensure that all variables are set in the same terminal session and follow the provided commands for execution.

Key features

Key features of mcps-snipflow include the ability to perform FGWAS with imputations, support for multiple phenotype analyses, and optional inference of IBD segments and Mendelian imputation. It also allows for the setup of a customized environment for running analyses.

Where to use

mcps-snipflow is primarily used in the field of genetic research, specifically in the analysis of complex traits and diseases through family-based GWAS methodologies. It is suitable for researchers working with the MCPS dataset.

Content

Family-based GWAS workflow: SNIPAR

A protocol to run a FGWAS with imputations according to Young, et al. (2022); Guan, et al. (2025).

Run the workflow

  1. Define the next variables in your console:

    export out_dir="/path/to/your/output/"
    export bed="/path/to/your/bedfile"
    export baseline="/path/to/your/baseline.csv"
    export kinship="/path/to/your/kinship.seg"
    export pcs="/path/to/your/pcs.txt"
    export chr_range="1 5 8-10 22" # string autosomal chromosomes to run
    

    Important

    Once you have defined the variables in your terminal, do not switch terminal. All the variables are defined within your terminal. Alternatively, you could define them in a .bashrc when creating your environment.

  2. Create the input files for the FGWAS:

    python resources/build_inputs.py --baseline $baseline --kinship $kinship --pcs $pcs --outDir $out_dir
    
  3. (Optional, and not recommended) Run the IBD segments inference. Just run it if you are doing tests, you are using special data or forgot to log it. It will take a while, so why not go for a coffee…

    ./run_ibd.sh
    
  4. (Optional, and not recommended) Run the Mendelian Imputation. Same as above.

    ./run_imputation.sh
    
  5. Run the FGWAS model you want to use. Provide a number for the phenotype you want to run the FGWAS on. For example, a FGWAS with the robust estimator (Guan et al., 2025) on BMI (125) would be:

    ./fgwas/robust.sh 125
    

Set up the environment

Manually

Useful for creating DNAnexus snapshots.

  1. Install both versions of PLINK

    # PLINK 2.0
    wget https://s3.amazonaws.com/plink2-assets/alpha6/plink2_linux_avx2_20250420.zip && \
    unzip plink2_linux_avx2_20250420.zip -d plink2/ && \
    sudo mv plink2/plink* /usr/local/bin/ && \
    rm -rf plink2/ plink*.zip
    
    # PLINK 1.9
    wget https://s3.amazonaws.com/plink1-assets/plink_linux_x86_64_20241022.zip && \
    unzip plink_linux_x86_64_20241022.zip -d plink/
    sudo mv plink/plink /usr/local/bin/ && \
    rm -rf plink/ plink*.zip
    
  2. Install Conda

    # Download CONDA
    wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
    
    # Run the installation script, and follow the instructions
    sh Miniconda3-latest-Linux-x86_64.sh
    
    # Activate it, and unable automatic start
    source ~/.bashrc && conda config --set auto_activate_base false
    
  3. Install Rust

    # Download
    curl -sSf https://sh.rustup.rs | sh -s -- -y
    
    # Activate it
    . "$HOME/.cargo/env"
    
  4. Install snipar

    conda create -n snipar_v0.0.22 python=3.9
    
    conda activate snipar_v0.0.22
    
    pip install snipar==0.0.22
    

Docker

A Dockerfile for the rolvhdez/snipflow:v0.1 image is provided. To build locally:

docker build -t snipflow .

Or you could also download the latest version in development.

docker pull rolvhdez/snipflow:latest

Tools

No tools

Comments