Trouble with bedtools getfasta

Trouble with bedtools getfasta

0

I am trying to extract sequences from a .fasta file based on a bed file using bedtools getfasta and I am getting the following error.

The command run was the following:

bedtools getfasta -fi genomic.fasta -bed bedfile.bed -fo output.fasta
WARNING. chromosome (chr1) was not found in the FASTA file. Skipping

This occurs for each sequence contained within my bed file when bedtools attempts to create the index file. I know a lot of people have had this issue and I have tried to use the response to fix the issue myself, but am unable to figure it out. I know for the most part the issue is a mismatch between the chromosome names in the bed file and the fasta file. As far as I can determine, my identifiers are identical and I cannot for the life of me figure out the issue. It is almost certainly something very simple.

My bed file head:

chr1    4309600 4309825
chr1    4310021 4310350
chr1    4310471 4310646
chr1    4310766 4311096
chr1    4311250 4311471
chr1    4311750 4312141
chr1    4312150 4312471
chr1    4312496 4312841
chr1    4312846 4313421
chr1    4313566 4314216

Chromosome identifiers from the fasta file by running:

grep -o -E "^>w+" "my_genomic.fna" | tr -d ">"

chr1   
chr1A   
chr2   
chr3   
chr4   
chr4A   
chr5   
chr6   
...   
chrZ   
chrW

I have opened up both files with simple text editors to make sure I had not added additional spaces or miscellaneous characters and they are the same.

Hoping this is and easy fix. Thanks in advance for any help.


indexfile


getfasta


bedtools

• 243 views

Read more here: Source link