Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • christinehicks
    Junior Member
    • Feb 2013
    • 1

    #1

    Separating reads from different organisms

    My RNAseq data contains reads from two different organisms (a host and a pathogen). I wish to separate these reads so I can work on both species separately. I plan to do a de novo assembly on the host reads, which requires the reads to be in fastq format, not bam format.

    In order to separate the reads, I have aligned to the pathogen genome using tophat2, which produced an unmapped.bam file containing the host reads. I used samtools sort to sort the bam file, then ran BEDtools bamtofastq to recreate the fastq files containing only the host reads. However, when I run bed tools I always get an empty output file. Looking at the error messages, this is because there are unpaired reads in the bam file. I ran tophat2 with the 'no-mix' parameter, which should prevent the reads from being separated but I still get unpaired reads in my unmapped.bam file.

    I'm pretty stumped, does anyone have any experience in using bedtools bamtofastq? Or maybe a better suggestion for separating reads from two different organisms?

    Thank you!
  • GenoMax
    Senior Member
    • Feb 2008
    • 7142

    #2
    Give BBMap a try as an alternative: http://seqanswers.com/forums/showthread.php?t=41818
    Last edited by GenoMax; 04-06-2014, 05:53 AM.

    Comment

    • Brian Bushnell
      Super Moderator
      • Jan 2014
      • 2709

      #3
      BBMap allows you to output in fastq, and it has various output streams including "outu" for only unmapped reads and "outm" for only mapped reads. You can also use the "po" flag (meaning "paired only") to specify that unpaired reads should be considered unmapped - specifically, "po=f" (the default) will send mapped but unpaired reads to "outm" while "po=t" will consider unpaired reads as unmapped and thus send them to "outu".

      I slightly messed up the commands in the thread mentioned by Genomax, and have corrected them. This is the corrected version:

      (index)
      bbmap.sh ref=reference.fasta -Xmx29g

      (map)
      bbmap.sh in=reads.fq outm=mapped.fq outu=unmapped.fq -Xmx29g

      That will split it into two fastq files. If you change the output file extensions to ".sam" instead of ".fq", you will get sam output. If you have paired reads in 2 files, you would do this:

      bbmap.sh in1=reads1.fq in2=reads2.fq outm1=mapped.fq outm2=mapped2.fq outu1=unmapped1.fq outu2=unmapped2.fq -Xmx29g

      The "-Xmx29g" indicates how much memory java is allowed to use; set that at ~85% of your physical memory.
      If you have assemblies for both the organism and pathogen, you can use BBSplit instead of BBMap; in that case, just reply here if you need help. BBSplit works fine with RNA-seq data but its defaults are set for DNA so they would need adjustment.
      Last edited by Brian Bushnell; 04-06-2014, 08:54 AM.

      Comment

      • khughitt
        Junior Member
        • Dec 2012
        • 7

        #4
        Hi Christine,

        By "no-mix", do you mean "--no-mixed"? It might be helpful to post the entire command you are using.

        Also, Tophat ships with a conversion tool, bam2fastx, which you might want to try for converting unmapped.bam back to a FASTQ file.

        Finally, not necessarily related to your question, but are you doing any QC/trimming before attempting to map? This is generally useful to save pathogen reads from going to unmapped.bam when they have low quality bases on the ends, etc.

        HTH,
        Keith

        Comment

        • Michael.Ante
          Senior Member
          • Oct 2011
          • 127

          #5
          You may try to combine both genomes in one reference file and align all reads against it. This maybe bypasses the problem of homologous regions in both species.
          Afterwards, you can separate the bam-file species-wise and create the fastq-file as Keith already mentioned.

          Comment

          Latest Articles

          Collapse

          • SEQadmin2
            Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
            by SEQadmin2



            Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

            Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
            ...
            10-14-2026, 09:55 AM
          • SEQadmin2
            New Genomics Technologies Take Aim at Long-Standing Limits
            by SEQadmin2


            Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

            We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
            ...
            09-28-2026, 10:25 AM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by SEQadmin2, 10-22-2026, 11:13 AM
          0 responses
          29 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-22-2026, 10:48 AM
          0 responses
          22 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-15-2026, 10:52 AM
          0 responses
          39 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-14-2026, 05:39 AM
          0 responses
          45 views
          0 reactions
          Last Post SEQadmin2  
          Working...