Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • het. and hom. SNP?

    HI,
    I use MAQ software mapping the reads.
    Is there anybody know how to get the het and hom SNPs from MAQ software?

    Thx!

  • #2
    Hi,
    Running the command 'maq cns2snp in.cns > out.snp' should give you the info you are looking for - see http://maq.sourceforge.net/maq-manpage.shtml for output column descriptions.

    Q

    Comment


    • #3
      Thx Q...
      I already Runing the command 'maq cns2snp in.cns > out.snp'.
      Now I write a simple perl script to split the snp file to hom snp and het snp.

      Comment


      • #4
        No ... no ... no perl ... a one-liner bash with awk will do. Let me know if you need the one-liner ... :-)

        Q

        Comment


        • #5
          Really?
          I am sorry,I am not familiar with Linux command.
          But I'd like to know!
          Thanks a million!

          Comment


          • #6
            cat MAQ_SNP_FILE | awk '{ if (($4!="A") && ($4!="C") && ($4!="G") && ($4!="T") ) { print $0 } }' > het.snps



            cat MAQ_SNP_FILE | awk '{ if (($4=="A") || ($4=="C") || ($4=="G") || ($4=="T") ) { print $0 } }' > homo.snps


            $4 means column number 4 in your MAQ_SNP_FILE.

            Q

            Comment


            • #7
              Ha~cool!
              It's works...
              It's better than perl!
              faster and just a liner~

              Thanks a million!
              Thank you Q...

              Comment


              • #8
                Perl is also good

                Of course perl can be a one-liner as well. And, IMHO, a cleaner one than awk.

                perl -nle '@z = split /\t/; print if $z[3] !~ /[ACGT]/' MAQ_SNP_FILE > het.snps

                perl -nle '@z = split /\t/; print if $z[3] =~ /[ACGT]/' MAQ_SNP_FILE > homo.snps


                Basically, the 'perl -nle' means:

                'n' ==> loop through the file
                'l' ==> remove and add newlines as needed
                'e' ==> execute the following script.

                The script is in two parts:

                @z = split /\t/ ==> takes the line and splits it along tabs into an array called '@z'
                print if the 4th element of the array (called [3] in the perl 0-based array structure) is not (hets) or is (homo) one of A, C, G, or T.

                All-in-all the perl method seems more clean to me since the character to look for can be bundled into the square brackets; e.g., [ACGT]. But then I am mainly a Perl programmer.

                Comment


                • #9
                  Yes, I agree with westerman, Perl is also good. I found myself using a bit of Perl, awk, and sed everyday.

                  Q

                  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 on Modified Bases...
                    Today, 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-11-2024, 12:08 PM
                  0 responses
                  37 views
                  0 likes
                  Last Post seqadmin  
                  Started by seqadmin, 04-10-2024, 10:19 PM
                  0 responses
                  41 views
                  0 likes
                  Last Post seqadmin  
                  Started by seqadmin, 04-10-2024, 09:21 AM
                  0 responses
                  35 views
                  0 likes
                  Last Post seqadmin  
                  Started by seqadmin, 04-04-2024, 09:00 AM
                  0 responses
                  54 views
                  0 likes
                  Last Post seqadmin  
                  Working...
                  X