Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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?

  • #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


    • #3
      Of course! Thank you!

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

      Comment

      Latest Articles

      Collapse

      • seqadmin
        Essential Discoveries and Tools in Epitranscriptomics
        by seqadmin




        The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist...
        04-22-2024, 07:01 AM
      • seqadmin
        Current Approaches to Protein Sequencing
        by seqadmin


        Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
        04-04-2024, 04:25 PM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by seqadmin, Today, 08:47 AM
      0 responses
      10 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-11-2024, 12:08 PM
      0 responses
      60 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-10-2024, 10:19 PM
      0 responses
      57 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-10-2024, 09:21 AM
      0 responses
      53 views
      0 likes
      Last Post seqadmin  
      Working...
      X