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
                    Recent Advances in Sequencing Analysis Tools
                    by seqadmin


                    The sequencing world is rapidly changing due to declining costs, enhanced accuracies, and the advent of newer, cutting-edge instruments. Equally important to these developments are improvements in sequencing analysis, a process that converts vast amounts of raw data into a comprehensible and meaningful form. This complex task requires expertise and the right analysis tools. In this article, we highlight the progress and innovation in sequencing analysis by reviewing several of the...
                    05-06-2024, 07:48 AM
                  • 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

                  ad_right_rmr

                  Collapse

                  News

                  Collapse

                  Topics Statistics Last Post
                  Started by seqadmin, 05-10-2024, 06:35 AM
                  0 responses
                  20 views
                  0 likes
                  Last Post seqadmin  
                  Started by seqadmin, 05-09-2024, 02:46 PM
                  0 responses
                  25 views
                  0 likes
                  Last Post seqadmin  
                  Started by seqadmin, 05-07-2024, 06:57 AM
                  0 responses
                  21 views
                  0 likes
                  Last Post seqadmin  
                  Started by seqadmin, 05-06-2024, 07:17 AM
                  0 responses
                  21 views
                  0 likes
                  Last Post seqadmin  
                  Working...
                  X