Pesquisar este blog

quarta-feira, 28 de janeiro de 2015

Gaussian input file

# Rodar geometria do checkpoint
$ more zn.com
%chk=znisapn_b3.chk
%NProc=2
%mem=8GB
# bp86/TZVP pop=(ReadRadii,MK) Geom=AllCheckpoint

Cu 1.8

$

quarta-feira, 7 de janeiro de 2015

Why classify proteins?

Proteins can be classified into groups according to sequence or structural similarity.

Thus, when a novel protein is identified, its functional properties can be proposed based on the group to which it is predicted to belong. 


We will explain how families, domains and sequence features can be defined and used for protein classification.


Lets see how  proteins can be classified into different groups based on:
  • the FAMILIES to which they belong
  • the DOMAINS they contain
  • the SEQUENCE FEATURES they possess



What are protein families?


A protein family is a group of proteins that share a common evolutionary origin, reflected by their related functions and similarities in sequence or structure.



Protein domain

Domains are distinct functional and/or structural units in a protein.
A protein domain is a conserved part of a given protein sequence and (tertiary) structure that can evolve, function, and exist independently of the rest of the protein chain.

Each domain forms a compact three-dimensional structure and often can be independently stable and folded. 

 Molecular evolution uses domains as building blocks and these may be recombined in different arrangements to create proteins with different functions




Family- and domain-based protein classification


http://www.ebi.ac.uk/training/online/course/introduction-protein-classification-ebi/protein-classification/family-and-domain-based-protei


What are sequence features?


Sequences features are groups of amino acids that confer certain characteristics upon a protein, and may be important for its overall function. Such features include:


  • active sites, which contain amino acids involved in catalytic activity. For example, the enzyme lipase, which catalyses the formation and hydrolysis of fats, has two amino acid residues (a histidine followed by a glycine) that are essential for its catalytic activity.
  • binding sites, containing amino acids that are directly involved in binding molecules or ions, like the iron-binding site of haemoglobin.
  • post-translational modification (PTM) sites, which contain residues known to be chemically modified (phosphorylated, palmitoylated, acetylated, etc) after the process of protein translation.
  • repeats, which are typically short amino acid sequences that are repeated within a protein, and may confer binding or structural properties upon it.
From: http://www.ebi.ac.uk/training/online/course/introduction-protein-classification-ebi/protein-classification/why-classify-proteins

terça-feira, 6 de maio de 2014

enim EPR

Documents/iff105/Cuenim/1stRound/QMMMM/Cluster/frame

1) Substitui os nomes dos átomos com números para os nomes canônicos

sed "s/C3/C /g" cuenim.xyz | sed "s/C5/C /g" | sed "s/H2/H /g" | sed "s/N2/N /g" | sed "s/H6/H /g" | sed "s/H7/H /g" | sed "s/C1/C /g" | sed "s/H8/H /g" | sed "s/H9/H /g" | sed "s/N3/N /g" | sed "s/H3/H /g" | sed "s/H11/H /g" | sed "s/CU/Cu /g" | sed "s/H4/H /g" | sed "s/H5/H /g" | sed "s/N1/N /g" | sed "s/H10/H /g" | sed "s/C4/C /g" | sed "s/H1/H /g" | sed "s/C5/C /g" | sed "s/C5/C /g" | sed "s/C5/C /g" | sed "s/C5/C /g" | sed "s/C5/C /g" | sed "s/C2/C /g"> aaaa.xyz

2) Roda o script master para obter dois arquivos: "cauda" e "cabeça"

3) Roda o arquivo job.sh (favor alterar as variáveis!!) para separar a trajetória em n arquivos xyz
cria um dir chamado frame para colocar os arquivos

4) Roda este script pra criar o input pro ORCA
#!/bin/bash

for ((  i = 1 ;  i <= 329;  i=i+1  )); do cat cabeca frame_$i.xyz cauda >> $i.inp;
 done

cria um dir inp para colocar os arquivos de input


5) Roda o script do orca
#!/bin/bash

for ((  i = 1 ;  i <= 200;  i=i+1  )); do 
/home/marcos/Programs/orca_2_9_1_linux_x86-64/orca $i.inp > $i.out 
 done


Distâncias Cu_O para os 120 primeiros frames da dinâmica QM/MM

#Análise dos resultados:


# Obtém os dados de 'A' e organiza nos arquivos Axx, Ayy e Azz

for (( i = 1 ; i <= 121; i=i+1))
do

Axx=`sed -n '/ Ax       Ay       Az/{N;N;N;p;}'  $i.out | sed '4!d' | awk {'print $5,$6,$7'} | sed ':a;$!N;s/ /\n/;ta;' | sort -n | sed '3!d'`; echo $i ${Axx} >> Axx
Ayy=`sed -n '/ Ax       Ay       Az/{N;N;N;p;}'  $i.out | sed '4!d' | awk {'print $5,$6,$7'} | sed ':a;$!N;s/ /\n/;ta;' | sort -n | sed '2!d'`; echo ${Ayy} >> Ayy
Azz=`sed -n '/ Ax       Ay       Az/{N;N;N;p;}'  $i.out | sed '4!d' | awk {'print $5,$6,$7'} | sed ':a;$!N;s/ /\n/;ta;' | sort -n | sed '1!d'`; echo ${Azz} >> Azz

done

#explica
#sed -n '/ Ax       Ay       Az/{N;N;N;p;}'  $i.out
# pega 3 linhas abaixo depois de encontrar o padrao "Ax       Ay       Az" no arquivo $i.out. O nro de linha abaixo esta relacionado com a repeticao N; . Por se N;N; quer dizer que pegara tb 2 linhas abaixo do padrao.
#sed ':a;$!N;s/ /\n/;ta;' >> substitui espaço em branco por um enter;


*************************************

#!/bin/bash

for (( i = 1 ; i <= 121; i=i+1))
do
grep -3 "Ax       Ay       Az" $i.out | grep 13Cu >> INFO/A_hiperfino.dat
grep "g(tot)" $i.out >> INFO/g_tot.dat
done

awk {'print $5,$6,$7'} INFO/A_hiperfino.dat >> INFO/hyperfine.dat
awk {'print $2,$3,$4,$6'} INFO/g_tot.dat >> g-tensor.dat

for (( i = 1 ; i <= 121; i=i+1))
do

done

sábado, 1 de março de 2014

Passo a passo IC – BLG

Download de programas e estruturas
1) Baixar DS (discovery Studio), VMD ou pymol
Discovery Studio Visualizer

VMD

2) Baixar todas as estruturas cristalográficas da BLG

Abrir a estrutura da BLG no editor de texto e investigar os principais campos


Estudo sobre proteínas
0) Estudar os tipos de aminoácidos em especial suas características elétricas, aromáticas e estéricas:
restype non-polar residues (white), basic residues (blue), acidic residues (red) and polar residues (green).
1) Anotar os aminoácidos contidos nas estruturas e suas diferenças/mutações
2) investigar as formas de ligação ligação de H, hidrofóbica, van der Waals
3) anotar as estruturas secundárias mais recorrentes
4) Verificar a relação entre as características de cristalização e a forma (dimérica, monomérica etc) da proteína
5) Investigar os ligantes na cavidade e as ligações mais próximas (close contacts)
(all and same residue as within 3 of resname XXX)

Estudo dos papers referentes as estruturas
1) Baixar os artigos e ler (na diagonal) qual contém informações sobre a estrutura
2) Procurar trabalhos de simulação computacional da BLG

Visualizar com o VMD (por ex) o número e o caráter das ligações de H do backbone e dos resíduos.
Observar ao longo da trajetória este comportamento. Observar o caráter das HB na alfa hélice e nas beta folhas

Momentos de dipolo da beta folha e alfa helice
Ligação dissulfidica

Estrutura primária: cadeia polipeptídica
Estrutura secundária: alfa-hélices, Beta-folhas
Estrutura terciária: estrutura 3D da proteína monomérica
Estrutura quaternária: estrutura entre várias cadeias plipeptídicas








Breve tutorial sobre o DS

Apresentação media

Apresentação do DS da Acccelys



beta-lactoglobulina

3NPO Bovine beta lactoglobulin unliganded form

http://www.rcsb.org/pdb/explore/explore.do?structureId=3NPO


Alguns resultados preliminares da BLG com o aumento da temperatura de 300 para 400 K.

Ligações de hidrogênio no backbone.

RMSD da proteína.

NSTEP =  2476000   TIME(PS) =   50872.000  TEMP(K) =   400.70 

Dinâmica Molecular

https://www.youtube.com/watch?v=2q8GiAEP8Go&list=PLIRzR2JaWHDYWSsbH07aBIdAaOIla-npA


Ver

Molecular dynamics simulation of the effect of heat on the conformation of bovine β-lactoglobulin A: A comparison of conventional and accelerated methods

sexta-feira, 1 de novembro de 2013

shell script

sed -n '/ 1 /p' FM_REF_FORCES > 1.dat


Get the lines starting with "i" and put in "i.dat" files

for ((  i = 1 ;  i <= 24;  i++  ))
do
echo "$i"
sed -n "/ $i /p" FM_REF_FORCES > $i.dat
done


SED

o Sed é orientado a linha, de cima para baixo, da esquerda para a direita.

A sintaxe genérica de um comando Sed é:

sed [opções] regras [arquivo]

Sendo que regras tem a forma genérica de:

[endereço1 [, endereço2]] comando [argumento]


Como dica geral SEMPRE coloque os comandos do Sed entre aspas simples

$ more exemplo
Folha de Sao Paulo
O estado de Sao Paulo
Noticias Populares
Gazeta do Povo
O Globo

$sed -n 'p' exemplo 
Folha de Sao Paulo
O estado de Sao Paulo
Noticias Populares
Gazeta do Povo

O Globo

$ sed -n '1p' exemplo 
Folha de Sao Paulo

$ sed -n '2p' exemplo 
O estado de Sao Paulo

$ sed -n '3p' exemplo 
Noticias Populares



ENDEREÇO

Deleta a 2° linha ou a linha que contenha a palavra estado

$ sed '2d' exemplo 
Folha de Sao Paulo
Noticias Populares
Gazeta do Povo
O Globo

sed '/estado/d' exemplo 
Folha de Sao Paulo
Noticias Populares
Gazeta do Povo
O Globo


Imprimi a 2° linha ou a que contenha a palavra estado

$ sed -n '2p' exemplo 
O estado de Sao Paulo

$ sed -n '/estado/p' exemplo 
O estado de Sao Paulo



Deleta e imprimi linhas dentro do range 2 a 4

$ sed '2,4d' exemplo
Folha de Sao Paulo
O Globo

$ sed -n '2,4p' exemplo
O estado de Sao Paulo
Noticias Populares
Gazeta do Povo

Deleta e imprimi entre a linha 2 e a palavra gazeta:

$sed '2,/Gazeta/d' exemplo
Folha de Sao Paulo
O Globo

$ sed -n '2,/Gazeta/p' exemplo
O estado de Sao Paulo
Noticias Populares
Gazeta do Povo



Deleta e imprimi entre duas palavras:

$ sed '/estado/,/Gazeta/d' exemplo
Folha de Sao Paulo
O Globo

$ sed -n '/estado/,/Gazeta/p' exemplo
O estado de Sao Paulo
Noticias Populares
Gazeta do Povo


No endereço, temos um caractere especial, o $ que referencia à última linha do texto. Assim sendo, para apagar da linha 2 até o final do texto:

$ sed '2,$d' exemplo
Folha de Sao Paulo

Imprimir a linha, a linha mais 1 linha, e mais 2 linhas.....

$ sed -n '/estado/p' exemplo
O estado de Sao Paulo

$ sed -n '/estado/,+p' exemplo
O estado de Sao Paulo

$ sed -n '/estado/,+1p' exemplo
O estado de Sao Paulo
Noticias Populares

$ sed -n '/estado/,+2p' exemplo
O estado de Sao Paulo
Noticias Populares
Gazeta do Povo

$ sed -n '/estado/,+3p' exemplo
O estado de Sao Paulo
Noticias Populares
Gazeta do Povo
O Globo


Interrompa o sed até a primeira linha em branco

$ sed '/^$/q' exemplo


Colocando na frente do d ou p o simbolo !, invertemos a lógica do comando

$ sed -n '/estado/p' exemplo
O estado de Sao Paulo

$ sed -n '/estado/!p' exemplo
Folha de Sao Paulo
Noticias Populares
Gazeta do Povo
O Globo



Este comando apaga as linhas 5, 10 e as que têm estorvo do arquivotexto.txt.
$ sed '1d;3d;/estado/d' exemplo

Substitui a 1° ocorrencia (por linha) da palavra Gazeta por bobao no arquivo exemplo
sed -e 's/Gazeta/bobao/' exemplo



sed -e 's/Gazeta/bobao/g' exemplo

substitui no arquivo todo!

___________________________________________
Programa para obter os resultados do 3DNA

#Para executar o programa digite: 
#sed -n -f programa.sed 3dna_output.out > opening.dat


# Obter o conteúdo entre a TAG < > </ >
//{:a;/<\/opening>/!{N;ba;};p;}


# Para obter o conteúdo entre a TAG < > </ > retirando a TAG:
#//{/{<\/opening>}/tc;:a;/<\/opening>/!{N;ba;};:c;s/.*//;s/<\/opening>.*$//;p;}



ou ....



#!/bin/sh
sed -n '//{:a;/<\/alpha1>/!{N;ba;};p;}' ensemble_example.out > alpha1.dat


#inserir uma linha em rbanco no inicio do arquivo
 sed '1i\ ' arq > arq2




Texto editado de: http://aurelio.net/sed/sed-HOWTO/

VMD label under construction....

proc label_atoms { top all } {
  set sel [atomselect top all]
  set atomlist [$sel list]
  foreach {atom} $atomlist {
    set atomlabel [format "%d/%d" top $atom]
    label add Atoms $atomlabel
  }
}


set sel1 [atomselect top all]
set atomlist [$sel1 list]
foreach {atom} $atomlist {
    set atomlabel [format 0/2 top $atom]
    label add Atoms $atomlabel
        show type
  }




set sel [atomselect top all]
set a [$sel get type]

ptraj

# ptraj example

trajin eq_density.rst                       coordinates file to read
trajout reimaged.rst restart          output file in the same format as the input
center :1                                                    center the box to the geometric center of residue 1
image center                                                    force all the molecules into the primary unit cell

#Run ptraj according this syntax:
ptraj dna_solv.top < test.ptraj



trajin md2.mdcrd 1 19000 5 [start stop offset]
strip :WAT,Na+                      #take care with blank spaces
center :1-20 mass origin 
image origin center familiar 
trajout output.pdb pdb append 

If you use cpptraj you can omit the 'append' keyword from the
'trajout' command since MODEL/ENDMDL keywords are added automatically
for multiple frame PDB output files.




trajin eq_density.rst
trajout reimaged.rst restart
center :1-12
image center

trajin cie_solv_md3.mdcrd
trajin cie_solv_md4.mdcrd
center :1-25 mass origin 
image origin center familiar 
trajout output.cdf netcdf


9.1 ptraj coordinate input/output commands

trajin filename [ start stop offset] [remdtraj remdtrajtemp reptemp] 

reference filename

trajout filename [ format ] [ nobox ] [ nowrap ] [ append ] [ remdtraj ] [ lessplitjaverage ] [ little j big ] \
[ dumpqj parse ] [ title title ] [ application application ] [ program program ]

filename [ format ]: Specify the name of a file for output coordinates (filename) written
in a specific format (format). Currently supported formats are:


• trajectory – Amber ascii trajectory, the default

• restart – Amber restart

• binpos – Scripps binary format

• pdb – PDB, the traditional format (not the newer CIF files); if molecule information is present, TER cards will be written between molecules.

• cdf | netcdf – Amber NetCDF binary trajectory

• charmm – CHARMM DCD binary trajectory


Note that the allowable formats include both trajectory files (i.e., a series of frames) and
files that traditionally include only a single coordinate set. In this latter case, the filename
will be appended with .N where N is the frame number (unless the optional keyword
append is specified).

media e desvio

awk '{ total += $2; count++ } END { print total/count }' test_opening.dat





#!/usr/bin/awk -f
#
#     Programa para calcular media e desvio padrao em awk
#----------------------------------------------------------

{
   soma+=$1
   somaquad+=$1*$1
}

END {
       media=soma/NR
       desvpad=sqrt((somaquad - NR*media**2)/(NR - 1))
       printf    "Media (Desvio): %.2f  %.2f\n" , media, desvpad
    }




From:
http://blog.eldermarco.com/2011/06/media-e-desvio-padrao-em-awk/

VMD scripts


# mostrar o complexo (resid 1) e as aguas a 3 angstrons do cobre (index 3)
(water or resid 1) and same residue as (within 3 of index 3)
(water or nucleic) and within 3.5 of name Cu
water and same residue as (within 2.5 of resid 1)
water within 2.5 of resid 1
resid 2 3 and within 20 of index 13
name OW and (within 2 of backbone)
resname CIE DA DT DC DG and (within 4 of resname CIE)
resname 'Na+'
all and not resname "Cl-"

# coloque 'update selection' na guia trajectory
nucleic and (within 7 of resname CIE)
# neste caso vai selecionar so os átomos do nucleic que estao perto do serial 4
nucleic and (within 3 of resname CIE and serial 4)

#Selecionar apenas o restante das moleculas sem incluir o CIE
not resname CIE and within 5 of resname CIE

index 10 11 12
index 10 to 12

resname QUA pro
residue cys ala
resid 1 2 3

type H HO
element H C N O (?)

protein not hydrogen

vmd –parm7 acetone_solv.top –rst7 acetone_solv.rst
vmd –parm7 acetone_solv.top –crdbox “outputfile”.crd
mol addfile equil-press/equil-$i.crd type crdbox waitfor all



# diferença entre resid e residue

residue 0 to 342 # mostra os resíduos de um único domínio
resid 1 to 343 # mostra os resíduos dos vários domínios enumerdos de 1 até n. Normalmente as moléculas de água e os aminoácidos iniciam por 1, desta forma quando o selecionamos os dois aparecem na tela.


#Habilitar o log para verificar a ação equivalente da linha de comando
# no terminal digite:
log nome.log

log off

#Load script files
vmd -e load.tcl
vmd -e vmd.vmd

cat load.tcl
#LOAD FILES
set mol [mol new cie_solv.top type parm7 waitfor all]
for {set i 3} {$i <= 7} {incr i} {
    mol addfile cie_solv_md$i.mdcrd type netcdf waitfor all
}

#gravar arquivo pqr
vmd -dispdev text
set mol [mol new prot_solv.top type parm7 waitfor all]
mol addfile reimaged14.rst.1 type rst7
animate write pqr test.pqr
#animate write pqr {/home/marcos/Desktop/rst/aaaaaaa.pqr} beg 0 end 0 skip 1 0

#gravar trajetória e pdb de frames e seleção específica (não funciona porque as H2O se afastam)
vmd -dispdev text
set mol [mol new cie_solv.top type parm7 waitfor all]
mol addfile output.cdf type netcdf first 0 last 2000 step 1 waitfor all
set sel [atomselect top "all and same residue as (within 5 of resname CIE)"]
animate write dcd com_traj.dcd beg 1 end 2000 sel $sel
animate write pdb com_traj.pdb beg 1 end 1 sel $sel


# adicionar label pela linha de comando
label add Atoms 0/6323
label addspring 0 4296 4299 1


vmd > label
label add [Atoms|Bonds|Angles|Dihedrals] {atoms as /}
label addspring
label list              -- return label categories
label list   -- return id's of labels in given category
label [show|hide|delete] [index] -- 
Control specific label or all labels in category
label graph -- Return a list of values for the given label
for all animation frames
label textsize []
label textthickness []

# convenções no VMD
resid no VMD pode ser mais de um tipo de residuo, por ex:
resid 1 quer dizer os residuos CIE 1 e também a primeira molécula de água: SOLV 1
Assim pra salvar mais de um composto pode ser interessante utilizar: "resname CIE or resid 234 765", assim salvará apenas 3 resíduos


From:
http://www.ks.uiuc.edu/Research/vmd/vmd-1.7/ug/node192.html

VMD Command-Line Options

When started, the following command-line options may be given to VMD. Note that if a command-line option does not start with a dash (-), and is not part of another option, it is assumed to be a PDB filename. Thus, the Unix command
        vmd molecule.pdb
will start VMD and load a molecule from the file molecule.pdb. On the Windows platform, one must preface the VMD invocation with the Windows start command
        start vmd molecule.pdb
  • -m : Load all subsequent files into separate molecules. The -f and -m options may be specified multiple times on the command line in order to load multiple molecule containing one or more files.
  • -h | -? : Print a summary a command-line options to the console.
  • -e filename : After initialization, execute the text commands in filename, and then resume normal operation.
  • -psf filename : Load the specified molecule (in PSF format) at startup. The PSF file only contains the molecular structure; a PDB or DCD file must also be specified when this option is used.
  • -pdb filename : Load the specified molecule (in PDB format) at startup.
  • -dcd filename : Load the specified trajectory file (in binary DCD format) at startup. The DCD file only contains atomic coordinates; a PDB or PSF file must also be specified when this option is used.
  • - filename : Load the specified file using the given filetype.
  • -f : Load all subsequent files into the same molecule. This is the default. A new molecule is created for each invocation of -f; thus, vmd -f 1.pdb 2.pdb -f 3.pdbloads 1.pdb and 2.pdb into the same molecule and 3.pdb into a different molecule.

  • -dispdev < win | text | cave | caveforms | none > : Specify the type of graphical display to use. The possible display devices include:
    • win: a standard graphics display window.
    • text: do not provide any graphics display window.
    • cave: use the CAVE virtual environment for display, forms are disabled.
    • caveforms: use the CAVE virtual environment for display and with forms enabled. This is useful with -display machine:0 for remote display of the forms when the CAVE uses the local screen.
    • none: same as text.
    It is possible to use VMD as a filter to convert coordinate files into rendered images, by using the -dispdev text and -e options.
  • -dist z : Specify the distance to the VMD image plane.
  • -height y : Specify the height of the VMD image plane.
  • -pos x y : Specify the position for the graphics display window. The position (x,y) is the number of pixels from the lower-left corner of the display to the lower-left corner of the graphics window.
  • -size x y : Specify the size for the graphics display window, in pixels.
  • -nt : Do not display the VMD title at startup.
  • -startup filename : Use filename as the VMD startup command script, instead of the default .vmdrc or vmd.rc file.
  • -debug [level : Turn on output of debugging messages, and optionally set the current debug level (1=few messages ... 5=many verbose messages). Note this is only useful if VMD has been compiled with debugging option included.

DynDom - Protein Domain Motion - PBP

Programa online que identifica as regiões na proteína que sofrem modificações conformacionais tendo cmo ase duas estruturas. O programa pode ser baixado para estudar uma trajetória de MD.

Resíduos envolvidos no bending (hinge group) para as duas estruturas cristalizadas.
http://fizz.cmp.uea.ac.uk/dyndom/

resid 75 to 77 227 to 241 254 to 255




Gnuplot


# PRINT SYMBOL AND SUBSCRIPT/SUPERSCRIPT
set terminal postscript eps enhanced mono lw 1 "Helvetica" 28 size 6.0,4.0
set ylabel "{/Symbol q} [deg cm^2 dmol^{-1}]"      

# Print anstrom:
set encoding iso_8859_1        
set ylabel "RMSD [\305]"

# PRINT in png file
set term png
set output "energies.png"

# Fixar o tamanho do gráfico
set bmargin 1.5
set lmargin 1
set rmargin 1
set tmargin 1

# REMOVE X/Y TICS
set xtics ""
set ytics ""

set xtics 0.5
set ytics 0.3

# REMOVE LABELS
set format x ""
set format y ""
#REINTRODUCE LABELS AND SCALE
set format x

# Exponential
# exponential format: XXe+0X
set format x "%6.0e"

# XTICS
set xtics ("April" 1, "May" 2, "June" 3, "July" 4)

set xtics 10000

# EIXOS CARTESIANOS
set {x|x2|y|y2|z}zeroaxis { {linestyle | ls }
                                | { linetype | lt }
                                  { linewidth | lw }}
     unset {x|x2|y|y2|z}zeroaxis
     show {x|y|z}zeroaxis

set xzeroaxis ls 5 lt 3 lw 1.5

set yzeroaxis ls 5 lt 3 lw 1.5

# shell script
#!/bin/sh
gnuplot << EOF
set format x "%.1e"
set term png  lw 1 font 'Verdana,5'
set output "Mult.png"
set yrange [1.5:4]
set xrange [0:3513]
set multiplot layout 2,2
p "Cu-DC21_O1P.dat" u 1:2 w l lc -1 # cor preta lc -1
p "Cu-DC21_O2P.dat" u 1:2 w l
p "Cu-DC20_O1P.dat" u 1:2 w l
p "Cu-DC20_O2P.dat" u 1:2 w l

EOF
display Mult.png

# plotar mais de uma coluna num único arquivo
plot 'test.dat' title 'data', \
     ' ' u ($1-dx):(d($2)) title '1-variable derivative', \
     ' ' u ($1-dx):(d2($1,$2)) title '2-variable derivative', \
     ' ' u ($1-dx):(d2($1,$2)) smooth csplines title '2-variable derivative (smoothed)'



p "1.out" u 1:2 t "" w lines lt 1 lw 5

set multiplot layout 5,5
set tics scale 0 # scale of tics, 0 is without tics
set bmargin 1.5
set lmargin 1
set rmargin 1
set tmargin 1
# set title "TDDFT calculation"
set xrange [2:4]
set yrange [0:0.35]
# set xtics offset 0,graph 0.05 #position of the x label
set ytics offset 0,graph 0.1
#set xtics 0.5
#set ytics 0.3
set xlabel ""
set ylabel ""

# remove the legend, x and y labels
#set nokey
set format x ""
set format y ""

#change the tics marks and tics labels
set format x
set format y
set ytics offset 0,graph 0.1
set xtics 0.5
set ytics 0.3



XXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXX PLOT ENERGIES FILE XXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXX

set term png
set output "energies.png"

set multiplot layout 2,3 title ""
set bmargin 3
#set xtics 20000
#set format x "%6.0e"
plot "ENERGIES" u 1:3 t "TEMPERATURE" w l
plot "ENERGIES" u 1:2 t "EKINC" w l
plot "ENERGIES" u 1:4 t "EKS" w l
plot "ENERGIES" u 1:5 t "ECLASSIC" w l
plot "ENERGIES" u 1:6 t "EHAM:conserved ?" w l


set multiplot layout 1,2 title ""
set bmargin 3
set yrange [-0.5:4.5]
plot "ENERGIES" u 1:($5-$4) t "Enuclei" w l, "ENERGIES" u 1:(5*$2) t "5xEkinc" w l
set yrange [-82:-75.0]
plot "ENERGIES" u 1:4 t "EKS" w l, "ENERGIES" u 1:5 t "ECLASSIC" w l, "ENERGIES" u 1:6 t "EHAM:conserved ?" w l




set multiplot layout 2,3 title ""
set bmargin 3
plot "ENERGIES" u 1:2 t "EKINC" w l
plot "ENERGIES" u 1:3 t "TEMPERATURE" w l
plot "ENERGIES" u 1:4 t "EKS" w l, "ENERGIES" u 1:5 t "ECLASSIC" w l, "ENERGIES" u 1:6 t "EHAM:conserved ?" w l




XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXX PLOT ELECTRONIC SPECTRA XXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


grep "f=" tddft_original.out | awk '{print $3,$6}' > 1.txt
gnuplot
set title "TDDFT calculation"
set xlabel ""
set ylabel "Transition (eV)"
plot "1.txt" u 1:2 title "Absorsion" w impulses




XXXXXXXXX OTHERS XXXXXXXXXXXXXXXX
exponential format: XXe+0X
set format x "%6.0e"

set term png
set output "energies.png"


set xtics ("April" 1, "May" 2, "June" 3, "July" 4)

set xtics 10000

plot "test.dat" using 1:2:3 with yerrorbars
plot "test.dat" using 1:2:3 with xerrorbars


Create a title:                  > set title "Force-Deflection Data"
Put a label on the x-axis:       > set xlabel "Deflection (meters)"
Put a label on the y-axis:       > set ylabel "Force (kN)"
Change the x-axis range:         > set xrange [0.001:0.005]
Change the y-axis range:         > set yrange [20:500]
Have Gnuplot determine ranges:   > set autoscale
Put a label on the plot:         > set label "yield point" at 0.003, 260
Change the tic-marks:            >
set xtics 3000
set xtic ("0" 0,"3" 3000,"6" 6000,"9" 9000,"12" 12000,"15" 15000)
Move the key:                    > set key 0.01,100
Delete the Label line:           > unset key


set terminal postscript eps color lw 3 "Helvetica" 20
set output "spectra.eps"

#SOMAR COLUNA
 awk '{ soma = soma + $7} END {print soma} ' < cu.mol2



gnuplot
set multiplot
set xlabel ""
set ylabel ""
set size 1,0.2
set format x ""
set origin 0.0,0.8; plot "ENERGIES" u 1:2 t "EKINC" w l
set origin 0.0,0.6; plot "ENERGIES" u 1:3 t "TEMPERATURE" w l
set origin 0.0,0.4; plot "ENERGIES" u 1:4 t "EKS" w l
set origin 0.0,0.2; plot "ENERGIES" u 1:5 t "ECLASSIC" w l
set title "/local/GRS/Users/claudia/faceAB/5_TDDFT/CINCO/VEINTE"
set format x " %10.0f"
set xlabel "n steps"
set origin 0.0,0.0; plot "ENERGIES" u 1:6 t "EHAM:conserved ?" w l



#####
DOS

gnuplot
set terminal postscript eps color lw 2 "Helvetica" 20
set xrange [-13.75:-11.75]
#set multiplot layout 2,2
set output "apyhist.eps"
p  "./apyhist.txt" u 1:4 w l lw 4 lt 1  lc 9 t "Copper", "./apyhist.txt" u 1:5 w l lw 4 lt 1 lc 9 t "", "./apyhist.txt" u 1:6 w l lw 4 lt 1 lc 1 t "Coordinating Atoms", "./apyhist.txt" u 1:7 w l lw 4 lt 1 lc 1 t "", "./apyhist.txt" u 1:2 w l lw 4 lt 2 t "Total", "./apyhist.txt" u 1:3 w l lw 4 lt 2 t ""
set output "apzhist.eps"
p  "./apzhist.txt" u 1:4 w l lw 4 lt 1  lc 9 t "Copper", "./apzhist.txt" u 1:5 w l lw 4 lt 1 lc 9 t "", "./apzhist.txt" u 1:6 w l lw 4 lt 1 lc 1 t "Coordinating Atoms", "./apzhist.txt" u 1:7 w l lw 4 lt 1 lc 1 t "", "./apzhist.txt" u 1:2 w l lw 4 lt 2 t "Total", "./apzhist.txt" u 1:3 w l lw 4 lt 2 t ""
set output "apyepyt.eps"
p  "./apyepy.txt" u 1:4 w l lw 4 lt 1  lc 9 t "Copper", "./apyepy.txt" u 1:5 w l lw 4 lt 1 lc 9 t "", "./apyepy.txt" u 1:6 w l lw 4 lt 1 lc 1 t "Coordinating Atoms", "./apyepy.txt" u 1:7 w l lw 4 lt 1 lc 1 t "", "./apyepy.txt" u 1:2 w l lw 4 lt 2 t "Total", "./apyepy.txt" u 1:3 w l lw 4 lt 2 t ""
set output "apzepy.eps"
p  "./apzepy.txt" u 1:4 w l lw 4 lt 1  lc 9 t "Copper", "./apzepy.txt" u 1:5 w l lw 4 lt 1 lc 9 t "", "./apzepy.txt" u 1:6 w l lw 4 lt 1 lc 1 t "Coordinating Atoms", "./apzepy.txt" u 1:7 w l lw 4 lt 1 lc 1 t "", "./apzepy.txt" u 1:2 w l lw 4 lt 2 t "Total", "./apzepy.txt" u 1:3 w l lw 4 lt 2 t ""
exit

####
Fit

gnuplot
f(x) = mean_y
fit f(x) 'thr10_1.agr' u 1:2 via mean_y

set multiplot layout 2,2 columnsfirst

################
Average

echo "scale=2; `cat X2_X3a.dat | gawk '{sum+=$1}END{print sum}'` / `cat X2_X3a.dat | wc -l`" | bc



###############################

# Two axes
gnuplot
set xrange [200:800]
set yrange [0:0.45]
set y2range [0:45000]
set nokey
#set ytics 0.5 nomirror tc lt 1
#set ylabel '2*x' tc lt 1

#set y2tics 20000 nomirror tc lt 10000
#set y2label 'Absortion' tc lt 10000

plot 'UVData.txt' u 3:4 w i linetype 2, 'UVSpectrum.txt' u 2:3 w l linetype 1 axes x1y2 



# Plot using 2 axes
gnuplot << EOF

set term png lw 1 font 'Verdana,5'
set output "Mult.png"
set xrange [200:800]
#set yrange [0:0.45]
#set y2range [0:45000]
#set nokey
#set ytics 0.5 nomirror tc lt 1
#set ylabel '2*x' tc lt 1

#set y2tics 20000 nomirror tc lt 10000
#set y2label 'Absortion' tc lt 10000

set multiplot layout 3,1

plot 'gausssum2.2/UVData.txt' u 3:4 t "RHO2" w i linetype 2 , 'gausssum2.2/UVSpectrum.txt' u 2:3 t "" w l linetype 1 axes x1y2 
plot 'R1/gausssum2.2/UVData.txt' u 3:4  t "R1" w i linetype 2, 'R1/gausssum2.2/UVSpectrum.txt' u 2:3 t "" w l linetype 1 axes x1y2 
plot 'R2/gausssum2.2/UVData.txt' u 3:4   t "R2" w i linetype 2, 'R2/gausssum2.2/UVSpectrum.txt' u 2:3 t ""  w l linetype 1 axes x1y2 

EOF
display Mult.png &

Sites interessantes:
http://www.gnuplotting.org/