Samtools faidx problem
2
1
Entering edit mode
6.9 years ago

Hello everyone,

I am interested in a sequence ranging from 111614 to 111868 in a fasta sequence (scaffold sequence)

I am trying to use samtools faidx to tkae this sequence but it doesn't work and keep returning me :

[fai_fetch] Warning - Reference 111-555 not found in FASTA file, returning empty sequence

After seeing some other users with the same problems, i tried to change the header name for it to contain no space (like ">scaffoldX") but it still doesn't work

Here is the exact command I type (my fasta file only contain the sequence of my scaffold) :

samtools faidx scaffold.fasta 111614-111868

Thanks a lot for your help.

sequence genome samtools faidx fasta • 6.8k views
ADD COMMENT
0
Entering edit mode

If someone know an other way to simply extract a sequence from pos X to Y in a fasta file, i am interested ! Thanks ^^

ADD REPLY
2
Entering edit mode
6.9 years ago
cmdcolin ★ 4.0k

Shouldn't it be "samtools faidx scaffold.fasta scaffoldX:111614-111868"?

ADD COMMENT
1
Entering edit mode

It worked !! Thanks a lot ! I feel so stupid now

ADD REPLY
0
Entering edit mode

The same issue probably explains why bedtools didn't work.

I have moved the comment of cmdcolin to an answer so you can accept it to mark this thread as solved.

ADD REPLY
2
Entering edit mode
6.9 years ago

This sounds like a job for bedtools getfasta.

ADD COMMENT
0
Entering edit mode

Sounds awesome, going to check it, thanks !

ADD REPLY
0
Entering edit mode

It doesn't seems to work better ...

bedtools getfasta -fi scaffold.fasta -bed test.bed > result_test

Result : nothing ...

ADD REPLY
0
Entering edit mode

I have no idea how the chromosome identifier of your fasta file looks like, and how you formatted your bed file. As such you are making it rather hard to troubleshoot.

ADD REPLY

Login before adding your answer.

Traffic: 1652 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6