Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MaximeOfOslo
    Junior Member
    • Jun 2015
    • 6

    #16
    The sorted and not-sorted bam files are the same size

    Code:
    -bash-4.1$ pwd
    /usit/abel/u1/maxib/1_data/1_project/1st_assembly_strategy
    -bash-4.1$ du -sh *
    7,0G	1_align.sam
    84K	chrysanthemum_indicum_chloroplast.fasta
    3,5K	chrysanthemum_indicum_chloroplast.fasta.fai
    15G	contig.fa
    1,8G	file.bam
    1,8G	file_sorted.bam
    6,5K	file_sorted.bam.bai
    0	file.vcf.gz
    0	out.fa
    512	sam.sh
    6,3G	scafseq.fa
    1,5K	test.vcf.gz
    0	vcffile
    Running manually mpileup produces the same error

    Code:
    -bash-4.1$ /usit/abel/u1/maxib/8_samtools/bin/samtools mpileup  -v -f chrysanthemum_indicum_chloroplast.fasta file_sorted.bam -o file.vcf.gz 
    [mpileup] 1 samples in 1 input files
    <mpileup> Set max per-file depth to 8000
    Abandon

    Comment

    • GenoMax
      Senior Member
      • Feb 2008
      • 7142

      #17
      By chance do you have extremely deep coverage (> 8000)? That is a small genome and the result is a large bam file.

      Comment

      • MaximeOfOslo
        Junior Member
        • Jun 2015
        • 6

        #18
        Well, I'm working with WGS data to extract, for the moment, the chloroplast genome.
        So I have 307 210 727 reads of mean length 151 which equals 46 696 030 504 base pairs.
        The chloroplast I've mapped them to is 86444 bp.
        So the coverage is around 540 188...

        Well, I think you found the problem ! Thanks for your help, I'll randomly subsample my fastq files before alignment by 1000 folds !
        ps : to whom might be interested, here is a script to do it :

        Code:
        # Written by  Aaronquinlan
        # https://www.biostars.org/p/6544/
        # Starting FASTQ files
        export FQ1=1.fq
        export FQ2=2.fq
        
        # The names of the random subsets you wish to create
        export FQ1SUBSET=1.rand.fq
        export FQ2SUBSET=2.rand.fq
        
        # How many random pairs do we want?
        export N=100
        
        # paste the two FASTQ such that the 
        # header, seqs, seps, and quals occur "next" to one another
          paste $FQ1 $FQ2 | \
        # "linearize" the two mates into a single record.  Add a random number to the front of each line
          awk 'BEGIN{srand()}; {OFS="\t"; \
                                getline seqs; getline sep; getline quals; \
                                print rand(),$0,seqs,sep,quals}' | \
        # sort by the random number
          sort -k1,1 | \
        # grab the first N records
          head -n $N | \
        # Convert the stream back to 2 separate FASTQ files.
          awk '{OFS="\n"; \
                print $2,$4,$6,$8 >> ENVIRON["FQ1SUBSET"]; \
                print $3,$5,$7,$9 >> ENVIRON["FQ2SUBSET"]}'
        Last edited by MaximeOfOslo; 06-18-2015, 07:15 AM.

        Comment

        • GenoMax
          Senior Member
          • Feb 2008
          • 7142

          #19
          540,000x

          Reformat.sh from BBMap can also subsample directly from sam/bam.

          This can save you some alignment time.
          Code:
          $ reformat.sh in=in.sam out=out.sam sample=some_number_here

          Comment

          • swbarnes2
            Senior Member
            • May 2008
            • 910

            #20
            Picard tools can also randomly downsample a .bam file.

            And the cheesy way to do it yourself would be to use awk or grep to only grab reads from a particular tile, one not on the edge would be preferable.

            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, Yesterday, 11:13 AM
            0 responses
            16 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, Yesterday, 10:48 AM
            0 responses
            17 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 10-15-2026, 10:52 AM
            0 responses
            35 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 10-14-2026, 05:39 AM
            0 responses
            42 views
            0 reactions
            Last Post SEQadmin2  
            Working...