Entering edit mode
2.5 years ago
Korsocius
▴
260
I would like to find all .bam files in subfolders and exec it with samtools. Concretely conversion of bam to cram to same folder and after conversion remove all bam files.
I tried:
find . -maxdepth 3 -name *bam -exec samtools view -Ch -T Path/to/reference/ -@ 5 -o {.}.cram {} \;
But it is creating only one file into folder, where are the script running, not in subfolders. And how to combine with removing files? Thank you