Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • lew13
    Junior Member
    • Aug 2009
    • 2

    Reorganize unaligned read output

    Hello all.

    I am using Mosaik to align an Illumina read dataset to a reference genome. The total DNA used in Illumina sequencing included DNA from more than one organism, so I would like to try a Velvet de novo assembly with the unaligned reads that Mosaik dumped into a fastq file. Our read data is paired end, which should help our de novo assembly, but Mosaik doesn't retain the paired end information when dumping reads to the fastq file.

    Does anyone have a script for reorganizing a fastq file into a Velvet-acceptable order? (i.e., Read 1 from a pair is followed by Read 2, then Read 1 and Read 2 from another pair, etc.)

    Thank you,
    Laura Williams
  • lew13
    Junior Member
    • Aug 2009
    • 2

    #2
    revised request

    Follow-up to my previous post.

    After a closer inspection of the Mosaik unaligned reads output, I see that pairs of reads are kept together. Unfortunately, now the problem is that I have paired reads and single (orphaned) reads in the same unaligned reads file. I'd like to input the paired reads into Velvet for a de novo assembly. Does anyone have any advice for how to easily remove the orphaned reads from my unaligned reads file?

    Thanks,
    Laura

    Comment

    • krobison
      Senior Member
      • Nov 2007
      • 734

      #3
      If paired reads are "next" to each other in the file (i.e. always first one than the other), then a little bit of Perl/Python etc can easily do this.

      It is likely that trying to read all the reads into memory at once will blow out your memory if you have many reads.

      What you want to do is cache the current read. If the next read is from the same fragment, output both. Either way, the current read now becomes the cached read.

      I haven't used Mosaik; if it writes the unaligned sequences to a FASTQ file, then BioPerl has all the routines left unwritten below (though not necessarily with my names!)

      Code:
      #!/usr/bin/perl
      ## not nearly a complete perl program
      use strict;
      
      my $cachedRead=undef
      
      # here's the incomplete part: need to write an object to open unaligned reads file
      # and report one read each time nextRead() is called; return undef if end-of-file)
      
      # also each read is an object with a fragmentId() method (returns fragmentId)
      # and a writeRead() method (writes read back to STDOUT or a waiting filehandle)
      
      while (my $currRead=$reader->nextRead())
      {
        last if (!defined $currRead);  ## if not defined, end-of-file reached
        if (defined $cachedRead && $cachedRead->fragmentId() eq $currRead->fragmentId())
         {
           $cachedRead->writeRead();
           $currRead->writeRead()
        }
        $cachedRead=$currRead;
      }

      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-20-2026, 11:10 AM
      0 responses
      14 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-13-2026, 10:26 AM
      0 responses
      31 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-09-2026, 10:04 AM
      0 responses
      42 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-08-2026, 10:08 AM
      0 responses
      28 views
      0 reactions
      Last Post SEQadmin2  
      Working...