Batch X!tandem Search on Linux -cont’d

In the previous post, I explained the method #2 for batch search using X! tandem. In this method, you still have to type file path and file name for all ms/ms data. It only takes a single script to upgrade to method #3, in which the program grabs all spectrum files such as .mgf and create a file containing the path and name in a specified directory.

In Linux, FIND command is used to look for files in a specified directory with a specific string. In this case, you want to find only spectrum files in the directory.  The syntax of the command is

find where-to-look condition what-to-do

Let’s specify where-to-look by
spec_folder=”../../MS_data/073113exp”

Condition is to find files (not directory) with mgf extension.

-type f -name *.mgf

You may not want to look in subdirectory. If so, add

-maxdepth 1

Finally, you write the file names in file_name.txt using “>”.  So final script looks like

find $spec_folder -maxdepth 1 -type f -name *.mgf > file_name.txt

In summary to run batch X!tandem search on linux,

1) Put all spectrum files in one directory
2) Edit the first line of the program to specify the directory
3) Edit default_input.xml (if you want to change modifications, error tolerance etc)
4) Edit input.xml (if you want to change species)
5) Edit taxonoy.xml (if you need to add databases)
6) Execute the program (make sure it is executable and place in the same directory as tandem.exe)

Did it work? I hope so!

Final code can be downloaded here.

About bioinfomagician

Bioinformatic Scientist @ UCLA

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: