Question: BioPerl/Linux basic and programming
gravatar for travelinriyadh257
4.6 years ago by
Saudi Arabia
travelinriyadh25770 wrote:

Dear All,

I've just installed Bioperl. I am completely new to such kinds of software. I have few questions:

  1. How to inform Bioperl that my fasta file is in a specific location and to use it for restriction digestions or to use it for Blast or other functions. (I am using Bioperl for windows 7). 
  2. How to make a script file in Linuix. I mean in windows, I can open notepad and save the file as Now, in Linux, how to save the file with such extension. Or it is not necessary and Linux identify it.
  3. Last and very important to me, can anyone kindly inform me how to extract specific sequences from a fasta file saved on my hard disk and from a certain start position to a specific end position and save it as text or Excel file using Bioperl. I have a list (file in Excel) of predicted genes from a bacterial genome.

Thank you.




bioperl fasta • 2.0k views
ADD COMMENTlink modified 4.6 years ago • written 4.6 years ago by travelinriyadh25770

Dear Michael,

Thanks a lot for your kind and quick response. Many thanks too for the quick and clear advise regarding Linux.

Just I wish to add that I already went to the mentioned website but (it might be my own problem), it does not give clear working example. I am just starting Linux/Unix programs and thus it took me ages to understand how things go. For Biochemists/Biologists, might be better, to kindly demonstrate things in a clear simple way (with videos, if possible).

It just give a sample script. It is better if they kindly provide a complete working exmple (like for example what happen if you watched any Lynda videos).

Best regards,



ADD REPLYlink written 4.6 years ago by travelinriyadh25770

I can give you a little example, but it would be easier if you could also define more specifically what the actual problem is. This is best done by showing what you have already tried with an example script. There are for sure video tutorials on BioPerl if you like this approach, they might have advantages, a clear disadvantage is that you cannot just copy-paste code directly from the video.

ADD REPLYlink written 4.6 years ago by Michael Dondrup45k
gravatar for Michael Dondrup
4.6 years ago by
Bergen, Norway
Michael Dondrup45k wrote:

I suggest to go through a number of tutorials first to answer your question yourself:

1. e.g.: 

2. any basic Linux tutorial (this question part is off-topic for this site, short answer: suffix has no relevance (only for you))

3. use method subseq on Bio::Seq objects:

Here is a little example script (all information is also found in the documentation), what to do further on depends on a more exact description of the problem:


    /usr/bin/env perl
    use strict;
    use warnings;

    use Bio::SeqIO;

    # This is the main sequence object in Bioperl
    # gets a sequence from a file
    my $seqio  = Bio::SeqIO->new( '-format' => 'fasta' , -file => '/home/joeuser/myfile.fasta');

    while (my $seqobj = $seqio->next_seq()) {

       # gets sequence as a string from sequence object
       my $seqstr   = $seqobj->subseq(10,50); # slice in biological coordinates

             ### do something with seqstring



ADD COMMENTlink modified 4.6 years ago • written 4.6 years ago by Michael Dondrup45k
gravatar for travelinriyadh257
4.6 years ago by
Saudi Arabia
travelinriyadh25770 wrote:

Dear Michael,

Again, that is too kind from you. I know that I should do my homework first before starting complaining. And that I am also responsible for my own problem. I just was expecting more simple and educational way for teaching Bioperl to beginners (or even less than this).

The project I am working on: is that to search one bacterial genome for predicted genes, then to isolate that predicted genes and locations with their sequences and their positions. So, it seems that I need to know how to download, save, fetch back that file, and run the scripts to extract the sequences.

Thanks for your support and I am very sorry for the long response.




ADD COMMENTlink written 4.6 years ago by travelinriyadh25770
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2370 users visited in the last hour