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 .I generate a snakefile. When I try dry run with snakemake -n
this error is shown
SyntaxError in line 2 of /cluster/lrcfs/2397405/projects/nanopore_testing/data/remoratrial/Snakefile: invalid syntax
When I type in working node same command samtools options are pop up my screen :( could you explain to me more simple? Thanks
Your
samtools sort
syntax is incorrect. it should be as follows (assuming rest of your loop is working as expected).If there is
snakemake
involved (code for which you have not shown above) then there may be more to this than justsamtools
syntax.Should it be
${f/.bam/.sorted.bam}
instead?