Giter Site home page Giter Site logo

ahmedarslan / doppelganger Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 69 KB

Target site duplication assessment from alignment file and genomic location of insertion sites.

Home Page: https://github.com/AhmedArslan/doppelganger

License: MIT License

Python 83.62% Roff 16.38%
line1 long-reads genome human mouse nanopore pacbio whole-genome-sequencing

doppelganger's Introduction

doppelganger

Target site duplication assessment from alignment file and genomic location of somatic insertion sites.

Instructions to generate input files:

  • There are two ways to generate input files.

    1 - follow individual steps - OR

    2 - run the preprocessor.sh to automate files generation (Recommended)

  • Three files are needed:

    1 - bam file (sorted)

    2 - bed file (containing insertion locations)

    3 - fasta file (containing insertion sequences)

1 - follow individual steps

Alignment:
Command: minimap2 -ax map-hifi -MD GRCh38_genomic.fa raw.fastq.gz > HiFiCCS.sam -t 10

  A - change map-hifi to map-ont, if using nanopore reads.
  B - change -t to increase or decrease number of threads. 
  C - change reference genome (GRCh38_genomic.fa) to your requirement.

Convert sam to bam file format:
Command: samtools view -Sb HiFiCCS.sam -@ 10 > HiFiCCS.bam 
  A - change -@ to increase or decrease number of threads.

Sort bam file:
Command: samtools sort -o HiFiCCS.sorted.bam -O bam -@ 10 HiFiCCS.bam 
Index sorted bam file:
Command: samtools index HiFiCCS.sorted.bam
  • Step - 2 - Generating bed and fasta from bed file: Softwares needed: Sniffles, bcftools
Step - Insertion variant calling:
Command: sniffles --input HiFiCCS.sorted.bam --vcf HiFiCCS.sorted.vcf --threads 10 --reference GRCh38_genomic.fa --non-germline --minsupport 1

  A - change reference genome (GRCh38_genomic.fa) to your requirement.
  B - change to germline variant prediction by removing option --non-germline
  C - increase number of reads required to predict an insertion by changing option --minsupport [int]
  
Step - vcf to bed/fasta:
Command: bcftools view -i 'GT="alt"' -f PASS -c 1 HiFiCCS.sorted.vcf -o HiFiCCS.filter.vcf
Command: bcftools query -f '%CHROM\t%POS\t%INFO/END\t%INFO/SVTYPE\t%INFO/SVLEN\t%REF\t%ALT\t%STRAND\n' HiFiCCS.filter.vcf > HiFiCCS.filter.bed
Command: grep 'INS' HiFiCCS.filter.bed > HiFiCCS.filter.INS.bed
Command: awk '{print ">"$1":"$2"-"$3"_"$5"\n"$7}' HiFiCCS.filter.INS.bed > HiFiCCS.fa
Command: awk '{print ">"$1":"$2"-"$3"_"$4"_"$5}' HiFiCCS.filter.INS.bed | awk -F'[->_:]' '{print $2"\t"$3"\t"$3+$6}' | sort -k 1,1 -k2,2n > HiFiCCS.bed

    * HiFiCCS.fa, HiFiCCS.bed and HiFiCCS.sorted.bam are the input files for doppelganger. 

Remove extra/tmp files: rm HiFiCCS.sam HiFiCCS.bam HiFiCCS.sorted.vcf HiFiCCS.filter.bed HiFiCCS.filter.INS.bed HiFiCCS.filter.vcf

2 - run the preprocessor.sh to automate files generation

  • conda env create --file doppelganger.yaml

  • preprocessor.sh [fastq] [barcode.fa] [threads] [out_name] [reference]

    fastq = raw long-reads file [fastq/fq] ; barcode.fa = pacbio barcode [fa]; out_name = name of output file; reference = refernece genome [fa]

run doppelganger

  • conda env create --file doppelganger.yaml [run first time only]
  • activate doppelganger
  • python3 doppelganger.py --bam [bam file] --bed [bed file] --out [output name] --region [region around insertion] --org [human or mouse] --fasta [insertion sequences.fa] --threads [number of threads]

doppelganger's People

Contributors

ahmedarslan avatar

Watchers

 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.