--- title: "07-Peve 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 /home/shared/8TB_HDD_01/sr320/github/deep-dive/E-Peve/output/05-lncRNA-discovery/*lncRNA.* ``` ```{bash} env -i 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++;}' /home/shared/8TB_HDD_01/sr320/github/deep-dive/E-Peve/output/05-lncRNA-discovery/Peve_lncRNA.bed \ | awk 'BEGIN { FS="\t"; OFS="\t" } /^#/ { print; next } $4 <= $5 { print }' \ | sed 's/-1/1/g' \ | awk '$4 != "0" {print}' \ > ../output/07-Peve-lncRNA-matrix/Peve-lncRNAs.gtf ``` ```{bash} head -100 ../output/07-Peve-lncRNA-matrix/Peve-lncRNAs.gtf ``` ```{r, engine='bash'} /home/shared/subread-2.0.5-Linux-x86_64/bin/featureCounts \ -T 42 \ -a ../output/07-Peve-lncRNA-matrix/Peve-lncRNAs.gtf \ -o ../output/07-Peve-lncRNA-matrix/Peve-lncRNA-counts.txt \ -t lncRNA \ -g gene_id \ -p \ ../output/06-Peve-Hisat/*sorted.bam ```