Coder Social home page Coder Social logo

dnm_distance's Introduction

DNM_distance

Requirements

py2bit needs to be installed for the python scripts to work. This can be done using pip:

pip install git+https://github.com/dpryan79/py2bit

For the R plotting script to work the tidyverse and Hmisc packages needs to be installed.

Input files

The de novo mutations should be in a txt file with the following columns: chrom, pos, ref, alt, sample_id. Where sample_id is an identifier of which proband the mutation occured in. The program also requires a bed-file listing which regions are sufficiently covered by the sequencing. Both files needs to be sorted first by chromosome (alphabetically) and then position (numerically).

If no bed-file is available a bed-file listing all chromosomes as covered can be created from a list of chromosome lengths like this:

cat chromSizes_hg38.txt | awk -v OFS="\t" '{print $1,"0",$2}' | sort -k1,1 -k2,2n > all_chromosomes_hg38.bed

The program also requires the a 2bit files with the reference sequence. Such a file can be downloaded from: https://hgdownload.cse.ucsc.edu/goldenpath/{genome}/bigZips/{genome}.2bit where {genome} is a valid UCSC genome assembly name (fx. "hg38").

Example

The DNM_distance script can be run on the example input data from the test_data directory like this:

python src/DNM_distance.py test_data/decode2019_mutations_chr21_chr22_hg38.gor hg38.2bit --bed test_data/all_chromosomes_chr21_chr22_hg38.bed -n100 > test_output_chr21_chr22_n100.txt

Make plot:

./R_scripts/plot_DNM_distances.R test_chr21_chr22_n100.txt test_chr21_chr22_n100_DNM_distances.pdf

To analyse all pairwise mutations:

python src/all_pair_distances.py test_data/decode2019_mutations_chr21_chr22_hg38.gor| gzip > all_pair.txt.gz

Make plot:

./R_scripts/plot_all_pair_results.R all_pair.txt.gz 2976 all_pair_results.pdf

The number is 2976 is the number of probands in the trio data and should be replaced with the right number when the script is run on another dataset.

dnm_distance's People

Contributors

besenbacher avatar

Watchers

James Cloos 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.