I'm trying to run samtools sort in a folder containing about 380 bam files.
I've tried the following command and nothing happens. No errors, it just returns blank. Can anyone help me with what I've done wrong? Thank you :)
samtools sort -@ 7 *.bam > *.sorted.bam
Seems to be working, hasn't thrown out an error! thanks alot!!
I modified a bit based on Medhat's script. Seems better. for f in *.bam; do samtools sort -@ 7 $f ${f/bam/sorted}; done
hi all, I am working Linux cluster and ı have 1000 bam files under bam/ directory and they have pretty similar name "bam_runid_bf2ff0593235864c9d423d28f1746a42d62df29e_0_0" and just first "0" changing into folder like 1,2,3,.. I am wondering how can ı sort them as a single and merge them after indexing. I tried "for f in bam/*_0.bam; do samtools sort -@ 7 $f ${f/bam/sorted}; done" what u advised but it did not worked. sorry ı am very new in this field .:( could you explain to me more simple? thanks
post this as a new question with a reference to this thread. Show us any error message.