Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • marco12345
    Member
    • Mar 2013
    • 19

    #1

    sam file integrity

    Hi,

    Is there away to check a sam file integrity? I generated one after mapping with bwa, but have problems on rebuilding a bam file from it.
    In fact, when I use
    $ samtools view -F12 -Sb /input_file.sam > new_bams/output_file.bam
    the bam created is empty (4 kb, coming from a 113 Mb sam).
    I tried many different ways, so I am wondering now if the problem is with the sam file.

    Info:
    -The starting bam file I used are paired-end ones of about 50 Mb and 500000 reads.
    -The creation of fastq file goes well, generating 2 files for the two reads, with the same number of reads of the bam, and size of 53 Mb.
    -The sai file generated from the mapping process with BWA are around 1 Mb.
    -The new sam file is generated through this command:
    $ bwa sampe /ref_genome.fa /bwa_read1.sai /bwa_read2.sai /read1.fastq /read2.fastq > /output.sam

    -The header and first lines of the sam are these:

    @SQ SN:gi|9633069|ref|NC_000898.1| LN:162114
    @SQ SN:gi|224020395|ref|NC_001664.2| LN:159322
    @SQ SN:gi|82503188|ref|NC_007605.1| LN:171823
    @SQ SN:gi|139424470|ref|NC_009334.1| LN:172764
    @PG ID:bwa PN:bwa VN:0.6.1-r104
    SRR360611.2626045 77 * 0 0 * * 0 0 GATGGATCACAGGTCTATCACCCTATTAACCACTCACGGGAGCTCTCCATGCATTTGGTATTTTCGTCTGGGGGGTGTGCACGCGATAGCATTGCGAGAC 7:C;7@?9C7A@@C@D@A>/;CCGBBADBBBBBEAEE9GHEEFHGKGKJIJKHIIIJKIFJIIGJCC?JKKLKKKJKHJKKJCKCKKJKKKIGHG>EEDB
    SRR360611.2626045 141 * 0 0 * * 0 0 TGGTTCCTACTTCAGGGCCATAAAGCCTAAATAGCCCACACGTTCCCCTTAAATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCACTCA 8DDEEGHIGGGGHIIEIIJIHHJJJJJKIJJGDJGKKIFHCCIIJKKKKIJKADJIGJFKI>JIAJGGEDB&:0EB>@7C8B6=;.>FACACB:@E=G@:
    SRR360611.18087377 77 * 0 0 * * 0 0 ATGGATCACAGGTCTATCACCCTATTAACCACTCACGGGAGCTCTCCATGCATTTGGTATTTTCGTCTGGGGGGTGTGCACGCGATAGCATTGCGAGACG <<???@A@ACC?<<C<B??D?GFBDEBAECBEEFAIBEKDJJHJIJHGIJKGIFIJKIF@IIIHCJKIJKKLKKGIJJKKJDJCKIKLIJIHHH?FDDB;
    SRR360611.18087377 141 * 0 0 * * 0 0 GGAAGCTTTCTGTTGGCTCACATTTGGTTTATTGATGTAATGTATTGATGCTTCCCATAACGCCCTAAGTTCACACATCAACTGCAACTCCAAAGCCACC 8ECFGGFFFHIHF<ADIJIGDHHHBIIGFF@C?G@CE6BEGGEB>GDEEGCF>HK<F?<F&653&=2:?5?6/5=0B><:GCAGBEB+GF?D:@BB=B;@
    SRR360611.8887247 77 * 0 0 * * 0 0 ATGGATCACAGGTCTATCACCCTATTAACCACTCACGGGAGCTCTCCATGCATTTGGTATTTTCGTCTGGGGGGTGTGCACGCGATAGCATTGCGAGACG 5<;:=@A@ACA?=<C>FA:ABBFBDEB<BCBBECAIBHKGJHF?FJKGIJKIGIIJKIGIGIGHAF<IJKKLKKHIIGKKJDKCKKKLKKJHHH?FEDA;



    -I am working on a Mac Terminal (OSX 10.5, or OSX 10.6, or on Linux based cluster)

    Thanks in advance!
    Last edited by marco12345; 03-28-2013, 04:31 AM.
  • GenoMax
    Senior Member
    • Feb 2008
    • 7142

    #2
    Try this: http://genome.sph.umich.edu/wiki/BamUtil:_validate

    Comment

    • swbarnes2
      Senior Member
      • May 2008
      • 910

      #3
      Well, why don't you start by believing what your data tells you. You are filtering away unmapped reads, and almost nothing comes out at the end, maybe nothing mapped?

      77 = 64+8+4+1. That didn't map.

      141=128 + 8+4+1, also didn't map.

      It looks like you are aligning to herpes virus, but your reads seem to align to human mitochondria.

      Comment

      • marco12345
        Member
        • Mar 2013
        • 19

        #4
        I agree, believing the datas should be the first answer, but unfortunately I am quite sure the problem isn't that.
        I am using full adult human genomes, and aligning to 4 viruses, each of which is present in 98% of adult population. I tried this with almost 10 individuals and had the same result, so unless I found a really weird group of people, I guess I made a mistake somewhere, just can't understand where!

        Comment

        • swbarnes2
          Senior Member
          • May 2008
          • 910

          #5
          I am using full adult human genomes
          Are you 100% sure the mitochrondria are there? Because those reads look like mitochrondria, and they didn't map.

          Have you sat down and spot checked a bunch of reads, to see that they are about what you expect?

          Have you used grep to see if you can find some examples of the reads you are looking for?

          Your .bam is telling you that at most, a tiny % of your reads align to herpes virus. Do you have empirical evidence telling you this is not actually true?

          bwa and samtools didn't crash, and they are not returning errors. The fault is very unlikely to be in your files. Either your libraries are not what you believed them to be, or the alignment was not carried out the way you think it was.

          Comment

          Latest Articles

          Collapse

          • SEQadmin2
            Beyond CRISPR/Cas9: Understand, Choose, and Use the Right Genome Editing Tool
            by SEQadmin2



            CRISPR/Cas9 sparked the gene editing revolution for both research and therapeutics.1 But this system still showed severe issues that limited its applications. The most prominent were the heavy reliance on PAM sequences, delivery limitations, double-stranded breaks that prompt unintended edits and cell death, and editing inefficiency (both in targeting and in knock-in reliability).

            Despite this, “CRISPR helped turn genome editing from a specialized technique into
            ...
            07-31-2026, 11:01 AM
          • SEQadmin2
            Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
            by SEQadmin2


            Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

            The systematic characterization of the human proteome has
            ...
            07-20-2026, 11:48 AM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by SEQadmin2, 08-13-2026, 12:22 PM
          0 responses
          19 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 08-11-2026, 10:35 AM
          0 responses
          16 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 08-06-2026, 07:41 AM
          0 responses
          32 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 08-03-2026, 10:13 AM
          0 responses
          50 views
          0 reactions
          Last Post SEQadmin2  
          Working...