This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Regions got skipped due to length

i am using command "bedtools getfasta __.fa -bed ___.bed -fo __.fa " but some regions got skipped due to beyond length. What can be the solution for this? Thank you very much

getfasta bedtools

1 answer

not tested:

samtools faidx in.fasta
awk '{printf("%s\t0\t%s\n",$1,$2);}' in.fasta.fai | sort -t $'\t' -k1,1 -k2,2 > bounds.bed
bedtools intersect  -a ___.bed -b bounds.bed > new.bed
"bedtools getfasta __.fa -bed new.bed -fo __.fa

Log in to answer this question.