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
                    Advanced Methods for the Detection of Infectious Disease
                    by seqadmin




                    The recent pandemic caused worldwide health, economic, and social disruptions with its reverberations still felt today. A key takeaway from this event is the need for accurate and accessible tools for detecting and tracking infectious diseases. Timely identification is essential for early intervention, managing outbreaks, and preventing their spread. This article reviews several valuable tools employed in the detection and surveillance of infectious diseases.
                    ...
                    11-27-2023, 01:15 PM
                  • seqadmin
                    Strategies for Investigating the Microbiome
                    by seqadmin




                    Microbiome research has led to the discovery of important connections to human and environmental health. Sequencing has become a core investigational tool in microbiome research, a subject that we covered during a recent webinar. Our expert speakers shared a number of advancements including improved experimental workflows, research involving transmission dynamics, and invaluable analysis resources. This article recaps their informative presentations, offering insights...
                    11-09-2023, 07:02 AM

                  ad_right_rmr

                  Collapse

                  News

                  Collapse

                  Topics Statistics Last Post
                  Started by seqadmin, 12-01-2023, 09:55 AM
                  0 responses
                  20 views
                  0 likes
                  Last Post seqadmin  
                  Started by seqadmin, 11-30-2023, 10:48 AM
                  0 responses
                  20 views
                  0 likes
                  Last Post seqadmin  
                  Started by seqadmin, 11-29-2023, 08:26 AM
                  0 responses
                  14 views
                  0 likes
                  Last Post seqadmin  
                  Started by seqadmin, 11-29-2023, 08:12 AM
                  0 responses
                  17 views
                  0 likes
                  Last Post seqadmin  
                  Working...
                  X