Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,11 @@ def annotate_all_transcript_consequences(
mane[x.transcript]['mane_id'],
MISSING_STRING,
),
gene_id=ensgs[mt.locus.contig].get(x.gene, x.gene),
gene_id=hl.if_else(
ensgs.contains(mt.locus.contig),
ensgs[mt.locus.contig].get(x.gene, x.gene),
x.gene,
),
),
mt.transcript_consequences,
),
Expand Down
2 changes: 1 addition & 1 deletion src/talos/annotation_scripts/create_roi_from_gff3.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def cli_main():
parser.add_argument(
'--merged_output',
help='Path to output file, regions merged',
required=False,
required=True,
)
parser.add_argument(
'--flanking',
Expand Down
11 changes: 11 additions & 0 deletions src/talos/cpg_internal_scripts/extract_fragmented_vcf_from_mt.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
},
}

CANONICAL_CONTIGS = {f'chr{x}' for x in list(range(1, 23))} | {'chrX', 'chrY'}


def filter_mt_to_sgids(
mt: hl.MatrixTable,
Expand Down Expand Up @@ -84,6 +86,12 @@ def filter_mt_to_sgids(
return mt.filter_rows(hl.agg.any(mt.GT.is_non_ref()))


def filter_mt_to_contigs(mt: hl.MatrixTable) -> hl.MatrixTable:
"""Strict filter to just the non-Mito contigs."""
contig_literal = hl.literal(CANONICAL_CONTIGS)
return mt.filter_rows(contig_literal.contains(mt.locus.contig))


def main(
mt_path: str,
sg_id_file: str,
Expand All @@ -109,6 +117,9 @@ def main(
# filter the MT to a specific set of SG IDs
mt = filter_mt_to_sgids(mt, sg_id_file)

# filter out chrM in this context
mt = filter_mt_to_contigs(mt)

# replace the existing INFO block to just have AC/AN/AF - no other carry-over. Allow for this to be missing.
if 'AF' not in mt.info:
mt = hl.variant_qc(mt)
Expand Down
Loading