Entering edit mode
10 months ago
kabir.deb
▴
90
Hi,
I'm trying Varscan2
for the first time. However, I'm wondering how can I save the outcome of Varscan in different output vcf files as per the name of BAM files.
#!/bin/bash
#SBATCH --clusters=Cluster # Select which system(s) to use
#SBATCH --partition=parti # Partition (job queue)
#SBATCH --job-name=SamVarscan_var # Assign an short name to your job
#SBATCH --cpus-per-task=1 # Cores per task (>1 if multithread tasks)
#SBATCH --mem=50000 # Real memory (RAM) required (MB)
#SBATCH --time=12:00:00 # Total run time limit (HH:MM:SS)
#SBATCH --output=SamVarscan.%N.%j.out # STDOUT output file
fids="DNA1 DNA2 DNA3 DNA4"
#Directories
DATADIR="/projects/foran/SDLab/DK/SumayyaDat/cfDNA/Work/BAM_file/latest_BAM"
REF="/scratch/dk1187/Rdata/RefHu/btindx/GRCh38_chr.fa"
VARSCAN="/home/dk1187/.conda/envs/VarScan2_env/bin/varscan"
for fid in $fids
do
time srun samtools mpileup -f $REF ${DATADIR}/${fid}_aln.sort.rmdup2.bam | $VARSCAN pileup2snp --output-vcf 1 --vcf-sample-list $fids ${DATADIR}/${fid}_varscan.vcf
done;
I'm expecting that output will separately saved at DATADIR
by the name DNA1_varscan.vcf
, DNA2_varscan.vcf
so on. But, the output data is stored at the SamVarscan.%N.%j.out
file. How can I overcome this issue.
Thanks.
Why are you using srun from within an sbatch file? Just run
samtools mpileup ...
- unless you really need thetime
, in which case, add thetime
. Skip thesrun
, it doesn't make any sense.