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
            Beyond CRISPR/Cas9: Understand, Choose, and Use the Right Genome Editing Tool
            by SEQadmin2



            CRISPR/Cas9 sparked the gene editing revolution for both research and therapeutics.1 But this system still showed severe issues that limited its applications. The most prominent were the heavy reliance on PAM sequences, delivery limitations, double-stranded breaks that prompt unintended edits and cell death, and editing inefficiency (both in targeting and in knock-in reliability).

            Despite this, “CRISPR helped turn genome editing from a specialized technique into
            ...
            07-31-2026, 11:01 AM
          • 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

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by SEQadmin2, Yesterday, 10:13 AM
          0 responses
          13 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 07-31-2026, 02:55 AM
          0 responses
          26 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 07-24-2026, 12:17 PM
          0 responses
          20 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 07-23-2026, 11:41 AM
          0 responses
          19 views
          0 reactions
          Last Post SEQadmin2  
          Working...