Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • rndouglas
    Member
    • Jun 2012
    • 23

    SAM to BAM conversion issue

    All of a sudden a problem with SAM to BAM conversion has cropped up for me.

    I used Bowtie 1 to map sRNA reads to a sequence of interested and had a SAM file outputted:

    Code:
    @HD	VN:1.0	SO:unsorted
    @SQ	SN:centc	LN:11067
    @PG	ID:Bowtie	VN:0.12.8	CL:"bowtie -f -S --al /Users/birchlerlab/Desktop/TB9Sb1_centc_aligned.fa /Users/birchlerlab/Desktop/maize_centromeres/centc.fa /Users/birchlerlab/Desktop/TB9SB1_filtered_18_28nt.fa"
    CTATAAGTCTGTGAAGGTGTCTT	4	*	0	0	*	*	0	0	CTATAAGTCTGTGAAGGTGTCTT	IIIIIIIIIIIIIIIIIIIIIII	XM:i:0
    AAGGGGTCGACACAGTTTAGCATG	4	*	0	0	*	*	0	0	AAGGGGTCGACACAGTTTAGCATG	IIIIIIIIIIIIIIIIIIIIIIII	XM:i:0
    CCTTCTATCGACGGAGCAGGACGCC	4	*	0	0	*	*	0	0	CCTTCTATCGACGGAGCAGGACGCC	IIIIIIIIIIIIIIIIIIIIIIIII	XM:i:0
    CATAACGAAGAAACCCTAGCCT	4	*	0	0	*	*	0	0	CATAACGAAGAAACCCTAGCCT	IIIIIIIIIIIIIIIIIIIIII	XM:i:0
    ATGAATGTAGATGAAGGGAACTCA	4	*	0	0	*	*	0	0	ATGAATGTAGATGAAGGGAACTCA	IIIIIIIIIIIIIIIIIIIIIIII	XM:i:0
    GAGGATAGCCAAGAGTTCAGGGCC	4	*	0	0	*	*	0	0	GAGGATAGCCAAGAGTTCAGGGCC	IIIIIIIIIIIIIIIIIIIIIIII	XM:i:0
    GTGAGTTGAGAATCCATGCGGGCG	4	*	0	0	*	*	0	0	GTGAGTTGAGAATCCATGCGGGCG	IIIIIIIIIIIIIIIIIIIIIIII	XM:i:0
    GTGAGTTGAGAATCCATGCGGGCG	4	*	0	0	*	*	0	0	GTGAGTTGAGAATCCATGCGGGCG	IIIIIIIIIIIIIIIIIIIIIIII	XM:i:0
    AAGGAGAGTAAGAATTAACAGTGT	4	*	0	0	*	*	0	0	AAGGAGAGTAAGAATTAACAGTGT	IIIIIIIIIIIIIIIIIIIIIIII	XM:i:0
    AAGGAGAGTAAGAATTAACAGTGT	4	*	0	0	*	*	0	0	AAGGAGAGTAAGAATTAACAGTGT	IIIIIIIIIIIIIIIIIIIIIIII	XM:i:0
    Everything seemed okay at that point, and I wanted to throw the output into IGV to visualize the reads when it yelled at me (rightfully so) that my SAM file was unsorted.

    Aha! I thought I would just convert to BAM then sort, then go back to IGV.

    So I used this to convert SAM to BAM:

    Code:
    samtools view -bS ~/TB9SB3.sam > ~/TB9SB3.bam
    Then I went to sort the file and it finished instantly. I knew something was not right so I looked at my BAM file and it looked like garbled trash (see photo from a related sample).



    Any suggestions on what I might have done to screw things up? I have installed nothing/deleted nothing since my SAM to BAM conversions were working well last week.
    My previous SAM to BAM converstions were with Tophat output though. Does Bowtie output not do well with a conversion?
  • nilshomer
    Nils Homer
    • Nov 2008
    • 1283

    #2
    BAM files are compacted and compressed, so you wont be able to read them in a text viewer. Try converting back from BAM to SAM to see if you get the original SAM file.

    Comment

    • rndouglas
      Member
      • Jun 2012
      • 23

      #3
      Of course! Thank you!

      I'm guessing I just entered a bad sort command now.

      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.
        ...
        Today, 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...
        Yesterday, 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, Today, 10:04 AM
      0 responses
      7 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, Yesterday, 10:08 AM
      0 responses
      6 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-07-2026, 11:05 AM
      0 responses
      9 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...