Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • loba17
    Member
    • Sep 2011
    • 19

    #1

    Illumina Fastq Header Search

    Dear All,

    I would like to retrieve sequences (fastq format) from an Illumina fastq data file using the first part of the sequence header.

    Example of a Illumina fastq header:
    @X01032:109:000000000-AGKF7:1:1101:11950:1779 1:N:0:1

    My query:
    @X01032:109:000000000-AGKF7:1:1101:11950:1779

    I tried usearch (fastx_getseqs), seqtk, and seqret but nothing works because of the special characters (e.g. ":","-") in the header. A simple grep like

    Code:
    grep "@X01032:109:000000000-AGKF7:1:1101:11950:1779" -A 3 in.fastq
    would work but it would take a long time to finish. I could reformat the headers but I prefer not to (if possible).

    Is there a tool out there that would work with Illumina fastq files?

    Thanks for the help!
  • Brian Bushnell
    Super Moderator
    • Jan 2014
    • 2709

    #2
    You can do that with "filterbyname.sh" in the BBMap package.

    filterbyname.sh in=reads.fq out=filtered.fq include=t names=names.txt

    ...where names.txt has 1 name per line. Or, you can say "names=X01032:109:000000000-AGKF7:1:1101:11950:1779" instead. This program will include reads that have non-matching stuff after the first whitespace. You should not include the leading "@" in the query, as it is not part of the name. But, if you do include the leading @ for whatever reason, then add the flag "truncateheadersymbol".

    Comment

    • loba17
      Member
      • Sep 2011
      • 19

      #3
      Works - problem solved!

      Dear Brian,

      thanks for your suggestion!

      I downloaded bbmap and I tried filterbyname.sh

      Code:
      filterbyname.sh in=in.fq out=out.fq names=select.list include=t truncateheadersymbol
      
      Input is being processed as unpaired
      Time:               53.202 seconds.
      Reads Processed:    5747570 	108.03k reads/sec
      Bases Processed:    2296943848 	43.17m bases/sec
      Reads Out:          65246
      Bases Out:          25944173
      Number of reads for in.fq: 5,747,570
      Number of headers selected: 66,182
      Number of reads for out.fq: 65,246

      Works great and I really like the output summary!

      Question 1: Is there a way (setting) to get a list of the records that did not match?

      Question 2: bbmap seems to be a nice and very useful collection of tools - thanks a lot! - but is there an overview or a summary that would describe the tools briefly.

      Thanks for the help !

      Comment

      • GenoMax
        Senior Member
        • Feb 2008
        • 7142

        #4
        Originally posted by loba17 View Post
        Question 2: bbmap seems to be a nice and very useful collection of tools - thanks a lot! - but is there an overview or a summary that would describe the tools briefly.

        Thanks for the help !
        See this thread for a recap of many things BBMap can do: http://seqanswers.com/forums/showthread.php?t=58221

        I would suggest trying outu=filename with your command to see if that captures reads that did not match.

        Comment

        • Brian Bushnell
          Super Moderator
          • Jan 2014
          • 2709

          #5
          Originally posted by GenoMax View Post
          I would suggest trying outu=filename with your command to see if that captures reads that did not match.
          You know, to be consistent, I should really add that (I'll make a note to do so)! Unfortunately filterbyname does not currently capture outu. Instead, you need to run it twice, with "include=t" to capture the matching reads, and "include=f" to capture the nonmatching reads.

          Comment

          • loba17
            Member
            • Sep 2011
            • 19

            #6
            Thanks

            Dear Brian, thanks for the clarification and the help.

            Comment

            • maubp
              Peter (Biopython etc)
              • Jul 2009
              • 1544

              #7
              My Python script with a Galaxy interface:
              Galaxy tools and wrappers for sequence analysis. Contribute to peterjc/pico_galaxy development by creating an account on GitHub.

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