Download a simple perl script

From BITS wiki
Jump to: navigation, search
Go back to parent page Introduction to Linux for bioinformatics

Intro

Many bioinformatics programs are written in python or perl. It's quick to type some python or perl code in a text file, and get your job done.

Those scripts are text files. You can download and store scripts on your computer. Usually these files have .py or .pl extension. As long as you have python or perl on your system (by default in Linux!), you can run the scripts.

Run perl code

Let's try a small script below.

  1. Download a simple perl script from http://data.bits.vib.be/pub/trainingmaterial/introduction_to_linux_for_bioinformatics/motifs_new.pl
  2. Download the dna file from http://data.bits.vib.be/pub/trainingmaterial/introduction_to_linux_for_bioinformatics/dna.txt
  3. Open Geany on your computer, and copy the script code to Geany.

Openperlscriptwithgeany.jpg

  • Save the file, under ~/Downloads for now.


  • Execute the script by clicking the little 'gear' box. For this script, you will need to download the dna.txt file as input.

Runperlscriptingeany.jpg

  • The results of the script appear in a small window. It will ask for an input (depending on your script). Enter the required details.

Resultsperlscriptingenany.jpg

Scripting is covered in other BITS training sessions as well. Check them out in the Training session of this wiki.

Go back to parent page Introduction to Linux for bioinformatics