From e8ba2ed962e91fba8a611cf7e500966c259291a8 Mon Sep 17 00:00:00 2001 From: IvisTang Date: Wed, 17 Dec 2025 23:27:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitignore=EF=BC=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20run.status.json=EF=BC=9B=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=97=A7=E7=9A=84=20mapping.sh=20=E8=84=9A=E6=9C=AC=E5=B9=B6?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=B0=E7=9A=84=2001.mapping.sh=20?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- 99.scripts/workflow/plastid/01.mapping.sh | 18 ++++++++++++++++++ 99.scripts/workflow/plastid/mapping.sh | 15 --------------- 3 files changed, 20 insertions(+), 16 deletions(-) create mode 100755 99.scripts/workflow/plastid/01.mapping.sh delete mode 100644 99.scripts/workflow/plastid/mapping.sh 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"