Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Mitchell R. Vollger committed Jul 1, 2024
1 parent d095e67 commit 5b52793
Show file tree
Hide file tree
Showing 20 changed files with 761 additions and 157 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
**.bam
**.csi
**.bai
**.tbl.gz
**.pdf
**.bed.gz

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
Binary file removed Figures/PS00272.pdf
Binary file not shown.
Binary file removed Figures/PS00272_all_swarm.pdf
Binary file not shown.
Binary file removed Figures/PS00272_pos.pdf
Binary file not shown.
Binary file removed Figures/PS00272_swarm.pdf
Binary file not shown.
Binary file modified Figures/UDN318336_volcano_hap1_vs_hap2.pdf
Binary file not shown.
Binary file modified Figures/UDN318336_volcano_hap1_vs_hap2.tbl.gz
Binary file not shown.
153 changes: 0 additions & 153 deletions Rscripts/PS00272.Rmd

This file was deleted.

1 change: 1 addition & 0 deletions Rscripts/UDN-translocation.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
SM="UDN318336"
make_hap_plots(SM, show_imprinted=TRUE)
```

```{r}
tdf = pdf %>%
filter(sample==SM) %>%
Expand Down
8 changes: 8 additions & 0 deletions isoseq-x-inactivation-affects/add_genes_to_old_data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
bedtools closest \
-a <(zcat ./transcripts.old.data.bed.gz | rg -v "^chrom" | bedtools sort ) \
-b ~/projects/fire-figures/data/gencode.v42.annotation_TSS.gff3.gz \
-f 0.1 \
| grep -vw "\-1" \
| sed 's/\tchr.*gene_name=/\t/g' | sed 's/;.*//g' \
| bgzip -@ 16 \
> ./transcripts.old.data.genes.bed.gz
11 changes: 11 additions & 0 deletions isoseq-x-inactivation-affects/cmds.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
bedtools makewindows -w 50000 -g ~/assemblies/hg38.analysisSet.fa.fai > windows.bed


bedtools intersect -sorted -c \
-a windows.bed \
-b H1.bam \
| bedtools intersect -sorted -c \
-a - \
-b H2.bam \
> windows.with.counts.bed

24 changes: 24 additions & 0 deletions isoseq-x-inactivation-affects/get-hap-counts-by-gene-from-bam.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import pysam
import tqdm


tags = ["HP", "gn", "in", "tn"]
print("chrom\tstart\tend\tsample\tHP\tGene\tisoform\ttranscript")

for sample, f in [
("GM12878", "./gm12878.haplotagged.bam"),
("UDN318336", "./mat.pat.old.data.tagged.bam"),
]:
bam = pysam.AlignmentFile(f, threads=16)

for r in tqdm.tqdm(bam.fetch(until_eof=True)):
if r.is_secondary or r.is_supplementary or r.is_unmapped:
continue
rtn = f"{r.reference_name}\t{r.reference_start}\t{r.reference_end}\t{sample}"
for tag in tags:
if r.has_tag(tag):
res = str(r.get_tag(tag))
else:
res = "NA"
rtn += f"\t{res}"
print(rtn)
9 changes: 9 additions & 0 deletions isoseq-x-inactivation-affects/haplotag.gm12878.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
whatshap haplotag \
--ignore-read-groups \
../../phased-bams/GM12878_WGS/GM12878_WGS.haplotagged.vcf.gz \
../../isoseq/GM12878.isoseq.bam \
-r ~/assemblies/hg38.analysisSet.fa \
| samtools view \
-b -@ 16 \
-o gm12878.haplotagged.bam --write-index

9 changes: 9 additions & 0 deletions isoseq-x-inactivation-affects/haplotag.old.UDN.data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
whatshap haplotag \
--ignore-read-groups \
../../phased-bams/UDN318336_WGS/UDN318336_WGS.haplotagged.vcf.gz \
./UDN318336.isoseq.bam \
-r ~/assemblies/hg38.analysisSet.fa \
| samtools view \
-b -@ 16 \
-o mat.pat.old.data.tagged.bam --write-index

2 changes: 1 addition & 1 deletion profiles/checkpoint/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cluster:
mkdir -p cluster_logs/{rule} &&
sbatch
--account=stergachislab
--partition=ckpt
--partition=compute
--nodes=1
--ntasks-per-node={threads}
--mem={resources.mem_mb}
Expand Down
Loading

0 comments on commit 5b52793

Please sign in to comment.