Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • lindseyjane
    Member
    • Apr 2009
    • 28

    BFAST input format for paired end reads

    I would like to know what I should do to input paired end reads to the BFAST software. The script provided, qseq2fastq.pl requires qseq files but I only have the sequence files from the Illumina machine named
    e.g.
    s_1_1_sequence.txt containing reads from 1st read in lane 1
    s_1_2_sequence.txt containing reads from 2nd read in lane 1

    I can easily convert to fastq using maq sol2sanger, but I understand that the BFAST FASTQ format is different from the standard FASTQ. The manual states it requires the pairs to be listed in order of 5' to 3' and on the same strand. It also requires them to have the same name whereas at the moment they have the same names but slightly different suffixes of #0/1 for read 1 and #0/2 for read 2.

    Does anyone know a quick way to get my reads into the right format? Thanks
  • maubp
    Peter (Biopython etc)
    • Jul 2009
    • 1544

    #2
    Just to clarify - you want to interleave the two paired FASTQ files (F1,F2,F3,... and R1,R2,R3,...) into one file where they alternate (F1,R1,F2,R2,F3,R3,...) but also remove the "/1" and "/2" suffices on the forward and reverse read identifiers to make them the same?

    I'd write a script to do this in your language of choice (e.g. Perl perhaps with BioPerl, or Python with Biopython, etc).

    Comment

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

      #3
      If you like Python, you could try something like this (untested):

      HTML Code:
      #This Python script requires Biopython 1.51 or later
      from Bio import SeqIO
      import itertools
      
      #Setup variables (could parse command line args instead)
      file_f = "s_1_1_sequence.txt"
      file_r = "s_1_2_sequence.txt"
      file_out = "interleaved.fastq"
      
      def interleave(iter1, iter2) :
          for (forward, reverse) in itertools.izip(iter1,iter2):
              assert forward.id.endswith("/1")
              assert reverse.id.endswith("/2")
              #Remove the /1 and /2 from the identifiers,
              forward.id = forward.id[:-2]
              reverse.id = reverse.id[:-2]
              assert forward.id == reverse.id
              yield forward
              yield reverse
      
      records_f = SeqIO.parse(open(file_f,"rU"), "fastq-illumina")
      records_r = SeqIO.parse(open(file_r,"rU"), "fastq-illumina")
      
      handle = open(file_out, "w")
      count = SeqIO.write(interleave(records_f, records_r), handle, "fastq-sanger")
      handle.close()
      print "%i records written to %s" % (count, file_out)
      Based on the Biopython example here:


      Note - I'm assuming you have Illumina 1.3+ FASTQ files, not Solexa style FASTQ files. See http://en.wikipedia.org/wiki/FASTQ_format and http://nar.oxfordjournals.org/cgi/co...stract/gkp1137 or for search the forum for details.
      Last edited by maubp; 12-16-2009, 07:18 AM. Reason: Adding link

      Comment

      • lindseyjane
        Member
        • Apr 2009
        • 28

        #4
        ok, thanks, I am learning to use perl, not familiar with python, so I will write a script to do this in perl.

        Just to clarify, do you know whether I need to alter the reverse read to make the sequence on the same strand as the forward read?

        eg if I have in the sequence.txt file
        Forward read AAAATTT
        Reverse read CCGGGG

        I need to interleave them as:
        AAAATTT
        CCCCGG
        is this correct?

        Comment

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

          #5
          Originally posted by lindseyjane View Post
          ok, thanks, I am learning to use perl, not familiar with python, so I will write a script to do this in perl.
          Fair enough - you may find BioPerl helpful, it has built in FASTQ support.
          Originally posted by lindseyjane View Post
          Just to clarify, do you know whether I need to alter the reverse read to make the sequence on the same strand as the forward read?
          Maybe. I haven't used BFAST so don't know. It shouldn't be too hard to do it if required. Again, BioPerl will have built in reverse complement code, but don't forget to reverse the qualities too.

          Comment

          • lindseyjane
            Member
            • Apr 2009
            • 28

            #6
            Thanks for all your help and rapid responses to my queries

            Comment

            Latest Articles

            Collapse

            • mylaser
              Reply to Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
              by mylaser
              Kheloyaar: The Complete Guide to Kheloyaar Loginand Kheloyaar ID
              The online gaming industry has transformed the way people enjoy digital entertainment. As technology continues to improve, players are looking for platforms that offer convenience, security, and a seamless user experience. Kheloyaarhas gained attention among users who value an easy-to-use platform, quick account access, and a simple registration process.
              Whether you're exploring Kheloyaar for the first time or want to understand...
              Yesterday, 09:27 PM
            • 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.
              ...
              Yesterday, 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, Yesterday, 10:04 AM
            0 responses
            8 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 07-08-2026, 10:08 AM
            0 responses
            7 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 07-07-2026, 11:05 AM
            0 responses
            10 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 07-02-2026, 11:08 AM
            0 responses
            31 views
            0 reactions
            Last Post SEQadmin2  
            Working...