transfer parameter to reader group in bwa mem command
1
0
Entering edit mode
2.8 years ago

Dear all, When I was calling variant using bwa mem command, the reader group was added by "@RG\tID:${IND}\tPL:illumina\tSM:${IND}". If the parameter ${IND} was set inner this script, this would be running correctly. But when I try to transfer an outer parameter by using $1 into $IND, it can not run. Here attached my script.

#! /bin/sh

IND=$1 
REF=~/reference/ref.fa
FORWARD=~/data/${IND}_1.fq.gz
REVERSE=~/data/${IND}_2.fq.gz
BAM=~/data/${IND}.sort.bam

bwa mem -M -t 10 "@RG\tID:${IND}\tPL:illumina\tSM:${IND}" ${REF} ${FORWARD} ${REVERSE} | samtools view -b -@ 10 | samtools sort -@ 10 -T ${IND} > ${BAM}

Tip: If I removed this options "@RG\tID:${IND}\tPL:illumina\tSM:${IND}". This script could run correctly so that I'm sure there must be something incorrect in this sentence.

Anybody help?

Thank you

bwa • 697 views
ADD COMMENT
0
Entering edit mode
2.8 years ago

the -R is missing.

   -R STR        read group header line such as '@RG\tID:foo\tSM:bar' [null]
ADD COMMENT
0
Entering edit mode

OMG Thank you very much

ADD REPLY

Login before adding your answer.

Traffic: 2520 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