---
title: "RRBS Geoduck Prelim Analysis"
output: html_notebook
---

Going to run our new RRBS Geoduck data through a BSMap analysis run to get some data for next week. This may all be moot, as we've not gotten MD5 checksums from Genewiz yet, but I figured I would get started on stuff, on the assumption the data is good. 

```{r}
setwd("~/Documents/Geoduck/")
system("mkdir ~/Documents/Geoduck/untrimmed-Fast-QC")

system("fastqc *.gz -o ~/Documents/Geoduck/untrimmed-Fast-QC")

```

```{r}
system("mkdir ~/Documents/Geoduck/Trimmed-fq")

file.names <- list.files(path = ".", pattern = "*.gz")

for(i in 1:(length(file.names) - 1))   {
  
  system(paste("/home/shared/trimgalore/trim_galore --rrbs --paired --fastqc -o ~/Documents/Geoduck/Trimmed-fq", file.names[i], file.names[i + 1], "> trim_galore_output.txt"))
}

```

Cancelled the trimming to get just raw data processed quickly.

```{r}
setwd("~/Documents/Geoduck/")
system("mkdir ~/Documents/Geoduck/bsmap-output/")

file.names <- list.files(path = ".", pattern = "*.gz")

for(i in seq(from = 1, to = (length(file.names) - 1), by = 2))   {
  
  system(paste0("bsmap -p 16 -d ~/Documents/Geoduck/Panopea_generosa-Scaff-10k.fa -a ", file.names[i], " -b ", file.names[i + 1], " -o ~/Documents/Geoduck/bsmap-output/", substr(file.names[i], 1, 16), ".sam > bsmap_output_", substr(file.names[i], 1, 16), ".txt"))
  
}

```


Add a new chunk by clicking the *Insert Chunk* button on the toolbar or by pressing *Ctrl+Alt+I*.

When you save the notebook, an HTML file containing the code and output will be saved alongside it (click the *Preview* button or press *Ctrl+Shift+K* to preview the HTML file).
