Uncategorized

Comparing structures with pymol and babel

To align structures using babel, the command is:

babel -ixyz structure1.xyz structure2.xyz -opdb out.pdb --align

Of course, you can change the output format to something else, e.g., xyz, and you can output to multiple files.

babel -ixyz structure1.xyz structure2.xyz -oxyz align.xyz --align -m

Then, you could, for example, load the structures into pymol and view the aligned structures.

Advertisements
chemistry, crystallography, platon, programs, Uncategorized

Platon on macOS Sierra

A while ago, I wrote a post on installing Platon on a Mac. I have just reinstalled Platon on my MacBook Pro, running macOS Sierra, and it works just fine. Check out my earlier post for a more in-depth run down of how to install Platon, but, in brief, the process is this:

  1. Download a copy of XQuartz. (I did this using Homebrew, using ‘brew install Caskroom/cask/xquartz’).
  2. Install gfortran, which is included in gcc. (Again, using Homebrew this is ‘brew install gcc’).
  3. Download the platon.f.gz and xvrdr.c.gz files and (g)unzip them if Safari hasn’t already done so.
  4. In the terminal, go to the folder containing the two previously mentioned files (probably ~/Downloads).
  5. Then, type ‘gfortran -o platon platon.f xdrvr.c -I/opt/X11/include -L/opt/X11/lib -lX11’. Hopefully, this should do its thing and produce an executable file named ‘Platon’.
  6. Move the file somewhere useful, such as /opt.
  7. To make Platon run from anywhere, you have two options: add the folder you have just placed the Platon executable in to the path or make an alias to the executable. To do the first, open up your shell profile or create (i.e., vi .bash_profile or you can open a copy in Textedit, making sure that its in plain text mode, the filename is preceded by a point (.), and the file is saved to your home (i.e., /Users/[your_username])) a profile file (I am using bash) and add ‘PATH=’$PATH:/opt’. To do the second, open up your shell profile and write alias platon=”~/Users/[your_username]/[location_of_platon]”.
  8. Then, quit and reopen terminal and type ‘Platon’ and the program should run.
Uncategorized

Making GIF animations on a Mac.

On a Mac, you can make GIF animations without downloading any additional software. GIFs are useful in presentations or on the web when you need a small file size or low bandwidth option.

To make a GIF, you will need the image frames that you want to animate and Preview, which can be found in the Applications folder. I have made a quick video showing how to do this.

Creating GIFs using Preview on Mac from Benjamin M Ridgway on Vimeo.

However, please note that this will make a GIF that will animate only once. To make your GIF loop endlessly, you can use the image editor GIMP.

Uncategorized

A photo a day from BA: Parroquia Inmaculada Concepcion

A photo a day had to take a (rather long) break recently, due various recent developments, and today’s post is rather short.

Today’s photo is of the Parroquia Inmaculada Concepcion: the church of the immaculate conception, in Belgrano. The church is located at the intersection of Juramento and Cabildo. On this day, there was a artisan’s market in the plaza in front of the church.

Uncategorized

A photo a day from BA: Calle PerĂș.

A series of photos from Buenos Aires.

Calle PerĂș between Hipolito Yrigoyen and Avenida de Mayo.
Calle PerĂș between Hipolito Yrigoyen and Avenida de Mayo.

This is part of Calle PerĂș, or Peru Street. This part of the city is full of historic buildings and is only one block from Plaza de Mayo. The photograph was taken between Avenida de Mayo and Hipolito Yrigoyen. As you can see, there are lots of street vendors selling hats, incense sticks and dried flowers. As is the case for many streets in BA, the street changes its name as it crosses Rivadavia and becomes Florida Street, one of the most famous shopping streets in the city.

There are lots of famous buildings in this historic street. Below is a photo of the Edificio Otto Wulf, at the intersection of PerĂș and Belgrano St. It was home to the Banco de la Provincia de Buenos Aires; now it is home to a Starbucks. It has some rather interesting decorative features, including the rather sombre figures ‘supporting’ the building on their shoulders, and close to the roof the large and rather terrifying vultures.

IMG_7246 IMG_7248

Between Adolfo Alsina and Moreno, almost an entire block is taken up by the Manzana de las Luces (Manzana means apple, but also city block), which means ‘block of lights’. This was home to the Natural Sciences department of the University of Buenos Aires, which is now located at ciudad universitaria. The department was demolished, and now the space is occupied by a parking lot. In 1966, the department was the site of the violent removal of staff and students who were in opposition to the government, an event known as the ‘Noche de los Bastones Largos’ or ‘the Night of the Long Batons’ for the use of batons by the military. One of the most famous photographs of the removal of the professors and students is shown below.

30167_bastones_g

Uncategorized

Recovering your data from OS X

After many years of backing up my data in a somewhat paranoid fashion I have finally succumbed to a failed hard drive. 

My Macbook Pro (August 2013) died a month ago. I live in Argentina, and as I was going back to the UK in July I decided to wait until I had returned in order to take it to the Apple Store. Once there, the Apple Genius booted up my computer and it went straight to the login screen, much to my surprise. Unfortunately, I had forgotten my password ( 😩 ). The Apple technician logged into their diagnostic tools and checked everything out. ‘Great, all fine,’ he said. Happily, I went home and plugged my laptop into the power supply to charge. After about an hour, I turned it on. The grey Apple logo appeared along with a spinning gear and a grey progress bar. The bar very slowly inched up and on reaching the completion the computer turned itself off. Mysterious! I tried three more times to start the computer. Eventually, I logged on to Apple Support Chat and spoke to the very helpful Cynthia. She took me through several steps (that I had initially tried when I first had the problem) to try and solve my problem such as booting into Safe mode (shift while restarted), and resetting the PRAM (command + option + p + r while restarting). Even booting from the recovery partition and attempting to repair the disk failed.

At this point, she told me I should reformat the drive. I had all my work backed up but not my photos. (I always backup my important work via Google Drive, but I had not copied photos as, at that time, I was using the free quota). Also, electronics are incredibly expensive in Argentina, and although at home in the UK I have a 1 Tb Time Capsule, a 500 Gb Seagate drive and two 1 Tb My Book drives, I didn’t take them with me to BA. Not wanting to give up straight away, I did some more Googling.

The best option seemed to boot into ‘Single User Mode’ where a basic shell environment is available. To boot into the mode press command + s while restarting the computer. A command prompt will appear, and you can then check the directories available. My hard drive is still accessible but could not be mounted by Disk Utility from the recovery partition. Firstly I ran fsck to see if the drive could be repaired this time.

fsck -fy

fsck tried valiantly but could not repair the drive. At this point, I attempted to mount the main volume (as it was only available as a read-only volume).

mount -uw /

This command successfully mounted the drive. I had formatted my 500 Gb Seagate hard drive using my Macbook (which is backed up to the Time Capsule) using Mac OS Journaled. You can then use one of the mount scripts in /sbin/ to mount the drive. For example, there is mount_hfs for Mac Journaled filesystems and mount_msdos for MSDOS formatted systems. Before you plug in your USB drive, you can run this command:

ls /dev | grep disk

and then plug the drive in and run it again – several new disks should have appeared. You need to create a mount point for the disk, so I ran

mkdir /Volumes/usb

and then

/sbin/mount_hfs /dev/disk1s3 /Volumes/usb

it took a couple of trial and error attempts to find the correct disk point to mount (in my case disk1s3).

With the drive mounted, I moved to my user directory

cd /Users/username

and then ran rsync to copy the files to the external drive

rsync -av ./* /Volumes/usb/

The computer then spent a couple of hours copying all my data over to the external drive.

My Macbook Pro (August 2013) died a month ago. I live in Argentina and as I was coming back to the UK for July I decided to wait until I returned to take it to the Apple Store. The Apple Genius booted up my computer and it went straight to the login screen, much to my surprise, unfortunately I forgot my password so he logged into the diagnostic tools and check everything out. ‘Great, all fine’, he said. Happily I went home and plugged my laptop in to charge. After about an hour I turned it on. Grey apple logo, spinning gear and grey progress bar. It very slowly inched up this progress bar and on reaching the top the computer turned itself off. I tried three more times eventually I chatted to the very helpful Cynthia at the online Apple Chat Support site. She took me through several steps (that I had initially tried when I first had the problem) such as booting into Safe mode (shift while restarted) and resetting the PRAM (command + option + p + r while restarting) to no avail. Booting into the recovery partition and attempting to repair the disk failed. 

At this point she told me I should reformat the drive. I had all my work backed up but not my photos (I was backup all of my important work via Google Drive but not photos as I was using the free quota and had only recently paid to upgrade to 100 Gb so I hadn’t synced all my photos yet  – also my internet connection in Buenos Aires is very slow (my connection at work is even slower) so it takes an age – electronics are also incredibly expensive and while at home in the UK I have a 1 Tb Time Capsule, a 500 Gb Seagate drive and two 1 Tb My Book drives I didn’t take them with me to BA. Not wanting to give up straight away I did some more Googling. 

The best option seemed to boot into ‘Single User Mode’ where a basic shell environment is available.  To boot into ths mode press command + s while restarting the computer.  A command prompt will appear and you can then check the directories available. My hard drive is still accessible but could not be mounted by Disk Utility from the recovery partition. Firstly I ran fsck to see if the drive could be repaired this time. 

fsck -fy

fsck tried valiantly but could not repair the drive. At this point I attempted to mount the main volume (as it was only available as a read only volume). 

mount -uw /

which successfully mounted the drive. I had formatted my 500 Gb Seagate hard drive using my Macbook (which is backed up to the Time Capsule) using Mac OS Journaled.  You can then use one of the mount scripts in /sbin/ to mount the drive. For example there is mount_hfs for Mac Journaled filesystems and mount_msdos for MSDOS formatted systems. Before you plug in your USB drive you can run 

ls /dev | grep disk

and then plug the drive in and run it again – several new disks should have appeared. You need to create a mount point for the disk so I ran

mkdir /Volumes/usb

and then 

/sbin/mount_hfs /dev/disk1s3 /Volumes/usb

it took a couple of trial and error attempts to find the correct disk point to mount (in my case disk1s3). 

With the drive mounted I moved to my user directory 

cd /Users/username

and then ran rsync to copy the files to the external drive

rsync -av ./* /Volumes/usb/

The computer then spent a couple of hours copying all my data over to the external drive.