Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mmmm
    Senior Member
    • Jul 2013
    • 131

    #1

    shuffleSequences_fastq.pl

    I am using the perl script (shuffleSequences_fastq.pl) to prepare the intervaled fastq file for velvet and I got the first read in read1 followed by the first read in read2 BUT then I got 3 different reads of reads 2 followed by their correspondence in read1 and so on- I was wondering if this ok or is this below script right?
    a read1
    a read2
    b read1
    b read2
    c read2
    d read2
    c read1
    d read1 and so on

    shuffleSequences_fastq.pl


    #!/usr/bin/perl

    if (!@ARGV) {
    print "Usage: $0 forward_reads.fa reverse_reaads.fa outfile.fa\n";
    print "\tforward_reads.fa / reverse_reads.fa : paired reads to be merged\n";
    print "\toutfile.fa : outfile to be created\n";
    system.exit(0);
    }

    $filenameA = $ARGV[0];
    $filenameB = $ARGV[1];
    $filenameOut = $ARGV[2];

    die "Could not open $filenameA" unless (-e $filenameA);
    die "Could not open $filenameB" unless (-e $filenameB);

    open FILEA, "< $filenameA";
    open FILEB, "< $filenameB";

    open OUTFILE, "> $filenameOut";

    my ($lineA, $lineB);

    $lineA = <FILEA>;
    $lineB = <FILEB>;

    while(defined $lineA) {
    print OUTFILE $lineA;
    $lineA = <FILEA>;
    while (defined $lineA && $lineA !~ m/>/) {
    print OUTFILE $lineA;
    $lineA = <FILEA>;
    }

    print OUTFILE $lineB;
    $lineB = <FILEB>;
    while (defined $lineB && $lineB !~ m/>/) {
    print OUTFILE $lineB;
    $lineB = <FILEB>;
    }
    }
  • mastal
    Senior Member
    • Mar 2009
    • 666

    #2
    If you use a recent version of velvet, you don't need to use the shuffleSequences scripts, you can leave the reads as 2 separate files and use the flag '-separate' when running velveth.

    I have used the shuffleSequences_fastq.pl script that comes with velvet in the past, and never had any problems.

    It is not OK if your files don't interleave properly, you will have problems with the assembly or alignment programs further downstream.

    Comment

    • mastal
      Senior Member
      • Mar 2009
      • 666

      #3
      Are you trying to interleave fasta files or fastq files?

      If it is fastq files, your script won't work because the header lines for each read should begin with '@'.

      Change the two lines with the regular expressions.

      Change:
      Code:
      while (defined $lineA && $lineA !~ m/>/) {
      to
      Code:
      while (defined $lineA && $lineA !~ m/^@/) {

      Comment

      • mmmm
        Senior Member
        • Jul 2013
        • 131

        #4
        thank you very much- also, I should change
        while (defined $lineB && $lineB !~ m/>/)
        to
        while (defined $lineB && $lineB !~ m/^@/)

        Comment

        • SES
          Senior Member
          • Mar 2010
          • 275

          #5
          Originally posted by mmmm View Post
          thank you very much- also, I should change
          while (defined $lineB && $lineB !~ m/>/)
          to
          while (defined $lineB && $lineB !~ m/^@/)
          I wouldn't edit the script for fasta files, instead just use the script designed for fastq. You can find the script on the velvet github site. This assumes 4 line fastq. You can try Pairfq (documentation) for a more flexible solution (reading multiline fasta/q, compressed/uncompressed), but you may want to start with trying the script distributed with velvet.
          Last edited by SES; 04-03-2014, 01:53 AM.

          Comment

          Latest Articles

          Collapse

          • SEQadmin2
            Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
            by SEQadmin2



            Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

            Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
            ...
            10-14-2026, 09:55 AM
          • SEQadmin2
            New Genomics Technologies Take Aim at Long-Standing Limits
            by SEQadmin2


            Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

            We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
            ...
            09-28-2026, 10:25 AM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by SEQadmin2, Yesterday, 11:13 AM
          0 responses
          16 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, Yesterday, 10:48 AM
          0 responses
          17 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-15-2026, 10:52 AM
          0 responses
          35 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-14-2026, 05:39 AM
          0 responses
          42 views
          0 reactions
          Last Post SEQadmin2  
          Working...