Skip to content

Commit c0f1350

Browse files
committed
filter pseudoautosomal regions in promoter quantification #36
1 parent ab1373e commit c0f1350

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

workflow/scripts/get_promoter_regions.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ def get_promoter(feature, upstream, downstream, chrom_sizes):
5656
chrom, size = line.strip().split('\t')
5757
chrom_sizes[chrom] = int(size)
5858

59-
# filter for features that are genes and create promoters
60-
promoters = gtf.filter(lambda x: x[2] == 'gene').each(get_promoter, TSS_up, TSS_dn, chrom_sizes)
59+
# filter for features that are genes AND not Pseudoautosomal regions denoted by "PAR" and create promoters
60+
# https://www.ensembl.org/info/genome/genebuild/human_PARS.html
61+
promoters = gtf.filter(lambda x: (x[2] == 'gene') & ("PAR" not in x["gene_id"])).each(get_promoter, TSS_up, TSS_dn, chrom_sizes)
6162

6263
# filter for valid chromosomes
6364
promoters = promoters.filter(lambda x: x.chrom in chrom_sizes)

0 commit comments

Comments
 (0)