Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • perl question?????

    Hi
    I am a new one in perl programming.Does anyone know perl script for running clustalw bye emma??
    Thanks in advance

  • #2
    Google knows all, Google tells all.

    Comment


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

      Comment


      • #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


        • #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


          • #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


            • #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


              • #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


                • #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


                  • #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

                    • seqadmin
                      Recent Advances in Sequencing Analysis Tools
                      by seqadmin


                      The sequencing world is rapidly changing due to declining costs, enhanced accuracies, and the advent of newer, cutting-edge instruments. Equally important to these developments are improvements in sequencing analysis, a process that converts vast amounts of raw data into a comprehensible and meaningful form. This complex task requires expertise and the right analysis tools. In this article, we highlight the progress and innovation in sequencing analysis by reviewing several of the...
                      05-06-2024, 07:48 AM
                    • seqadmin
                      Essential Discoveries and Tools in Epitranscriptomics
                      by seqadmin




                      The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist...
                      04-22-2024, 07:01 AM

                    ad_right_rmr

                    Collapse

                    News

                    Collapse

                    Topics Statistics Last Post
                    Started by seqadmin, 05-14-2024, 07:03 AM
                    0 responses
                    17 views
                    0 likes
                    Last Post seqadmin  
                    Started by seqadmin, 05-10-2024, 06:35 AM
                    0 responses
                    40 views
                    0 likes
                    Last Post seqadmin  
                    Started by seqadmin, 05-09-2024, 02:46 PM
                    0 responses
                    50 views
                    0 likes
                    Last Post seqadmin  
                    Started by seqadmin, 05-07-2024, 06:57 AM
                    0 responses
                    41 views
                    0 likes
                    Last Post seqadmin  
                    Working...
                    X