Git Product home page Git Product logo

from_dels_to_retrogenes's Introduction

from_dels_to_retrogenes

Identify retrocopied genes from whole genome sequencing structural variant clean intron deletions

This small pipeline of scripts identifies retrocopied genes in whole genome sequencing data (WGS) from structural variant (SV) deletion variants (DEL or INDEL) that correspond to an entire intron, referred to here as clean intron deletions.

Prior to running this small pipeline, Gridss (Cameron et al. 2017, PMID: 29097403, software available at https://github.com/PapenfussLab/gridss) or equivalent software that generates VCF BND records for deletions and translocations needs to be run, to generate the SV BND records that will be used by this pipeline to identify retrocopied genes and their insertion points.

Usage

# Make sure the reference files provided with this pipeline are decompressed.
#
cd from_dels_to_retrogenes/reference_data
gunzip *.gz
cd ../code

# Identify retrocopied genes and their insertion points in every sample in the input directory by running the following scripts.
# If your data is hg19 and not hg38, then genome parameters should be hg19 instead of hg38.
# It is mandatory for each sample to have a gridss output vcf file or similar file with BND records representing deletions and translocation.
# These scripts assume that the gridss output files are bgzip compressed (.vcf.gz) and tabix indexed (.tbi) with file name <SAMPLE_ID>.*.vcg.gz.
# The BND records are used to identify the clean-intron-deletions of retrocopied genes and to identify insertion-points.
# It is optional to provide a bam file for each sample, which can be a representative bam file of the same sequencing depth and reference genome but doesn't have to be for the same sample.
# If provided, the bam file will be consulted to determine whether insertion points fall in a region having too much sequencing depth.
# These scripts assume that bam files as named as <SAMPLE_ID>.bam, and indexed .bai file.
# These scripts assume that the reference fasta file is bgzip compressed (.fasta.gz) and samtools faidx indexed (.fasta.gz.fai).
# These scripts assume that the same output directory is used for all scripts and thus, with the exception of the first script, that the input directory is the same as the output directory.

# Identify retrocopied genes and their insertion points in every sample in the input directory.
#
./run_1_call_dels_from_bnds_in_cohort.sh hg38 MY_COHORT_ID . /my/output/directory /my/temp/directory /my/directory/of/gridss/files
./run_2_look_for_clean_intron_deletions_in_cohort.sh hg38 MY_COHORT_ID . /my/output/directory /my/temp/directory
./run_2b_add_depth_adjust_vaf_in_clean_intron_dels_in_cohort.sh hg38 MY_COHORT_ID . /my/output/directory /my/temp/directory /my/directory/of/bam/files
./run_3_find_insertion_points_for_retrocopied_genes_in_cohort.sh hg38 MY_COHORT_ID . /my/output/directory /my/temp/directory /my/directory/of/gridss/files /my/PYTHON_PATH /my/directory/of/bam/files

# Concatenate the results from all samples.
#
./run_4_concat_insertion_points_for_all_samples.sh /my/output/directory

# Look for subsequent insertion points for the retrocopied genes that already have insertion points,
# because it is possible for a parental gene to be retrocopied more than once in the same sample.
#
./run_5_find_subsequent_insertion_points_in_cohort.sh hg38 MY_COHORT_ID . /my/output/directory /my/temp/directory /my/directory/of/gridss/files /my/PYTHON_PATH /my/directory/of/bam/files
./run_5b_concat_insertion_points_for_all_samples.sh /my/output/directory

# Use the previously identified insertion points to identify insertion points in retrocopied genes that do not yet have insertion points identified.
#
./run_6_find_insertion_points_using_other_samples_in_cohort.sh hg38 MY_COHORT_ID . /my/output/directory /my/temp/directory /my/directory/of/gridss/files /my/PYTHON_PATH /my/directory/of/bam/files /output/file/from/run_5b_concat_insertion_points_for_all_samples.sh/script

# Annotate insertion points with the reference sequence of the insertion point.
#
./run_7_get_insertion_point_sequence_from_reference_in_cohort.sh hg38 MY_COHORT_ID . /my/output/directory /my/temp/directory /my/reference/fasta/file /my/PYTHON_PATH

# Concatenate the retrogene results from the multiple samples merged output file, regardless of whether insertion_point was found or not.
# The files are:
# /my/output/directory/All__insertion_points_for_deletions_that_are_retrocopied_genes_inspt_refseq.sort_by_gene.txt
# /my/output/directory/All__insertion_points_for_deletions_that_are_retrocopied_genes_inspt_refseq.sort_by_sample.txt
./run_7b_concat_insertion_points_for_all_samples.sh /my/output/directory
#

Dependencies

bash
awk
python3
bedtools
bgzip (part of htslib)
tabix (part of htslib)

python3 dependencies, to be present in PYTHONPATH:
import argparse
import commands
import csv
import datetime
import math
import os
import pysam
import random
import re
import subprocess
import sys
import vcf # pip3 install --install-option="--prefix=/my/python_packages" pyvcf

Citation

Rath EM et al. 2021. "A survey of retrocopied genes in multiple cohorts." Manuscript in preparation.

from_dels_to_retrogenes's People

Contributors

emma-m-rath avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.