Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have ten .bam files (bioinformatic format) and I would like to convert it to 10 .bed files, but for this conversion I need to use special command

bedtools bamTobed -i (input file) > output file.bed
share|improve this question

1 Answer 1

up vote 1 down vote accepted

Your question is not very clear, but maybe this shell command helps.

for x in *.bam; do
    bedtools bamTobed -i "$x" >"${x%.bam}.bed"
done
share|improve this answer
    
It works, thank you so much –  user48932 Oct 10 '13 at 13:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.