eastgenomics / gene_annotation2bed

MIT License
1 stars 0 forks source link

gene_annotation2bed

Purpose

To provide bed files for custom gene-level annotation with VEP. This custom script processes a list of ids (HGNC, transcript) or coordinates with associated annotation, into a comprehensive bed file for the corresponding refseq transcripts for each ID entry.

i.e It could take a list of genes with associated annotation for example Gene A is an oncogene. It would then find all the corresponding transcripts for that gene and create a bed file for annotating VCFs using VEP. This removes the reliance on picking gene coordinates and directly annotates transcripts we use for our pipelines.

This Bed file can then be used to provide custom annotation with VEP, see VEP documentation for further details on using custom annotation (VEP Docs).

Note: The following steps must be completed before the BED can be used with VEP.

grep -v "#" myData.bed | sort -k1,1 -k2,2n -k3,3n -t$'\t' | bgzip -c > myData.bed.gz
tabix -p bed myData.bed.gz

When using VEP, the JSON should specify 'overlap' as in the VEP custom documentation when annotating gene/transcript level annotation. For more information on how to use custom annotation please see: Internal Document which is helpful.

Workflow diagram showing TSV containing IDs and annotation to bed file and how it is used in VEP and visualised in IGV: Workflow diagram showing TSV containing IDs and annotation to bed file and how it is used in VEP and visualised in IGV using a VCF


What are typical use cases for this script?


What data are required for this script to run?


Notes

The current working logic of this script is to select only refseq transcripts with NM_ prefix. The bed returned is zero-based.


Example Command

python gene_annotation2bed.py -ann annotation.tsv -o output_suffix -ref hg38 -f 5 --assembly_report assembly_report.txt -ref_igv ref_genome.fasta -gff your_file.gff -pickle pickle_file.pkl

What inputs are required for this app to run?

Required

Useful ones

Files

Misc


Requirements

To generate IGV reports: HTSlib is required for generating IGV report with the bed file to check the accuracy. This uses tabix and bgzip. Version: 1.19.1.

General requirements see requirements.txt for more info on versions.

Install using requirements.txt. pip install requirements.txt Alternatively you can use conda and the yml provided.


How does this app work?

Overview of workflow of app. Workflow diagram showing TSV containing IDs and annotation to bed file and how it is used in VEP and visualised in IGV using a VCF

IGV reports output

IGV report: image

The script produces a HTML report of all the bed file entries. Displayed in IGV with the refseq track and bed file aligned with the respecive annotation.