I am working with autodock vina for virtual screening and docking. Autodock vina generates conformers for multiple ligands. I want to make the complex of these conformers with receptor. e.g. I have 100 .pdbqt files for vina output for conformers and one receptor pdbqt file. By running command-
cut -c-66 inh*.pdbqt > inh*.pdb
I can convert inh*.pdbqt to pdb, but I have to do this individually for all ligands (* here are random numbers from pubchem database).
With command-
cat Receptor.pdbqt inh*.pdb | grep -v '^END ' | grep -v '^END$' > complex.pdb
With this command the pdb of complex of receptor and ligand is generated, but again this I have to do for each ligand, receptor file is fixed in this case.
I want a bash script for above to commands to run in cygwin. Aim is to use multiple ligand files - convert them to pdb - merge with receptor.pdbqt - generate multiple complexes as per ligand names.
This may need a simple script. Though I have worked with many scripts I don't know how to write such bash scripts. Naively, I have given a try and wrote one script-
#!/bin/bash
for f in inh*.pdbqt; do b=`basename $f .pdbqt`;
$b; mkdir -p data02; cut -c-66 inh*.pdbqt > inh*.pdb;
cat 3V3VN.pdbqt inh*.pdb | grep -v '^END' | grep -v '^END$' > complex*.pdb;
$f --out data02/$f.pdbqt --log data02/$f.txt; done
(I have tried it from the VS02.bash script, http://www.bioinformation.net/006/97320630006387.pdf)
It generates the complex but only one complex with all ligands in it !!!
Can anyone write or suggest the script for this problem?