Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nimmi
    Member
    • Jul 2010
    • 15

    #1

    bfast localalign error

    Hi,

    I am trying to map exome data using bfast. I received *.sam files from our collaborates. Here's a summary of my method:

    1. Converted *.sam to *.fastq using PICARD
    2. Converted hg19.fa to color space - hg19.fa.cs.brg
    3. Created index for reference - hg19.fa.cs.1.1.bif
    4. Search indexes successful - *.bmf
    5. Perform local alignment - gave me an error! Thanks to Seqanswers forums, I realized that I have to convert reference to nucleotide space as well. So, now I have hg19.fa.nt.brg
    6. Tried to run local alignment again.....but got "AlignColorSpaceGappedConstrained" error!!!

    ************************************************************
    Checking input parameters supplied by the user ...
    Validating fastaFileName chr_all.fa.
    Validating matchFileName03C14605A_bfastMatches_hg19.bmf.
    **** Input arguments look good! *****
    ************************************************************
    ************************************************************
    Printing Program Parameters:
    programMode: [ExecuteProgram]
    fastaFileName: chr_all.fa
    matchFileName: 03C14605A_bfastMatches_hg19.bmf
    scoringMatrixFileName: [Not Using]
    ungapped: [Not Using]
    unconstrained: [Not Using]
    space: [Color Space]
    startReadNum: 1
    endReadNum: 2147483647
    offsetLength: 20
    maxNumMatches: 384
    avgMismatchQuality: 10
    numThreads: 1
    queueLength: 10000
    timing: [Not Using]
    ************************************************************
    ************************************************************
    Reading in reference genome from chr_all.fa.nt.brg.
    In total read 25 contigs for a total of 3095693983 bases
    ************************************************************
    ************************************************************
    Reading match file from 03C14605A_bfastMatches_hg19.bmf.
    ************************************************************
    Performing alignment...
    Reads processed: 0************************************************************
    In function "AlignColorSpaceGappedConstrained": Fatal Error[OutOfRange]. Message: read and reference did not match.
    ***** Exiting due to errors *****
    ************************************************************


    Thank you in advance for your help.

    Nimmi
  • drio
    Senior Member
    • Oct 2008
    • 323

    #2
    Can you show the files from within the reference directory as well as the exact commands you run?

    Is it possible you forgot to use -A1 to tell bfast to compute the local alignments in CS?
    -drd

    Comment

    • nimmi
      Member
      • Jul 2010
      • 15

      #3
      Here are the list of files in my directory:

      03C14605A.fastq
      chr_all.fa
      chr_all.fa.cs.brg
      chr_all.fa.cs.1.1.bif
      chr_all.fa.nt.brg
      03C14605A_bfastMatches_hg19.bmf

      Here's the command I used for local alignment:

      $/usr/local/bfast/bin/bfast localalign -f chr_all.fa -m 03C14605A_bfastMatches_hg19.bmf -A 1
      > 03C14605A_bfastMatches_hg19_localalign.baf

      Thank you very much

      Comment

      • nilshomer
        Nils Homer
        • Nov 2008
        • 1283

        #4
        Looks like the fastq is not in the proper format. You need to extract the color sequence and color qualities from the SAM file in the CS/CQ optional tags.

        Comment

        • nimmi
          Member
          • Jul 2010
          • 15

          #5
          Thanks Nils for your response. Here's a few lines from my *.sam file:

          1462_1719_1204_F3 0 chr1 10006 0 50M * 0 0 CTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCT
          BABBBB@ABB=BAAB@<BBB;@=BB?;A@B><7=7B>;>@9B@<97+B84 NH:i:508 CS:Z:T22301002301002301002301002301002301002301002301002
          1649_965_405_F3 16 chr1 10014 0 50M * 0 0 AACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAA +9==%'4587'1+:7@28957<5=7;6@2:=BAB:<?@AB<B<AA?BB@@ NH:i:511 CS:Z:T00320010320010320010320010320010320010320010300010
          1433_953_927_F3 16 chr1 10026 0 50M * 0 0 AACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAA '%:7+(6-;>%:4(<<8:=-:@268%>>644)::7>9;>B@@2?@A@B?A NH:i:511 CS:Z:T00320010320010320010320010320010320010320010320010
          1326_1211_1996_F3 0 chr1 10029 0 50M * 0 0 CCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCC
          <96BA6>7<?>/;6<?1482:41-)+1+466-+4752/6/8!;11/-)>1 NH:i:517 CS:Z:T20230100230100230100230100230100230100230100230100
          1379_1501_1111_F3 16 chr1 10047 0 50M * 0 0 CCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCC
          :%6=%!-2+7!%==<)!:1:4+)--8B6914:>1:/46:+;=:=@<</'> NH:i:517 CS:Z:T10010320010320010320010320010320010320010320010320
          1608_1356_225_F3 0 chr1 10048 0 50M * 0 0 CTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCT
          ?>B>@@:AB9>=?><@6B?8<><B;<;;<B</<?4@:5929B56/2)@@) NH:i:508 CS:Z:T22301002301002301002301002301002301002301002301002

          Comment

          • nilshomer
            Nils Homer
            • Nov 2008
            • 1283

            #6
            If you have fragment reads, then the following perl code should do it. Pipe the SAM file into it (or use "samtools view <in.bam>" for a BAM file). For paired end or multi-end reads, it does get trickier and the below will not keep the pairings. Note that your input SAM file does not have the CQ tag, and thus color qualities are lost.


            Code:
            #!/bin/perl
            use strict;
            use warnings;
            while(defined(my $line = <STDIN>)) {
                if($line =~ m/^@/) {
                    next;
                }
                chomp($line);
                my $NAME = $line;
                my $CS = $line;
                my $CQ = "";
                $NAME =~ s/^([^\t]+)\t.*/$1/;
                $CS =~ s/.*CS:Z:([^\t]+).*/$1/;
                $CS =~ tr/ /4/;
                if($line =~ m/CQ:Z:([^\t]+)/) {
                    $CQ = $1;
                }   
                else {
                    $CQ = "!" x (length($CS)-1); 
                }   
                print STDOUT "\@$NAME\n$CS\n+\n$CQ\n";
            }
            Nils

            Comment

            • nimmi
              Member
              • Jul 2010
              • 15

              #7
              Thanks Nils for the perl script.

              Just to summarize........I converted *.sam file to *.fastq using PICARD and this fastq file was in nucleotide space. When I ran localalign in bfast I got the "AlignColorSpaceGappedConstrained" error. Then I used perl script posted by Nils to convert *.sam to *.fastq in colorspace. Then re-ran the match command (*.bmf) followed by localalign and everything works fine!

              Thank you all for your suggestions and responses

              Comment

              Latest Articles

              Collapse

              • SEQadmin2
                Beyond CRISPR/Cas9: Understand, Choose, and Use the Right Genome Editing Tool
                by SEQadmin2



                CRISPR/Cas9 sparked the gene editing revolution for both research and therapeutics.1 But this system still showed severe issues that limited its applications. The most prominent were the heavy reliance on PAM sequences, delivery limitations, double-stranded breaks that prompt unintended edits and cell death, and editing inefficiency (both in targeting and in knock-in reliability).

                Despite this, “CRISPR helped turn genome editing from a specialized technique into
                ...
                07-31-2026, 11:01 AM
              • SEQadmin2
                Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
                by SEQadmin2


                Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

                The systematic characterization of the human proteome has
                ...
                07-20-2026, 11:48 AM
              • SEQadmin2
                Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
                by SEQadmin2



                Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
                ...
                07-09-2026, 11:10 AM

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by SEQadmin2, 08-03-2026, 10:13 AM
              0 responses
              15 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 07-31-2026, 02:55 AM
              0 responses
              32 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 07-24-2026, 12:17 PM
              0 responses
              23 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 07-23-2026, 11:41 AM
              0 responses
              21 views
              0 reactions
              Last Post SEQadmin2  
              Working...