forked from CRG-Beato/utils_beatolab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
parse_log_kallisto.sh
executable file
·44 lines (31 loc) · 1.69 KB
/
parse_log_kallisto.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
#==================================================================================================
# Created on: 2016-01-13
# Usage: ./parse_log_kallisto.sh
# Author: Javier Quilez (GitHub: jaquol)
# Goal: summary statistics for the transcript quantification using kallisto
#==================================================================================================
#==================================================================================================
# CONFIGURATION VARIABLES AND PATHS
#==================================================================================================
# Variables
samples="rf_01_01_rnaseq rf_01_02_rnaseq rf_01_03_rnaseq rf_01_04_rnaseq rf_01_05_rnaseq rf_01_07_rnaseq rf_01_09_rnaseq"
data_type=rnaseq
project=rferrari
analysis=2016-01-19_run_rnaseq_pipeline
# Paths
SAMPLES=$HOME/data/$data_type/samples
ANALYSIS=$HOME/projects/$project/analysis/$analysis
otab=$ANALYSIS/tables/kallisto_summary_stats.txt
#==================================================================================================
# COMMANDS
#==================================================================================================
echo "... kallisto stats for a set of samples saved in $otab"
echo -e "sample_id\tn_processed\tn_pseudoaligned" > $otab
for s in $samples; do
ilog=$SAMPLES/$s/logs/${s}_quantification_kallisto.log
ilog=$SAMPLES/$s/logs/hg38/${s}_quantification_kallisto.log
n_processed=`grep "pseudoaligned" $ilog | sed "s/ reads, /;/g" | sed "s/[^0-9;]//g" |cut -f1 -d';'`
n_pseudoaligned=`grep "pseudoaligned" $ilog | sed "s/ reads, /;/g" | sed "s/[^0-9;]//g" |cut -f2 -d';'`
echo -e "$s\t$n_processed\t$n_pseudoaligned" >> $otab
done