How to save the output of VARSCAN results in different vcf names?
1
0
Entering edit mode
7 weeks ago
kabir.deb ▴ 80

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.

snv slurm output varscan • 284 views
ADD COMMENT
0
Entering edit mode

Why are you using srun from within an sbatch file? Just run samtools mpileup ... - unless you really need the time, in which case, add the time. Skip the srun, it doesn't make any sense.

ADD REPLY
0
Entering edit mode
7 weeks ago
kabir.deb ▴ 80

Sorry for asking such a silly question. By adding > this issue is resolved.

ADD COMMENT

Login before adding your answer.

Traffic: 1893 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6