Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • count A/T/C/G/N in a aligned site

    Hello,

    I am wondering which tools I should use to count the A/T/C/G/N number/percentage in a given aligned site after alignment. Thanks in advance.

    John

  • #2
    it looks like no one knows this and if there is not a tool over there, I would like to write a simple one for this basic function and am wondering if any journal like to publish it

    Comment


    • #3
      Have you looked at samtools pileup?

      Comment


      • #4
        perl's tr can be used for this, if you use it after something like mpileup. It's also possible there's a SAMtool to do it as well.
        Code:
        $valueA = tr/Aa//;$valueC = tr/Cc//;$valueG = tr/Gg//;$valueT = tr/Tt//;
        print("A: $valueA; C: $valueC; G: $valueG; T: $valueT\n");

        Comment


        • #5
          Thanks for response. I tried samtools pileup, but the output was a large file, even including a long sequence like....a..t....I only need simple output atcg and their percentage. I might not use it correctly, but I already tried twice and I think perl is great! Thanks.

          Comment


          • #6
            Hi John,

            You can use mpileup for a given site or position:
            samtools mpileup -r 1:18321-18323 bam_file.bam

            You will obtain something like that:
            1 18321 N 14 TTTTTTTttttttt BHEHEHHICF#HHB
            1 18322 N 14 TTTTTTTttttttt DHIHEIIHE@#HGB
            1 18323 N 14 CCCCCCCccccccc ,HIHBIIICF#EGB

            Then you can cut the 5th column and count the bases as gringer proposed.

            Emilie

            Comment


            • #7
              Emilie

              Thank you for your post that give me a sense of the output file from mpileup. In this case, if I have one million sites like 1:18321, I just need to count a million line. It should be fast. Good idea!

              John

              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, 04-25-2024, 11:49 AM
              0 responses
              19 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-24-2024, 08:47 AM
              0 responses
              20 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-11-2024, 12:08 PM
              0 responses
              62 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-10-2024, 10:19 PM
              0 responses
              61 views
              0 likes
              Last Post seqadmin  
              Working...
              X