Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • smaller bam file given a bed file

    Hi:

    When I load accepted_hits.bam from Tophat and Junctions.bed into IGV to visualize splicing events for two samples, due to memory IGV responds slow.


    I wanted to make a smaller BAM file from larger BAM file by supplying only those regions I see splicing differences (output from Cuffdiff).

    Given a GTF or BED file and large size accepted_hits.bam BAM file, can I make smaller size BAM file.

    For a given position, I know how to do;
    samtools view bam chr1:11111-22222...

    I don't know how I can supply BED or GTF to samools..

    Thanks
    Adrian

  • #2
    Originally posted by adrian View Post
    I don't know how I can supply BED or GTF to samools..
    Hi- Check the -L option in samtools view.
    Dario

    Code:
    samtools view -h
    
    Usage:   samtools view [options] <in.bam>|<in.sam> [region1 [...]]
    
    Options: -b       output BAM
             -h       print header for the SAM output
             -H       print header only (no alignments)
             -S       input is SAM
             -u       uncompressed BAM output (force -b)
             -1       fast compression (force -b)
             -x       output FLAG in HEX (samtools-C specific)
             -X       output FLAG in string (samtools-C specific)
             -c       print only the count of matching records
             -L FILE  output alignments overlapping the input BED FILE [null]
             -t FILE  list of reference names and lengths (force -S) [null]
             -T FILE  reference sequence file (force -S) [null]
             -o FILE  output file name [stdout]
             -R FILE  list of read groups to be outputted [null]
             -f INT   required flag, 0 for unset [0]
             -F INT   filtering flag, 0 for unset [0]
             -q INT   minimum mapping quality [0]
             -l STR   only output reads in library STR [null]
             -r STR   only output reads in read group STR [null]
             -s FLOAT fraction of templates to subsample; integer part as seed [-1]
             -?       longer help

    Comment


    • #3
      Oh.. I missed it. That was embarrassing.. it was right there.

      Thanks for pointing out.

      -Adrian.

      Comment

      Latest Articles

      Collapse

      • seqadmin
        Understanding Genetic Influence on Infectious Disease
        by seqadmin




        During the COVID-19 pandemic, scientists observed that while some individuals experienced severe illness when infected with SARS-CoV-2, others were barely affected. These disparities left researchers and clinicians wondering what causes the wide variations in response to viral infections and what role genetics plays.

        Jean-Laurent Casanova, M.D., Ph.D., Professor at Rockefeller University, is a leading expert in this crossover between genetics and infectious...
        09-09-2024, 10:59 AM
      • seqadmin
        Addressing Off-Target Effects in CRISPR Technologies
        by seqadmin






        The first FDA-approved CRISPR-based therapy marked the transition of therapeutic gene editing from a dream to reality1. CRISPR technologies have streamlined gene editing, and CRISPR screens have become an important approach for identifying genes involved in disease processes2. This technique introduces targeted mutations across numerous genes, enabling large-scale identification of gene functions, interactions, and pathways3. Identifying the full range...
        08-27-2024, 04:44 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by seqadmin, Today, 06:25 AM
      0 responses
      9 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, Yesterday, 01:02 PM
      0 responses
      8 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 09-18-2024, 06:39 AM
      0 responses
      10 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 09-11-2024, 02:44 PM
      0 responses
      13 views
      0 likes
      Last Post seqadmin  
      Working...
      X