Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mgibson
    Junior Member
    • Jun 2011
    • 4

    #1

    Visualizing Alignments to a gene

    I will apologize in advance if this is a really obvious question. I am analyzing some RNA seq data using TopHat/Bowtie for alignment and Cufflinks for expression analysis. I want to pull out the consensus sequence for all the reads that align to a particular gene. I know that I can use SAMtools to pull out all the raw reads that align to a region, but that is still thousands of individual reads to deal with.

    Is there a function that I am missing in the software packages I currently use? Or is there some alternative piece of software that I should be using?

    Thanks in advance!
  • gringer
    David Eccles (gringer)
    • May 2011
    • 845

    #2
    Galaxy has a nice pileup-to-interval function that takes as input the mpileup output of samtools, and generates a consensus sequence for regions above a certain coverage. Tablet is nice for visualising mapping and the consensus sequence and exon boundaries:

    Comment

    • Richard Finney
      Senior Member
      • Feb 2009
      • 701

      #3
      If you just want to view chunks of RNA seq bams, try this script, it creates a wig (wiggle) file which you can upload to UCSC browser as a custom track. In this case, it is called "bam2wig"

      #example usage: ./bam2wig example.bam chr5:10333595-15399999 fileName.wig
      #this uses SAMT variable, you must edit export line (bash specific ) to point to your samtools executable

      export SAMT=samtools-0.1.18/samtools
      echo "track type=wiggle_0 name=fileName.wig description=examplecustomwig" > $3
      $SAMT depth -r $2 $1 | awk '{if ($1!=p) {print "variableStep chrom="$1;} print $2" "$3;p=$1;}' >> $3

      Comment

      • dglemay
        Member
        • Feb 2011
        • 16

        #4
        Thanks

        Dear Richard,
        Great script. Thanks for sharing!

        For others who use it, don't forget to index your bam file first
        samtools index <yourfile>.bam

        -Danielle

        Comment

        • jflowers
          Member
          • Oct 2011
          • 42

          #5
          If you want to stick with samtools, you can use bcftools and vcfutils.pl vcf2fq (which come with your samtools installation) to get a consensus. This can all be done in one command line, like:

          samtools view -u aln.bam chromsome_name:X1-X2 | samtools mpileup -uf ref.fa - | bcftools view -cg - | vcfutils.pl vcf2fq > cns.fq

          Where aln.bam is your alignment, chromosome_name is the identifier in your original ref.fa, and X1 and X2 are the coordinates of interest.

          See documentation here:
          http://samtools.sourceforge.net/mpileup.shtml

          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, 10-22-2026, 11:13 AM
          0 responses
          24 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-22-2026, 10:48 AM
          0 responses
          20 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-15-2026, 10:52 AM
          0 responses
          36 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...