I have a list of >50 pdb ids. I need to make a single png image containing pictures of these pdb files with their ids. I am wondering if there is any way to do that.
I have a list of >50 pdb ids. I need to make a single png image containing pictures of these pdb files with their ids. I am wondering if there is any way to do that.
Using the following makefile (it calls Imagemagick ):
IDS=1A7W 3CFS 3CFV 2P3K 4DRV 4DS0 2P3I 4DRR 4F5X
.PHONY: all clean
%.jpg:
curl -o $@ "http://www.rcsb.org/pdb/images/$(basename $@)_bio_r_500.jpg?bioNum=1"
convert -draw "text 10,10 '$(basename $@)'" $@ $@
all: result.jpg
##
## see http://www.sitepoint.com/forums/showthread.php?469594-imagemagick-How-can-I-mosaic-9-JPGs-into-one-JPG
##
result.jpg: $(addsuffix .jpg,${IDS})
montage $^ -tile x5 $@
clean:
rm -f result.jpg $(addsuffix .jpg,${IDS})
Result:
Get PyMOL, learn the 'fetch', 'ray, and 'png' commands. You can write a Python script to get high quality pictures in succession (check PyMOL scripting). The ID can be added as a label. For the 'grid' like view, check the grid_mode, grid_slot, and grid_max commands.
This would be the best way of doing it. Not only because you can pre-process the PDB files and have exactly what you need, you can define particular orientations for each molecule.
Only monomers? Download only monomers from the PDB. Using the advanced search you can modulate the query and get only monomers, dimers, protein, rna, etc. Just get the IDs and then use what I described above. Otherwise you'll have to find a way of removing the chains that are superfluous (xtal copies) by comparing sequences for example. Much harder to be honest.
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Thanks a lot. However when I try to run it I get the following error in ubuntu: makefile:6: * missing separator. Stop.
you've used a space instead of a tab: http://www.gnu.org/software/make/manual/html_node/Error-Messages.html
Thank you. It works now. I am wondering how to improve the quality of the picture. I would rather render them in PyMOL and combine them by imagemagick.
" am wondering how to improve the quality of the picture." : look at the manuals of convert and montage