This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How (and where) to learn the basics of Bioperl?

Dear Mr./Mrs.,

I would like to learn how to write my own script in Bioperl. For example, I found the following script on some website to extract header fasta from fasta file:

#!/bin/env perl
use strict;
use warnings;
use Bio::SeqIO;

my $seq_in  = Bio::SeqIO->new( -file => 'seq.txt',   '-format' => 'Fasta' );
my $seq_out = Bio::SeqIO->new( -file => '>output.fas', '-format' => 'Fasta' );

while ( my $seq = $seq_in->next_seq ) {
    my $shortened_seq = Bio::Seq->new(
        -desc       => $seq->desc,
        -display_id => ( split /\|/, $seq->id )[-1]
    );

    $seq_out->write_seq($shortened_seq);
}

I wish to know why these characters are used. Why adding spaces. Why these arguments were used. (Why writing [-1]). So that I can create/invent a different approach. If it is already known to everyone, then pardon my ignorance. Kindly, if you can, provide a link so that I can follow it.

Best regards,
Mohamed

bioperl perl

Dear Pierre and medhat,

Many thanks for your kind and quick response. I will do as suggested. About learning Python, it will be a great opportunity to start learning it. However, I do believe that I'm not that talent to understand two languages. I only wish to focus on bioinformatics tools. But I guess your recommendation sound good. I will see and try it IN SHAA ALLAH.

Best regards,
Mohamed

1 answer

Hi and welcome,

First as suggested in the comment you should begin with Perl that will be much easier because you will learn the syntax,

so you can begin with this post here

A: How To Initiate Learning Perl?

Interactive Perl Learning

and It will cover both learning Perl and bioperl.

a way from this I have an advice for you If you are totally beginner and you just want to learn any programming language I highly recommend you to learn Python instead of Perl for different reasons,I will say it if you accept the suggestion :)

yup ! +1 for Python. On top it has smaller learning curve.

Trust me, people achieved the goal of bioinformatic analysis using Perl for many years before Python became the golden child. I'm not arguing for or against either of them, but I think many students completely lack any historical context.

I totally agree I am a Java programmer not python one, so Java teaches you many discipline from syntax and hard coding and of course OOP, But as you know for small tasks I think I do not need to right classes and overload methods I will simply use python but with out my background really I would be lost in understanding the programming paradigm, So what is you suggestion for new comers to programming field?

Log in to answer this question.