<commit_before>---
title: "miRNA annotation"
author: "<NAME>"
date: "10/02/2015"
output:
  knitrBootstrap::bootstrap_document:
    theme: readable
    highlight: zenburn
    theme.chooser: TRUE
    highlight.chooser: TRUE
  html_document:
    highlight: zenburn

---

```{r setup-mir}
library(knitr)
library(rmarkdown)
library(knitrBootstrap)
options(bitmapType = "cairo")
opts_chunk$set(tidy=TRUE, highlight=T, figalign="center",
               fig.height=6, fig.width=10, message=F, error=F, warning=F, bootstrap.show.code=FALSE)
```

# Method

 * scoring: in case the tool gives a score, the best score will be used. If not the first hit is the one used. If score is the same, the first hit is used. Tools that can be scored are: bowtie, bowtie2, chimira_blast, GEM, microzer, miraligner, miraligner-python, novoaling, razer3, STAR
 * only miraligner* and srnabench gives miRNA annotation, so these tools should have an advantage since they are parsing the hits to get the best annotation Anyway, I am trying to get the best of all of them when comparing which annotates better using precursor names.
 
```{r load-mir}
data<-read.table("stats",skip=1)
data$V2<-as.character(data$V2)
data$V4<-as.character(data$V4)
data$V5<-data$V5/abs(data$V5)
data$V5[data$V5==1]<-"Na"
data$V5[data$V5==-1]<-"Add"
data$V6<-data$V6/abs(data$V6)
data$V6[data$V6==1]<-"Na"
data$V6[data$V6==-1]<-"Mut"
data$changes<-paste(data$V5,data$V6)
data$TP<-apply(data[,c(2,4)],1,function(x){
  v<-grep(x[1],x[2],ignore.case=T)
  if (length(v)==0){v<-0}
  return (v)
})
data$TPmirna<-apply(data[,c(2,4)],1,function(x){
  h1 = unlist(strsplit(x[1], split = "-"))[1:3]
  h2 = unlist(strsplit(x[2], split = "-"))[1:3]
  v<-grep(paste0(h1, collapse = "-"),paste0(h2, collapse = "-"),ignore.case=T)
  if (length(v)==0){v<-0}<commit_msg>Update stats.rmd<commit_after>---
title: "miRNA annotation"
author: "<NAME>"
date: "10/02/2015"
output:
  knitrBootstrap::bootstrap_document:
    theme: readable
    highlight: zenburn
    theme.chooser: TRUE
    highlight.chooser: TRUE
  html_document:
    highlight: zenburn

---

```{r setup-mir}
library(knitr)
library(rmarkdown)
library(knitrBootstrap)
options(bitmapType = "cairo")
opts_chunk$set(tidy=TRUE, highlight=T, figalign="center",
               fig.height=6, fig.width=10, message=F, error=F, warning=F, bootstrap.show.code=FALSE)
```

# Method
 * To see reproducibility, please check: `mirannotation.sh` script. `installer.sh` helps with some specific tools that are less likely you have installed.
 * scoring: in case the tool gives a score, the best score will be used. If not the first hit is the one used. If score is the same, the first hit is used. Tools that can be scored are: bowtie, bowtie2, chimira_blast, GEM, microzer, miraligner, miraligner-python, novoaling, razer3, STAR
 * only miraligner* and srnabench gives miRNA annotation, so these tools should have an advantage since they are parsing the hits to get the best annotation Anyway, I am trying to get the best of all of them when comparing which annotates better using precursor names.
 
```{r load-mir}
data<-read.table("stats",skip=1)
data$V2<-as.character(data$V2)
data$V4<-as.character(data$V4)
data$V5<-data$V5/abs(data$V5)
data$V5[data$V5==1]<-"Na"
data$V5[data$V5==-1]<-"Add"
data$V6<-data$V6/abs(data$V6)
data$V6[data$V6==1]<-"Na"
data$V6[data$V6==-1]<-"Mut"
data$changes<-paste(data$V5,data$V6)
data$TP<-apply(data[,c(2,4)],1,function(x){
  v<-grep(x[1],x[2],ignore.case=T)
  if (length(v)==0){v<-0}
  return (v)
})
data$TPmirna<-apply(data[,c(2,4)],1,function(x){
  h1 = unlist(strsplit(x[1], split = "-"))[1:3]
  h2 = unlist(strsplit(x[2], split = "-"))[1:3]
  v<-grep(paste0(h1, collapse = "-"),paste0(h2, collapse = "-"),ignore.case=T)
  if (length(v)==0){v<-0}
{'fraction_non_alphanumeric': 0.17158034528552457, 'fraction_numerical': 0.032934926958831344, 'mean_word_length': 5.214521452145214, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6318473', 'n_tokens_mistral': 1521, 'n_tokens_neox': 1433, 'n_words': 352}