rm(list = ls()) # clean-up workspace
library("tidyverse")
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.3     ✔ readr     2.1.4
## ✔ forcats   1.0.0     ✔ stringr   1.5.0
## ✔ ggplot2   3.4.3     ✔ tibble    3.2.1
## ✔ lubridate 1.9.2     ✔ tidyr     1.3.0
## ✔ purrr     1.0.2     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors

In this lab, we practice reading data from a PDF file and extract information from strings.

Here is a reference that you could follow.

The pdf file “gisaid_id_table.pdf” has information about COVID_19 sequences that contain certain mutations.

The task is to extract all of the Accesssion IDs from the pdf file.

In the end, output a text file as “EPI_ids.txt” that contains all the accession ids.

Good luck!

writeLines(readLines("EPI_ids.txt", 10))
## EPI_id
## EPI_ISL_417765
## EPI_ISL_418332
## EPI_ISL_420159
## EPI_ISL_421690
## EPI_ISL_424369
## EPI_ISL_424372
## EPI_ISL_426794
## EPI_ISL_432503
## EPI_ISL_432511