#!/usr/bin/perl $pdblist = $ARGV[0]; $ftp = "/usr/bin/ftp"; $ftptmp1="filename1.txt"; $ftphost1 = "ftp.rcsb.org"; $ftpdir1 = "pub/pdb/data/structures/all/pdb/"; $pdb = "pdb"; $ent = ".ent"; open(PDBLIST, "$pdblist") || die "ERROR: Unable to open $pdblist FILE: $!\n"; print "$pdblist\n" while() { @fields = split; $pdbname = $fields[0]; $pdbname =~ tr/[A-Z]/[a-z]/; $pdbfile = "$pdb$pdbname$ent"; # get pdb file from ftp site print "Retrieving $pdbfile file from FTP site ...\n"; open(FTP, "|$ftp -n $ftphost1 > $ftptmp1"); print FTP "user anonymous "; print FTP "password a.l.cuff\@qmul.ac.uk\n"; print FTP "cd $ftpdir1\n"; print FTP "bin\n"; print FTP "get $pdbfile\n"; print FTP "bye"; $pdbfileunzipped = substr($pdbfile, 0, 11); print "Decompressing $pdbfileunzipped ... \n"; system("gunzip $pdbfile"); }