Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Colorful_Seq
    Junior Member
    • Mar 2009
    • 5

    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!
  • qtrinh
    Member
    • May 2008
    • 20

    #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

    • Colorful_Seq
      Junior Member
      • Mar 2009
      • 5

      #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

      • qtrinh
        Member
        • May 2008
        • 20

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

        Q

        Comment

        • Colorful_Seq
          Junior Member
          • Mar 2009
          • 5

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

          Comment

          • qtrinh
            Member
            • May 2008
            • 20

            #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

            • Colorful_Seq
              Junior Member
              • Mar 2009
              • 5

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

              Thanks a million!
              Thank you Q...

              Comment

              • westerman
                Rick Westerman
                • Jun 2008
                • 1104

                #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

                • qtrinh
                  Member
                  • May 2008
                  • 20

                  #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

                  • SEQadmin2
                    Nine Things a Sample Prep Scientist Thinks About Before Sequencing
                    by SEQadmin2


                    I’m not a sequencing expert. I’m a purification scientist who uses NGS to evaluate workflows my group develops. With this perspective, we think about the sample first and the NGS workflow second. The sequencer is an exceptionally honest reporter, but it can only report on what you give it, so whether you get clean, interpretable data from an NGS workflow is largely determined before you begin.

                    Here are nine questions we think about, in roughly the order they matter, before...
                    06-18-2026, 07:11 AM
                  • SEQadmin2
                    From Collection to Sequencing: Why Sample Preparation and Preservation Define Sequencing Data
                    by SEQadmin2


                    Data variability is still an issue in sequencing technologies despite the advances in reproducibility and accuracy of these platforms. But the problem does not originate in the sequencing itself, but in the previous steps, before the sample reaches the sequencer.


                    The first step is collection, followed by preservation and sample preparation for analysis. Most scientists overlook those steps, but not being careful might just be skewing the experiment’s results.
                    ...
                    06-02-2026, 10:05 AM

                  ad_right_rmr

                  Collapse

                  News

                  Collapse

                  Topics Statistics Last Post
                  Started by SEQadmin2, 06-17-2026, 06:09 AM
                  0 responses
                  34 views
                  0 reactions
                  Last Post SEQadmin2  
                  Started by SEQadmin2, 06-09-2026, 11:58 AM
                  0 responses
                  99 views
                  0 reactions
                  Last Post SEQadmin2  
                  Started by SEQadmin2, 06-05-2026, 10:09 AM
                  0 responses
                  119 views
                  0 reactions
                  Last Post SEQadmin2  
                  Started by SEQadmin2, 06-04-2026, 08:59 AM
                  0 responses
                  112 views
                  0 reactions
                  Last Post SEQadmin2  
                  Working...