9.4 Exercise 4

We will start from gtf object that we already used.

Read it as follows, if it is no longer in your environment:

gtf <- read_csv("DataViz_source_files-main/files/gencode.v44.annotation.csv")
  1. Rename column chr to Chromosome. Assign to a new object.
correction
gtf2 <- rename(gtf, chromosome=chr)


2. Keep/filter rows matching “+” as strand, and “chr4” as chromosome chr4. Assign this filtered data to a new object.

correction
gtf3 <- filter(gtf2, strand=="+" & chromosome=="chr4")


  1. Select only columns gene_symbol and gene_type.
correction
gtf4 <- select(gtf3, gene_symbol, gene_type)