-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mitchell R. Vollger
committed
Jul 1, 2024
1 parent
d095e67
commit 5b52793
Showing
20 changed files
with
761 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
**.bam | ||
**.csi | ||
**.bai | ||
**.tbl.gz | ||
**.bed.gz | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
24
isoseq-x-inactivation-affects/get-hap-counts-by-gene-from-bam.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.