Question: Mimic input file with string
0
gravatar for Bastien Hervé
11 months ago by
Bastien Hervé4.2k
Limoges, CBRS, France
Bastien Hervé4.2k wrote:

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 • 279 views
ADD COMMENTlink modified 11 months ago by Pierre Lindenbaum120k • written 11 months ago by Bastien Hervé4.2k
3
gravatar for Pierre Lindenbaum
11 months ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum120k wrote:
echo -e  "chr1\t5\t10" |  bedtools getfasta -fi genome.fa -bed - -fo output.fa
ADD COMMENTlink modified 11 months ago • written 11 months ago by Pierre Lindenbaum120k
1

I was thinking about something like this, thanks !

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

ADD REPLYlink modified 11 months ago • written 11 months ago by Bastien Hervé4.2k
1

fixed thxs

ADD REPLYlink written 11 months ago by Pierre Lindenbaum120k
2
gravatar for microfuge
11 months ago by
microfuge1.1k
microfuge1.1k wrote:

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

ADD COMMENTlink modified 11 months ago • written 11 months ago by microfuge1.1k

Absolutly ! Thanks a lot

ADD REPLYlink written 11 months ago by Bastien Hervé4.2k
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: 998 users visited in the last hour