Skip to content

HSiga/haploplot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

haploplot

Plot haplotype-specific barcode coverage around structural variants (deletions or inversions) from linked-read BAM/CRAM data.

What it does

  • Computes unique barcode counts per window for HP1 and HP2.
  • Supports deletion spanning-barcode mode and inversion breakpoint-linking mode.
  • Accepts one or two samples for comparison.
  • Optionally draws a gene annotation track from GFF3 (.gff3, .gz, or .tar.gz).

Requirements

  • Python 3
  • pysam, numpy, pandas, matplotlib

Quick usage

python haploplot.py -p chr1:100000-200000 -s1 sample1.bam -r chr1:110000-190000 -t del

Two-sample inversion example:

python haploplot.py -p chr1:100000-200000 -s1 sample1.bam -s2 sample2.bam -r chr1:120000-180000 -t inv -f 500

For CRAM input, provide a reference:

python haploplot.py -p chr1:100000-200000 -s1 sample1.cram -r chr1:110000-190000 -t del -ref ref.fa

Key arguments

  • -p chr:start-end: plot region (required)
  • -s1, -s2: sample BAM/CRAM files (at least one required)
  • -r chr:start-end: SV region/breakpoints (optional; enables SV barcode selection)
  • -t del|inv: SV mode (del default)
  • -w: window size (default 2000)
  • -f: flank size for SV barcode detection (default 20000)
  • -n T|F: normalize per haplotype
  • -gff3: optional gene annotation file
  • -ref: optional reference FASTA for CRAM
  • -o: output image name (default barcode_hp1_hp2_plot.png)

About

Plot structural variant signals in separated haplotypes from linked-reads technologies

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages