gravatar for valastesolutions

2 hours ago by


I am writing a bash script to call variants in RNA-seq data. At some point, I want to select only ready reads corresponding to a specific genomic region using bedtools intersect and redirect the output to a smaller BAM file more amenable for variant calling. I have used following command for this:

bedtools intersect -wa -a $1 -b $2 > KRAS_s$1

with $1 and $2 taking BAM and BED files from standard input respectively. However, this does not seem to work properly as the output file is created but contains no reads. Running this command outside the bash script delivers the desired result, so the problem does not seem to be software related. I have done some reading, and think the problem relates to ">", but I am not sure how to fix it. Can anyone help? Thanks


Source link