Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jgibbons1
    Senior Member
    • Oct 2009
    • 135

    #1

    SOAPsnp sort script

    Hi all,
    For anyone familiar with the SOAP package...
    SOAPsnp takes the SOAPaligner output as its input. The only issue here is that the SOAPaligner output has to be slightly modified. The output has to be sorted first by chromosome name (alphabetically) then by chromosome coordinate (numerically). The output contains 13 tab delimited columns. Chromosome name is the 8th column and coordinate is the 9th.

    My perl skills are still infantile and I'm having a tough time formatting my data.
    Does anyone have a script they wouldn't mind sharing or a solution to this?

    Here is an example line of the output:
    SRR003674.68 GATTAAATAAATATATAGATACCTTTTCCTACTTAT ,)4E8)*;/,.914+-+,&+&)+(+$%($"($#$&# 1 a 36 + Scer_gi|93117368|ref|NC_001136.8| 1272821 2 T->31C-28 T->28C-28 36M 28T2T4
    SRR003674.113 GATATGCTTGAGGATGAACGAGAAGCTAATATAGTC '%&%%%"&$&#)*)(++(+-0+1+'++(104-2-)0 1 a 36 - Scer_gi|93117368|ref|NC_001136.8| 1277159 2 G->6C-30 A->7T-26 36M 6GA28


    Thanks in advance...
  • jgibbons1
    Senior Member
    • Oct 2009
    • 135

    #2
    this has been working in a unix environment

    sort -k [column number] [filename] > outfile

    Comment

    • jgibbons1
      Senior Member
      • Oct 2009
      • 135

      #3
      In case anyone is interested...here's a way using unix commands

      (1) From your SOAPaligner output, make a new file for each chromosome using GREP

      grep -w "chr_1" OUTPUT.soap > chr1_OUTPUT.soap
      grep -w "chr_2" OUTPUT.soap > chr2_OUTPUT.soap
      grep -w "chr_3" OUTPUT.soap > chr3_OUTPUT.soap
      etc...

      (2) For each individual chromosome file sort by the chromosomal coordinate (which in this case is the 9th column) using the SORT command

      sort -k 9 -n chr1_OUTPUT.soap > chr1_OUTPUT_sorted.soap
      sort -k 9 -n chr2_OUTPUT.soap > chr2_OUTPUT_sorted.soap
      sort -k 9 -n chr3_OUTPUT.soap > chr3_OUTPUT_sorted.soap
      etc...

      (3) Concatenate the outputs into a single file
      cat chr1_OUTPUT_sorted.soap > OUTPUT_sorted.soap
      cat chr2_OUTPUT_sorted.soap >> OUTPUT_sorted.soap
      cat chr3_OUTPUT_sorted.soap >> OUTPUT_sorted.soap

      OUTPUT_sorted.soap can now be used as the input file in SOAPsnp

      Functional but not that elegant...

      Comment

      • kmcarr
        Senior Member
        • May 2008
        • 1181

        #4
        You can do this with a single unix sort command.

        Code:
        sort -k8,8 -k9,9n OUTPUT.soap > OUTPUT_sorted.soap

        Comment

        • jgibbons1
          Senior Member
          • Oct 2009
          • 135

          #5
          Thanks!

          When priority sorting there seems to be a memory issue. Breaking the output into individual chromosomes seemed ease that.

          Comment

          Latest Articles

          Collapse

          • SEQadmin2
            New Genomics Technologies Take Aim at Long-Standing Limits
            by SEQadmin2


            Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

            We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
            ...
            Yesterday, 10:25 AM
          • SEQadmin2
            How Immunogenomics Decodes Immunity’s Genetic Blueprint
            by SEQadmin2




            The immune system’s power comes from its genetic diversity, allowing myriad threats to be neutralized through first recognizing foreign antigens. That diversity is also what makes the immune system so difficult to study. Recent advances in sequencing technology and computational biology, however, are giving researchers new tools to understand immune responses and immune-related diseases in greater detail.

            This convergence of genetics, immunology, and computation...
            09-01-2026, 05:41 AM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by SEQadmin2, Today, 09:51 AM
          0 responses
          10 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 09-25-2026, 09:06 AM
          0 responses
          32 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 09-23-2026, 11:05 AM
          0 responses
          27 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 09-18-2026, 11:37 AM
          1 response
          48 views
          0 reactions
          Last Post pekgio
          by pekgio
           
          Working...