Question: Error : Could not build fai index
0
gravatar for manubiomed20
8 months ago by
manubiomed2010
manubiomed2010 wrote:

USED ​​BWA VERSION 0.7 FOR INDEX.

soon after I used the command samtools faidex and got the following message:

Could not build fai index.

I noticed a fasta.sa file that in no other indexing before this one was generated and fa.fai was not generated.

How can I solve this problem?

bwa samtools • 844 views
ADD COMMENTlink modified 8 months ago • written 8 months ago by manubiomed2010

Hello,

please take some more time to present your post better. Using the format bar and choose the right post tags are some of the easy action. This time I've done it for you.

Could you please post the exact command you were using? Also the output of head your.fa would be useful for us.

Thanks.

fin swimmer

ADD REPLYlink modified 8 months ago • written 8 months ago by finswimmer13k

Is this the whole error message or just a part of it?

ADD REPLYlink written 8 months ago by Benn7.9k

I used this command:

bwa index /home/ims.santos06/Ref_crhumano/GRCh38.chr.11.fa.gz


   [bwa_index] Pack FASTA... 2.33 sec
    [bwa_index] Construct BWT for the packed sequence...
    [BWTIncCreate] textLength=270173244, availableWord=31010396
    [BWTIncConstructFromPacked] 10 iterations done. 51153116 characters processed.
    [BWTIncConstructFromPacked] 20 iterations done. 94501340 characters processed.
    [BWTIncConstructFromPacked] 30 iterations done. 133025356 characters processed.
    [BWTIncConstructFromPacked] 40 iterations done. 167261564 characters processed.
    [BWTIncConstructFromPacked] 50 iterations done. 197686764 characters processed.
    [BWTIncConstructFromPacked] 60 iterations done. 224724716 characters processed.
    [BWTIncConstructFromPacked] 70 iterations done. 248752076 characters processed.
    [BWTIncConstructFromPacked] 80 iterations done. 270103628 characters processed.
    [bwt_gen] Finished constructing BWT in 81 iterations.
    [bwa_index] 81.98 seconds elapse.
    [bwa_index] Update BWT... 1.04 sec
    [bwa_index] Pack forward-only FASTA... 1.75 sec
    [bwa_index] Construct SA from BWT and Occ... 29.60 sec
    [main] Version: 0.7.17-r1188
    [main] CMD: bwa index /home/ims.santos06/Ref_crhumano/GRCh38.chr.11.fa.gz
    [main] Real time: 119.622 sec; CPU: 116.702 sec

and then I used the command:

samtools faidx /home/ims.santos06/Ref_crhumano/GRCh38.chr.11.fa.gz
[E::fai_build3_core] Cannot index files compressed with gzip, please use bgzip
[faidx] Could not build fai index /home/ims.santos06/Ref_crhumano/GRCh38.chr.11.fa.gz.fai
ADD REPLYlink modified 8 months ago by finswimmer13k • written 8 months ago by manubiomed2010

I got these files:

    GRCh38.chr.11.fa.gz.ann  GRCh38.chr.11.fa.gz.sa
    GRCh38.chr.11.fa.gz      GRCh38.chr.11.fa.gz.bwt  GRCh38.chr.20.fa.gz
    GRCh38.chr.11.fa.gz.amb  GRCh38.chr.11.fa.gz.pac
ADD REPLYlink written 8 months ago by manubiomed2010

Do not add an answer unless you're answering the top level post. Please delete this comment and add it as a reply at the appropriate location.

ADD REPLYlink written 8 months ago by RamRS26k
2
gravatar for finswimmer
8 months ago by
finswimmer13k
Germany
finswimmer13k wrote:

Much better these information.

samtools is complaining about the way your fasta file compressed. You have to use bgzip instead of gzip

$ bgzip -c input.fa > output.fa.gz

Or uncompress the wrong compressed file and recompress with the correct program

$ zcat GRCh38.chr.11.fa.gz | bgzip -c > output.fa.gz
ADD COMMENTlink written 8 months ago by finswimmer13k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1063 users visited in the last hour