---
title: "19-Apul lncRNA"
author: Steven Roberts
date: "`r format(Sys.time(), '%d %B, %Y')`"  
output: 
  html_document:
    theme: readable
    highlight: zenburn
    toc: true
    toc_float: true
    number_sections: true
    code_folding: show
    code_download: true
---

```{r setup, include=FALSE}
library(knitr)
library(tidyverse)
knitr::opts_chunk$set(
  echo = TRUE,         # Display code chunks
  eval = FALSE,         # Evaluate code chunks
  warning = FALSE,     # Hide warnings
  message = FALSE,     # Hide messages
  fig.width = 6,       # Set plot width in inches
  fig.height = 4,      # Set plot height in inches
  fig.align = "center" # Align plots to the center
)
```

We have a bed file.

```{bash}
head ../output/10.1-Apul-lncRNA/*lncRNA.*
```



```{bash}
awk 'BEGIN{OFS="\t"; count=1} {printf "%s\t.\tlncRNA\t%d\t%d\t.\t+\t.\tgene_id \"lncRNA_%03d\";\n", $1, $2, $3, count++;}' ../output/10.1-Apul-lncRNA/Apul_lncRNA.bed \
| sed 's/-1/1/g' \
> ../output/19-Apul-lncRNA-matrix/Apul-lncRNAs.gtf
```


```{bash}
head ../output/19-Apul-lncRNA-matrix/Apul-lncRNAs.gtf
```


```{r, engine='bash'}
/home/shared/subread-2.0.5-Linux-x86_64/bin/featureCounts \
-T 42 \
-a ../output/19-Apul-lncRNA-matrix/Apul-lncRNAs.gtf \
-o ../output/19-Apul-lncRNA-matrix/Apul-lncRNA-counts.txt \
-t lncRNA \
-g gene_id \
-p \
../output/07-Apul-Hisat/*sorted.bam
```

