|
|
|
|
|
|
|
|
set -e |
|
|
set -e |
|
|
nt=$(nproc) |
|
|
nt=$(nproc) |
|
|
/opt/conda/bin/samtools view -@ $nt -bS ${sam} > ${bam} |
|
|
/opt/conda/bin/samtools view -@ $nt -bS ${sam} > ${bam} |
|
|
/opt/conda/bin/samtools sort -@ $nt -m 2GiB ${bam} -o ${sorted_bam} |
|
|
|
|
|
|
|
|
/opt/conda/bin/samtools sort -@ $nt -m 1000000000 ${bam} -o ${sorted_bam} |
|
|
/opt/conda/bin/samtools index -@ $nt ${sorted_bam} |
|
|
/opt/conda/bin/samtools index -@ $nt ${sorted_bam} |
|
|
/opt/conda/bin/samtools stats -@ $nt ${sorted_bam} > ${samstats} |
|
|
/opt/conda/bin/samtools stats -@ $nt ${sorted_bam} > ${samstats} |
|
|
/opt/conda/bin/samtools stats -@ $nt -i ${insert_size} ${sorted_bam} |grep ^IS|cut -f 2- > ${ins_size} |
|
|
/opt/conda/bin/samtools stats -@ $nt -i ${insert_size} ${sorted_bam} |grep ^IS|cut -f 2- > ${ins_size} |