for sample in *.sam
do
echo $sample
describer=$(echo ${sample} | sed ‘s/.sam//’)
echo $describer
do
echo $sample
describer=$(echo ${sample} | sed ‘s/.sam//’)
echo $describer
# Convert file from SAM to BAM format
samtools view -b $sample > ${describer}.uns.bam
samtools view -b $sample > ${describer}.uns.bam
# Sort BAM file
samtools sort ${describer}.uns.bam ${describer}
samtools sort ${describer}.uns.bam ${describer}
# index the bam file
samtools index ${describer}.bam
samtools index ${describer}.bam
# Remove intermediate files
rm ${describer}.uns.bam
done
rm ${describer}.uns.bam
done
No comments:
Post a Comment