This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Using gtf file to get gene positions

Hi, I am wanting to extract gene positions from a gtf file using R. I have uploaded the gtf file as a df in R, with the headings 'seqnames', 'start', 'end', 'strand' and 'gene_id'. I am wanting to use this genome annotation to get the gene positions. Does anyone know a way I can do this on R.

My desired output would produce the different gene positions from the gtf file.

gtf sequencing r igv

1 answer

Hi

You should get subset of the data frame in another data frame, try like following for 3 column of it.

df2 <- unique( df[,c("start","end","gene_id")]) 

Log in to answer this question.