Skip to content

Commit

Permalink
Merge branch 'main' of github.com:tobiasrausch/vc
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasrausch committed Jun 26, 2024
2 parents 75ca1cd + 970b0e8 commit b6fcb1a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 22 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ all: ${TARGETS}
curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(shell uname)-$(shell uname -m).sh" && bash Mambaforge-$(shell uname)-$(shell uname -m).sh -b -p mamba && rm "Mambaforge-$(shell uname)-$(shell uname -m).sh" && touch .mamba

.tools: .mamba
export PATH=${PBASE}/mamba/bin:${PATH} && mamba install -y -c conda-forge -c bioconda datamash samtools bcftools bedtools htslib bwa delly alfred freebayes igv wally minimap2 && touch .tools
export PATH="${PBASE}/mamba/bin:${PATH}" && mamba install -y -c conda-forge -c bioconda datamash samtools bcftools bedtools htslib bwa delly alfred freebayes igv wally minimap2 && touch .tools

.rstats: .mamba .tools
export PATH=${PBASE}/mamba/bin:${PATH} && mamba install -y -c conda-forge -c bioconda bioconductor-genomicfeatures r-ggplot2 r-reshape2 r-gridextra r-cowplot bioconductor-dnacopy && touch .rstats
export PATH="${PBASE}/mamba/bin:${PATH}" && mamba install -y -c conda-forge -c bioconda bioconductor-genomicfeatures r-ggplot2 r-reshape2 r-gridextra r-cowplot bioconductor-dnacopy && touch .rstats

.pcks: .mamba .tools .rstats
export PATH=${PBASE}/mamba/bin:${PATH} && mamba install -y -c conda-forge -c bioconda cyvcf2 numpy pysam && pip install gdown && touch .pcks
export PATH="${PBASE}/mamba/bin:${PATH}" && mamba install -y -c conda-forge -c bioconda cyvcf2 numpy pysam && pip install gdown && touch .pcks

.check: .mamba .tools .rstats .pcks
export PATH=${PBASE}/mamba/bin:${PATH} && delly --version && touch .check
export PATH="${PBASE}/mamba/bin:${PATH}" && delly --version && touch .check

download: .mamba .tools .rstats .pcks
export PATH=${PBASE}/mamba/bin:${PATH} && cd data/ && gdown ${FILE} && tar -xzf sv.tar.gz && rm sv.tar.gz
export PATH="${PBASE}/mamba/bin:${PATH}" && cd data/ && gdown ${FILE} && tar -xzf sv.tar.gz && cp ${PBASE}/scripts/cnBafSV.R ${PBASE}/data/sv/ && rm sv.tar.gz

clean:
rm -rf $(TARGETS) $(TARGETS:=.o) mamba/
11 changes: 0 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,6 @@ Download the course data:

`make FILE=1nxzjQFt33ch1P_nWF66q1tkHv5gxTaKb download`

## Installation - Mac OS

Load the conda environment with all required tools

`conda env create -f environment.yml`

Download and unpack the course data

`cd data/ && gdown 1nxzjQFt33ch1P_nWF66q1tkHv5gxTaKb && tar -xzf sv.tar.gz && rm sv.tar.gz`


## Load the software stack

Load the mamba environment with all required tools
Expand Down
12 changes: 6 additions & 6 deletions scripts/cnBafSV.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ library(scales)
library(gtable)
library(grid)
library(DNAcopy)
library(gridExtra)
library(cowplot)

args = commandArgs(trailingOnly=TRUE)
x = read.table(args[1], header=T)
Expand All @@ -21,7 +23,8 @@ if (length(args) == 1) { quit(); }
# Read-depth + SVs
sv = read.table(args[2], header=F)
colnames(sv) = c("chr","start","end","type","id")
p2 = p + geom_curve(data=sv, aes(x=start, xend=end, col=type), y=8, yend=8, curvature=-0.5)
p2 = p
if (length(args) <= 2) { p2 = p + geom_curve(data=sv, aes(x=start, xend=end, col=type), y=8, yend=8, curvature=-0.5); }
p2 = p2 + labs(colour="SV type")
seg=segments.summary(segment(smooth.CNA(CNA(log(x[,6]), rep("chr2", nrow(x)), x$start, data.type="logratio", sampleid="tumor")), undo.splits="sdundo", undo.SD=2))
p3=p2 + geom_segment(data=seg, aes(x=loc.start, y=exp(seg.median), xend=loc.end, yend=exp(seg.median)), colour="darkorange")
Expand All @@ -39,9 +42,6 @@ q = q + scale_x_continuous(labels=comma)
q = q + ylim(0,1)
q = q + theme(axis.text.x = element_text(angle=45, hjust=1))
p3 = p3 + xlim(min(baf$pos), max(baf$pos))
g1 = ggplotGrob(p3)
g2 = ggplotGrob(q)
g = rbind(g1, g2, size="first")
g$widths = unit.pmax(g1$widths, g2$widths)
ggsave(g, file="cov.png", width=10, height=7)
plot_grid(q, p3, align="v", nrow=2, rel_heights=c(1/3, 2/3))
ggsave(file="cov.png", width=10, height=7)
print(warnings())

0 comments on commit b6fcb1a

Please sign in to comment.