matbnas
(usa Ubuntu)
Enviado em 18/08/2015 - 14:37h
Este script tem o objetivo de coletar uma gama de informaçoes das proteinas coletadas. Porem, gostaria de salvar os arquivos em csv.
for i in `ls` ;do#!/bin/bash
#currdir=$PWD
#cd $currdir
step1(){
rm -f list list1
find /Users/matheus/Desktop/Pdbpdg/ -name *.txt > list
cat list | sed -e 's/ /\\ /g' >list1
for i in `seq 2 12`;do rm -f list$i;done
rm -f list111 list1111 list66 list666
rm -f tabelatestefpocket-Pocket tabelatestefpocket-Druggability tabelatestefpocket-Number tabelatestefpocket-SASA-TOTAL tabelatestefpocket-SASA-POLAR tabelatestefpocket-SASA-APOLAR tabelatestefpocket-Volume Supertable.txt
while read -r linha ; do echo -e cat "$linha" >> list2 ;done < list1
for i in `seq 1 3502`;do echo "| head -n20 | grep Pocket >> tabelatestefpocket-Pocket" >> list3 ;done
for i in `seq 1 3502`;do echo "| head -n20 | grep Druggability >> tabelatestefpocket-Druggability" >> list4 ;done
for i in `seq 1 3502`;do echo "| head -n20 | grep Number >> tabelatestefpocket-Number" >> list5 ;done
for i in `seq 1 3502`;do echo "| head -n5 | grep SASA >> tabelatestefpocket-SASA-TOTAL" >> list6 ;done
for i in `seq 1 3502`;do echo "| head -n6 | tail -1 | grep SASA >> tabelatestefpocket-SASA-POLAR" >> list66 ;done
for i in `seq 1 3502`;do echo "| head -n7 | tail -1 | grep SASA >> tabelatestefpocket-SASA-APOLAR" >> list666 ;done
for i in `seq 1 3502`;do echo "| head -n8 | grep Volume >> tabelatestefpocket-Volume" >> list7 ;done
paste list2 list3 > list8
paste list2 list4 > list9
paste list2 list5 > list10
paste list2 list6 > list11
paste list2 list66 > list111
paste list2 list666 > list1111
paste list2 list7 > list12
chmod 700 list8
chmod 700 list9
chmod 700 list10
chmod 700 list11
chmod 700 list111
chmod 700 list1111
chmod 700 list12
./list8
./list9
./list10
./list11
./list111
./list1111
./list12
cat list2 |grep -o -P '.{0,11}info.{0,4}' > datalist
paste datalist tabelatestefpocket-Pocket tabelatestefpocket-Druggability tabelatestefpocket-Number tabelatestefpocket-SASA-TOTAL tabelatestefpocket-SASA-POLAR tabelatestefpocket-SASA-APOLAR tabelatestefpocket-Volume > Supertable.txt
}
step2(){
cd $i
head -n20 *.txt | grep Pocket > tabelatestefpocket-$i
head -n20 *.txt | grep Druggability >> tabelatestefpocket-$i
head -n20 *.txt | grep Number >> tabelatestefpocket-$i
head -n20 *.txt | grep SASA >> tabelatestefpocket-$i
head -n20 *.txt | grep Volume >> tabelatestefpocket-$i
done
exit
}
## run
step1
#step2
#step0