Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • seqmonkey
    Junior Member
    • Sep 2011
    • 4

    #1

    Question regarding CASAVA output files

    Quick question regarding the output files after CASAVA converts them to fastq (from BCL).

    We have data from several lanes, and each lane has its own folder (e.g. Project_FC/Sample_lane1 followed by Sample_lane2, etc...).

    In each folder, there are several files. The data is paired reads, so we have R1 and R2 for read 1 and read 2 respectively. However, CASAVA splits each read into separate fastq files numbered sequentially, e.g.:
    lane1_NoIndex_L001_R1_001.fastq
    lane1_NoIndex_L001_R1_002.fastq
    lane1_NoIndex_L001_R1_003.fastq
    lane1_NoIndex_L001_R1_004.fastq
    lane1_NoIndex_L001_R1_005.fastq
    lane1_NoIndex_L001_R1_006.fastq
    lane1_NoIndex_L001_R1_007.fastq
    lane1_NoIndex_L001_R1_008.fastq
    lane1_NoIndex_L001_R1_009.fastq

    So in this case, going from 001 to 009. In other lanes, it might go from 001 to 011, and so on. Do you know why the fastq files were split up? Is it purely due to the large file size (and if so, can they simply be "cat" together)?

    Thanks!
  • kmcarr
    Senior Member
    • May 2008
    • 1181

    #2
    Yes, CASAVA splits them up solely to limit the size of the files. It is primarily done because Illumina's alignment program, Eland, can't deal with larger data sets well. And yes you can simply cat them together. It is possible to simply cat together the gzipped files; some programs will work fine with those but others won't. To be completely safe you should unzip | concatenate | gzip. You can do this all in a single unix pipe

    Code:
    zcat lane1_NoIndex_L001_R1_00?.fastq.gz | gzip > lane1_NoIndex_L001_R1.fastq.gz
    Do likewise for each read from each lane.

    Comment

    • simonandrews
      Simon Andrews
      • May 2009
      • 870

      #3
      It it's any help to anyone the script below can be used to concatenate and filter all of the fastq files from a Casava 1.8 run in one go. You just pass it the full list of all fastq files:

      eg: combine_fastq [run_folder]/Unaligned/Project*/Sample*/*fastq.gz

      Code:
      #!/usr/bin/perl
      use warnings;
      use strict;
      
      my @files = @ARGV;
      
      my @groups = group_files(@files);
      
      foreach my $group (@groups) {
      
          warn "Writing to ".$group->{name}."\n";
      
          open OUT, '>', $group->{name} or die "Can't write to ".$group->name().$!;
      
          foreach my $file (@{$group->{files}}) {
      
      	warn "Filtering $file\n";
      	
      	open (IN,"zcat $file |") or die "Can't read from $file: $!";
      
      	while (<IN>) {
      	    if (/:Y:/) {
      		$_ = <IN>;
      		$_ = <IN>;
      		$_ = <IN>;
      	    }
      	    else {
      		print OUT;
      		print OUT scalar <IN>;
      		print OUT scalar <IN>;
      		print OUT scalar <IN>;
      	    }
      	}
          }
      
          close OUT or die "Failed to write to ".$group->{name}.":$!";
      
          warn "Compressing ".$group->{name}."\n";
      
          system("gzip ".$group->{name}) == 0 or die "Failed to compress ".$group->{name}."\n";
      }
      
      sub group_files {
          my @files = @_;
      
          my %groups;
      
          foreach my $file (@files) {
      
      	my $basename = $file;
      
      	$basename =~ s/_\d{3}\.fastq.gz$/.fastq/;
      
      	if ($basename eq $file) {
      	    warn "'file' didn't look like a casava file\n";
      	}
      
      	unless (exists $groups{$basename}) {
      	    $groups{$basename} = {name => $basename};
      	}
      
      	push @{$groups{$basename}->{files}},$file;
      
          }
      
          return values %groups;
      
      }

      Comment

      • Howie Goodell
        Member
        • Feb 2010
        • 10

        #4
        Related warning: trying to avoid the need to combine files with a large value of --fastq-cluster-count causes CASAVA 1.8 BCL conversion/demultiplexing -- not just ELAND -- to silently and unpredictably lose data. So I use simonandrew's approach of filtering files together. Remember to include undetermined_indices files from lanes that weren't actually multiplexed (or omit such indexes from SampleSheet.csv).

        Comment

        • kmcarr
          Senior Member
          • May 2008
          • 1181

          #5
          Originally posted by Howie Goodell View Post
          Related warning: trying to avoid the need to combine files with a large value of --fastq-cluster-count causes CASAVA 1.8 BCL conversion/demultiplexing -- not just ELAND -- to silently and unpredictably lose data. So I use simonandrew's approach of filtering files together. Remember to include undetermined_indices files from lanes that weren't actually multiplexed (or omit such indexes from SampleSheet.csv).
          Could you please explain this a little more. How did you discover that data was lost?

          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
            ...
            Today, 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, Today, 02:55 AM
          0 responses
          7 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 07-24-2026, 12:17 PM
          0 responses
          12 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 07-23-2026, 11:41 AM
          0 responses
          12 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 07-20-2026, 11:10 AM
          0 responses
          24 views
          0 reactions
          Last Post SEQadmin2  
          Working...