This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Mimic input file with string

Hello,

That could be a simple question, I try to mimic an input file using simple string. An exemple with bedtools.

bedtools getfasta -fi genome.fa -bed test.bed -fo output.fa

With in test.bed :

chr1    5    10

I would like to do something lile this :

bedtools getfasta -fi genome.fa -bed 'chr1\t5\t10' -fo output.fa

I try to echo my string but this failed. Any ideas ? Thanks

bedtools

2 answers

echo -e  "chr1\t5\t10" |  bedtools getfasta -fi genome.fa -bed - -fo output.fa

I was thinking about something like this, thanks !

NB : typo on "'chr1\t5\t10" should be "chr1\t5\t10"

Would this work ? bedtools getfasta -fi genome.fa -bed <(echo chr1$'\t'5$'\t'10)

Log in to answer this question.