Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • deKoch13
    Member
    • Mar 2019
    • 12

    Working with BAM files

    Hi everybody!

    This is my first thread in this forum.
    Recently, I started an internship in a bioinformatics research group. Unfortunately, I have only little experience regarding programming, bioinformatic data handling, ...
    I have basic programming skills in Bash, Python and R, but that's it.

    My task is to inspect three BAM files (> 1 Mio reads). The three BAM files were generated using different methods. I want to find out which BAM files contain the same reads, which reads are only in BAM file 1, which reads are missing in BAM file 3 and so on.

    Can you give me some advice how to deal with this task? Do you have experiences in BAM file handling?

    Many greetings!
  • deKoch13
    Member
    • Mar 2019
    • 12

    #2
    more details

    Maybe I should add some information:
    We took one sample and generated the BAM files using three different pipelines.
    At the moment, we are only interested in the read names (first column of the BAM files) and want to find out which reads are present in all BAM files, which are present in file 1, file 2, file 3...

    Comment

    • GenoMax
      Senior Member
      • Feb 2008
      • 7142

      #3
      You could simply get the names (field 1 as you already note, sort | uniq them in bash) and do a "comm" comparison of the three results. If your aim is just to find which reads are present in all three files.

      Comment

      • deKoch13
        Member
        • Mar 2019
        • 12

        #4
        progress

        Thank you for the answer!

        I already extracted the read names from all files separately using:

        > samtools sort -n bam_filename | samtools view | awk -F "\t" '{print $1}' > output_filename

        Now, my supervisor supposed to use python to do the rest of the task...
        Or can you recommend another possibility?

        Greetings

        Comment

        • deKoch13
          Member
          • Mar 2019
          • 12

          #5
          I looked the "comm" command up. Sounds promising, but I am not sure if this works for such big data files with > 1 Million reads. Do you have an idea for a smart python-based solution?

          Nevertheless, I will try it also using comm.

          Greetings

          Comment

          • GenoMax
            Senior Member
            • Feb 2008
            • 7142

            #6
            If this is an assignment then use what you have to but comm should work (as long as you have enough RAM available). Since you are working with only read names (if you are not then you should).

            Comment

            Latest Articles

            Collapse

            • 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
            • GATTACAT
              Reply to Nine Things a Sample Prep Scientist Thinks About Before Sequencing
              by GATTACAT
              Love this - good data definitely starts from good input, and poor input can only give relatively poor data. I particularly like the mention of Nanodrop/absorbance based methods for quantification. It's such a toss up if you'll get an accurate reading or what amounts to a randomly generated number, and a lot of library/sequencing related issues can be traced back to poor quant.
              07-01-2026, 11:43 AM

            ad_right_rmr

            Collapse

            News

            Collapse

            Topics Statistics Last Post
            Started by SEQadmin2, 07-13-2026, 10:26 AM
            0 responses
            26 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 07-09-2026, 10:04 AM
            0 responses
            36 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 07-08-2026, 10:08 AM
            0 responses
            23 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 07-07-2026, 11:05 AM
            0 responses
            34 views
            0 reactions
            Last Post SEQadmin2  
            Working...