diff --git a/.gitignore b/.gitignore index 8215a70..4c68590 100644 --- a/.gitignore +++ b/.gitignore @@ -10,9 +10,10 @@ 05.reduce_redundancy/* 05.orthology_inference/* 06.phylogeny_reconstruction/* +10.plastid/* 98.results/* 99.scripts/bucky/ 99.scripts/phyparts/ -run.status +run.status.json !*/_description.md tmp/ diff --git a/99.scripts/workflow/plastid/01.mapping.sh b/99.scripts/workflow/plastid/01.mapping.sh new file mode 100755 index 0000000..1d394c7 --- /dev/null +++ b/99.scripts/workflow/plastid/01.mapping.sh @@ -0,0 +1,18 @@ +#! /bin/bash +set -e +THREADS=${THREADS:-6} +if [ "$#" -ne 4 ]; then + echo "Usage: $0 " + exit 1 +fi + +ref=$1 +fq1=$2 +fq2=$3 +out=$4 +outdir=$(dirname "$out") +mkdir -p "$outdir" +hisat2 -p "$THREADS" --dta -x "$ref" -1 "$fq1" -2 "$fq2" -S "${out}.sam" +samtools view -b -@ "$THREADS" "${out}.sam" | samtools sort -@ "$THREADS" -o "${out}.sorted.bam" --write-index +rm "${out}.sam" +echo "Mapping completed. Sorted BAM file is at ${out}.sorted.bam" diff --git a/99.scripts/workflow/plastid/mapping.sh b/99.scripts/workflow/plastid/mapping.sh deleted file mode 100644 index 2f01d25..0000000 --- a/99.scripts/workflow/plastid/mapping.sh +++ /dev/null @@ -1,15 +0,0 @@ -#! /usr/bash -if [ "$#" -ne 5 ]; then - echo "Usage: $0 " - exit 1 -fi -ref=$1 -fq1=$2 -fq2=$3 -outdir=$4 -stem=$5 -mkdir -p "$outdir" -hisat -p 4 --dta -x "$ref" -1 "$fq1" -2 "$fq2" -S "${outdir}/${stem}.sam" -samtools view -b -@ 4 "${outdir}/${stem}.sam" | samtools sort -@ 4 -o "${outdir}/${stem}.sorted.bam" --write-index -rm "${outdir}/${stem}.sam" -echo "Mapping completed. Sorted BAM file is at ${outdir}/${stem}.sorted.bam"