Hi, I’m currently predicting RNAseq tracks in mouse mm10 - I’ve centred my region on my gene of interest, and my plot shows transcription peaks at the expected locations looking at the scale markings at the bottom of the plot, but the gene locations from the gtf files are in the wrong coordinates. It looks like there is an error in how the gene transcripts have been plotted in the top line - has anyone else had a similar experience to this, or suggestions on how to fix it?
Hi There!
Thanks for reaching out.
May you please share a screenshot showing the apparent annotation misalignment, as well as the genome coordinates?
Kind regards,
Tumi
Hi! I’ve just encountered the same shifting issue. I am using this GTF annotation file: https://storage.googleapis.com/alphagenome/reference/gencode/mm10/gencode.vM23.annotation.gtf.gz.feather
However, it looks like the annotations may be based on GRCm39/mm39 rather than GRCm38/mm10, which could explain the coordinate shift.
Thanks T, I’m using the same GTF annotation file, and I also thought it could be the case that the annotations are based on mm39. Have you found any workaround?
Hi Seren,
The resulting file from this codeblock works for me:
import pandas as pd
# Download file from: https://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_mouse/release_M23/gencode.vM23.annotation.gtf.gz
gtf_mm10_df = pd.read_csv("gencode.vM23.annotation.gtf", sep='\t', skiprows=5, names=['Chromosome', 'Source', 'Feature', 'Start', 'End', 'Score', 'Strand',
'Frame', 'attr'] )
fields = [ 'gene_id', 'gene_type', 'gene_name', 'level', 'mgi_id', 'havana_gene', 'transcript_id', 'transcript_type', 'transcript_name', 'transcript_support_level', 'tag', 'havana_transcript', 'exon_number', 'exon_id', 'protein_id', 'ccdsid', 'ont', 'gene_id_nopatch']
tmp = ( gtf_mm10_df['attr'].str.findall(r'(\[^ ;\]+)\\s+"?(\[^"\]+?)"?(?=;|$)').map(dict) )
info_df = pd.DataFrame.from_records(tmp).reindex(columns=fields)
df = pd.concat([gtf_mm10_df.drop(columns=['attr']), info_df], axis=1)
df = df.fillna("None")
df.to_feather("gencode.vM23.annotation.gtf.gz.v2.feather")
I hope this helps you as well!
Best,
Tim
Thanks Tim! That worked for me when I changed your tmp line (removed the backslashes) to:
tmp = (
gtf_mm10_df['attr']
.str.findall(r'([^ ;]+)\s+"?([^"]+?)"?(?=;|$)')
.map(dict)
)
