Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • About script to combine steps of BWA

    For BWA, first do alignment (generate .sai), then sampe the paired-ends (generate .sam), then convert .sam to .bam. Now I'm going to write script to combine all these steps. ie, input is fastq, then output is .bam file.

    Now a big question is, I need to guarantee, say, the first step (generating .sai) is COMPLETE (instead of being aborted) before going to the second step; and the second step (generating .sam) before the third. I there any way to check that for BWA? Or what's the sign for the completeness of each step?

    btw, for combining of steps of BWA, I just need to put those three commands together? Or any other trick?

    thanks!

  • #2
    Just write a shell script that calls your three commands in order... unless you are executing BWA on a server with a scheduler, in which case you can just submit all three commands independently with wait conditions.

    Comment


    • #3
      If you are looking for one to cut and paste there is one on my introduction thread that will take samples from fastq files straight to sorted bams with dupsmarked. It doesn't do a check for errors after each step, but others could likely suggest a simple method to capture if the exit status of the previous step. Generally, I've not had many issue with errors except when I messed up...

      Comment


      • #4
        Hello CNVboy,

        If you are running your combined script on a Scheduler then, only problem with giving all the commands together is that you will get to know about the errors only at the end, that too only "IF" you are not keeping an eye on the log file.
        (use "$tail -f <filename>" for that, keep looking at it every 10-15 mins)
        I use SGE and just tail -f the err and out files

        Same way for running the script directly, only difference is your output is now the terminal and not a file.

        Hope this helps,
        prakhar

        Comment


        • #5
          THanks everyone.

          I think the core question is: how can we guarantee the quality of the generated .sai, .sam file? How do you know the programming at this step is complete? Just look at the size of files; or ,say judge the quality of .sai file by checking if it can produce .sam file?

          For example, some of my .sai file looks good size-wise, but somehow cannot produce .sam file with correct size (.sam file is only 8.0kb); then I just reproduce .sai file, and it can generate .sam file with correct size.

          Also, seems BWA returns exit codes; can we use this as the sign of completeness of each step? And try to make it like, command 2 will execute only if command 1 runs successfully
          Last edited by CNVboy; 06-22-2011, 05:19 AM.

          Comment


          • #6
            In my experience BWA won't really ever error out unless there's a problem with your data or your command (or lack of memory). As long as your data/commands are correct you can just use a shell script - command n in a shell script will wait until command (n - 1) is complete before running so you're guaranteed to start in the correct order.

            As far as you yourself knowing if the .sai stage is complete, just check your stderr output - if it says "n sequences have been processed", where n = the number of sequences in your FASTQ file, then it's complete. But the shell will check this for you if it's running a script.

            Comment

            Latest Articles

            Collapse

            • seqadmin
              Exploring the Dynamics of the Tumor Microenvironment
              by seqadmin




              The complexity of cancer is clearly demonstrated in the diverse ecosystem of the tumor microenvironment (TME). The TME is made up of numerous cell types and its development begins with the changes that happen during oncogenesis. “Genomic mutations, copy number changes, epigenetic alterations, and alternative gene expression occur to varying degrees within the affected tumor cells,” explained Andrea O’Hara, Ph.D., Strategic Technical Specialist at Azenta. “As...
              07-08-2024, 03:19 PM
            • seqadmin
              Exploring Human Diversity Through Large-Scale Omics
              by seqadmin


              In 2003, researchers from the Human Genome Project (HGP) announced the most comprehensive genome to date1. Although the genome wasn’t fully completed until nearly 20 years later2, numerous large-scale projects, such as the International HapMap Project and 1000 Genomes Project, continued the HGP's work, capturing extensive variation and genomic diversity within humans. Recently, newer initiatives have significantly increased in scale and expanded beyond genomics, offering a more detailed...
              06-25-2024, 06:43 AM

            ad_right_rmr

            Collapse

            News

            Collapse

            Topics Statistics Last Post
            Started by seqadmin, Yesterday, 05:49 AM
            0 responses
            13 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 07-15-2024, 06:53 AM
            0 responses
            24 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 07-10-2024, 07:30 AM
            0 responses
            37 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 07-03-2024, 09:45 AM
            0 responses
            204 views
            0 likes
            Last Post seqadmin  
            Working...
            X