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
            Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
            by SEQadmin2



            Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

            Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
            ...
            10-14-2026, 09:55 AM
          • 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
            ...
            09-28-2026, 10:25 AM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by SEQadmin2, 10-22-2026, 11:13 AM
          0 responses
          23 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-22-2026, 10:48 AM
          0 responses
          20 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-15-2026, 10:52 AM
          0 responses
          36 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-14-2026, 05:39 AM
          0 responses
          42 views
          0 reactions
          Last Post SEQadmin2  
          Working...