Skip to content
yvan edited this page Mar 18, 2015 · 1 revision

Useful commands

Counting number and total size of a bunch of file , keeping the highest number

while true ;do newc="$(ls -l sortingcollection*|wc -l)" ; if [ $c -lt $newc ] ; then c=$newc ;echo $c > counting.temp ;fi; sleep 15;done 2>/dev/null

while true ;do news="$(du -bc sortingcollection* |grep total |cut -f1)" ; if [ $s -lt $news ] ; then s=$news ;echo $s > counting.size ;fi; sleep 15;done 2> /dev/null

Find last 40 changed files

find . -type f -exec stat --format "%n %y" {} \; |sort -k2 |tail -n 40 |cut -d \ -f1

Find the start and end dat for the mapping process

for i in `cat List_of_samples ` ;do echo $i;find ./ -type f -name "*sam.out" -print -exec grep -e "# Starting at" {} \; 2>/dev/null |grep -v 010_alignment |grep $i -A1;find ./ -type f -name collectAlignmentSummaryMetrics.txt.out -print -exec grep -e "CollectAlignmentSummaryMetrics done" {} \; |grep -v 010_alignment|grep $i -A1 ;done

Find NoneType error in a directory, print which file contain the error

find ./ -type f -name "*.log" -exec grep -lr NoneType {} \;

Should find a way of automatic creation for job , mapping followed by variant…

Check errors

python /home/yvans/transfert/checkErrors.py

Get time for mapping and variant calling

for i in `cat Yvan_samples ` ;do echo ;echo $i;find ./ -type f -name "*sam.out" -print -exec grep -e "# Starting at" {} \; 2>/dev/null |grep -v 010_alignment |grep $i -A1;find ./ -type f -name collectAlignmentSummaryMetrics.txt.out -print -exec grep -e "CollectAlignmentSummaryMetrics done" {} \; 2>/dev/null |grep -v 010_alignment|grep $i -A1 ; find ./ -type f -name "*$i.log" -print -exec stat {} \; 2>/dev/null |grep "Access: 2" ;done

sandbox

log files have 264 lines

for i in ls -l ./ ; do ls -l $i ;done

Sample_Diag-excap37-14001105901-Bindevev-v01-KIT-Av5 Sample_Diag-excap37-14001133901-HA-v01-KIT-Av5 Sample_Diag-excap37-14001139601-EEogPU-v02-KIT-Av5 Sample_Diag-excap37-14001142400-EEogPU-v02-KIT-Av5 Sample_Diag-excap37-14001165701-Bindevev-v01-KIT-Av5 Sample_Diag-excap37-14001169901-Bindevev-v01-KIT-Av5 Sample_Diag-excap37-14001183001-HA-v01-KIT-Av5 Sample_Diag-excap37-NA12878-K4-EEogPU-v02-KIT-Av5

list_sample; Sample_Diag-excap37-14001165701-Bindevev-v01-KIT-Av5 Sample_Diag-excap37-14001169901-Bindevev-v01-KIT-Av5 Sample_Diag-excap37-14001183001-HA-v01-KIT-Av5 Sample_Diag-excap37-NA12878-K4-EEogPU-v02-KIT-Av5

for i in cat list_sample ; do cd $i ;ls -l $PWD/data/sample.conf ; perl /data/diag/diagInternal/diagnosticBundle/script/amg/variantcalling/pipeline/variantCallingPipeline.pl $PWD/data/sample.conf &> $i.log ; cd ../ ;done

Clone this wiki locally