Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • semna
    Member
    • Apr 2010
    • 55

    perl question?????

    Hi
    I am a new one in perl programming.Does anyone know perl script for running clustalw bye emma??
    Thanks in advance
  • krobison
    Senior Member
    • Nov 2007
    • 734

    #2
    Google knows all, Google tells all.

    Comment

    • semna
      Member
      • Apr 2010
      • 55

      #3
      thanks.but my problem is actually I am a new user and difficult to figure out what it means!!!

      Comment

      • Thorondor
        Member
        • Feb 2011
        • 69

        #4
        for us it's difficult to get an idea, what your problem is. Give us more details about what you want to do and why you need a perl script for that ......

        Comment

        • semna
          Member
          • Apr 2010
          • 55

          #5
          I want to multiple sequence alignment and I have to use perl script and use clustal w for this purpose.Now for exapmle found something but I have a problem to sure that clustal w installed at executable or not?

          1. Make sure bioperl-run in installed in addition to BioPerl.
          2. Make sure clustalw is installed at executable
          3. Set path using the following command (assuming that clustalw is installed at /usr/local/bin/clustalw2):
          export CLUSTALDIR=/usr/local/bin/clustalw2

          #!/usr/bin/perl
          use Bio::AlignIO;
          use Bio::Root::IO;
          use Bio::Seq;
          use Bio::SeqIO;
          use Bio::SimpleAlign;
          use Bio::TreeIO;

          BEGIN { $ENV{CLUSTALDIR} = '/usr/local/bin/clustalw2/' }
          use Bio::Tools::Run::Alignment::Clustalw;

          # Build a clustalw alignment factory
          @params = ('ktuple' => 2, 'matrix' => 'BLOSUM');
          $factory = Bio::Tools::Run::Alignment::Clustalw->new(@params);

          # Pass the factory a list of sequences to be aligned.
          $inputfilename = 'blastdump/input.fasta';
          $aln = $factory->align($inputfilename); # $aln is a SimpleAlign object.
          # or
          $seq_array_ref = \@seq_array;
          # where @seq_array is an array of Bio::Seq objects
          $aln = $factory->align($seq_array_ref);

          # Or one can pass the factory a pair of (sub)alignments
          #to be aligned against each other, e.g.:
          $aln = $factory->profile_align($aln1,$aln2);
          # where $aln1 and $aln2 are Bio::SimpleAlign objects.

          # Or one can pass the factory an alignment and one or more unaligned
          # sequences to be added to the alignment. For example:
          $aln = $factory->profile_align($aln1,$seq); # $seq is a Bio::Seq object.

          # Get a tree of the sequences
          $tree = $factory->tree(\@seq_array);

          # Get both an alignment and a tree
          ($aln, $tree) = $factory->run(\@seq_array);

          # Do a footprinting analysis on the supplied sequences, getting back the
          # most conserved sub-alignments
          my @results = $factory->footprint(\@seq_array);
          foreach my $result (@results) {
          print $result->consensus_string, "\n";
          }

          # There are various additional options and input formats available.
          # See the DESCRIPTION section that follows for additional details.

          Comment

          • krobison
            Senior Member
            • Nov 2007
            • 734

            #6
            Well, for a beginner it looks like you have a good start -- but what is the symptoms of your problem? What error do you get?

            One simple test that might help would be to add the code
            Code:
            unless ( -f "$ENV{'CLUSTALDIR'}/clustalw")
            {
              die "Can't find ClustalW executable\n"
            }
            (though check whether clustalw is indeed in that directory, or perhaps a /bin directory under it)

            In this context, you don't need the BEGIN block around the environment variable setting (though it doesn't hurt).

            Also, I am a strong believer in starting with "use strict" early -- you'll catch a lot of otherwise frustrating bugs. Every variable needs to then be prefixed with "my "

            Comment

            • semna
              Member
              • Apr 2010
              • 55

              #7
              Hi krobison,
              I used your advice but still I have this error:

              Can't locate Bio/Tools/Run/Alignment/Clustalw.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.12.1/i586-linux-thread-multi /usr/lib/perl5/site_perl/5.12.1 /usr/lib/perl5/vendor_perl/5.12.1/i586-linux-thread-multi /usr/lib/perl5/vendor_perl/5.12.1 /usr/lib/perl5/5.12.1/i586-linux-thread-multi /usr/lib/perl5/5.12.1 .) at clu.pl line 16.
              BEGIN failed--compilation aborted at clu.pl line 16.

              I know that is because of my location of clustal w, but I don't know how can tranfer it to my path. First I used wget and the link of clustal x and now its in my home directory but not work.thanks

              Comment

              • krinard
                Junior Member
                • Jan 2011
                • 2

                #8
                Two ways:

                1)
                Add this line to the very top of your code: use lib 'path/to/install/location/of/BioTools'

                2) Or, at the command prompt:
                export PERL5LIB='path/to/install/locations/of/BioTools:$PERL5LIB
                (or you can add to your .bashrc to make permanent; not just for this login)

                Comment

                • Thorondor
                  Member
                  • Feb 2011
                  • 69

                  #9
                  seems like your perl module is not correctly installed.
                  You did it that way http://www.cpan.org/modules/INSTALL.html ?

                  edit: kinrads post helps more. ;-) didnt see it till i posted this one. well done.
                  Last edited by Thorondor; 02-23-2011, 07:03 AM.

                  Comment

                  • anikng
                    Member
                    • Aug 2013
                    • 14

                    #10
                    Hi Forum Members..

                    For Multiple sequence alignment purpose, I installed Bioperl (Wndows 7).But when i use a simple code for MSA, its shows error
                    "align is not recognized as internal or external command..etc etc.
                    MSG clustalw call...So, kindly suggest me if anyone know the issue..


                    anikng,
                    seoul

                    Here is my code,
                    #!/usr/bin/perl



                    use Bio::Seq;
                    use Bio::Tools::Run::Alignment::Clustalw;


                    BEGIN { $ENV{CLUSTALDIR} = 'c:/CLUSTALW2/' }


                    @params = ('ktuple' => 2, 'matrix' => 'BLOSUM');
                    $factory = Bio::Tools::Run::Alignment::Clustalw->new(@params);
                    $inputfilename = 'C:/Users/Anil/Desktop/1.txt';
                    $aln = $factory->align($inputfilename);
                    print "working";

                    Comment

                    Latest Articles

                    Collapse

                    • SEQadmin2
                      Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
                      by SEQadmin2


                      Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

                      The systematic characterization of the human proteome has
                      ...
                      07-20-2026, 11:48 AM
                    • SEQadmin2
                      Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
                      by SEQadmin2



                      Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
                      ...
                      07-09-2026, 11:10 AM
                    • SEQadmin2
                      Cancer Drug Resistance: The Lingering Barrier to Rising Survival
                      by SEQadmin2



                      Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.

                      There is no single reason why many patients don’t respond to treatment as expected. Cancer is...
                      07-08-2026, 05:17 AM

                    ad_right_rmr

                    Collapse

                    News

                    Collapse

                    Topics Statistics Last Post
                    Started by SEQadmin2, 07-24-2026, 12:17 PM
                    0 responses
                    34 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 07-23-2026, 11:41 AM
                    0 responses
                    25 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 07-20-2026, 11:10 AM
                    0 responses
                    217 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 07-13-2026, 10:26 AM
                    0 responses
                    81 views
                    0 reactions
                    Last Post SEQadmin2  
                    Working...