I have an R script that I am trying to run on several samples in my dataset. The script is called as such, inside a bash script:
cv_1=$1
cv_2=$2
tumor=$3
normal=$4
out=$5
sample=$(basename $tumor | cut -d'.' -f1)
cnv_facets.R -n ${normal} -t ${tumor} -o ${out}/${sample}.${cv_1}_${cv_2} --cval ${cv_1} ${cv_2} -vcf /path/to/00-common_all.vcf.gz -g hg19
I call the script as such:
while read -r line; do tumor=$(echo $line | cut -d',' -f1); normal=$(echo $line | cut -d',' -f2); echo $tumor; echo $normal; sbatch /path/to/scripts.sh 15 25 /path/to/$tumor /path/to/$normal ${PWD} ; done < input.csv
where input.csv is as such:
file1.bam,file2.bam
file3.bam,file4.bam
...
However, I get this error and I don't know why:
File "<stdin>", line 68
args = parser.parse_args(['-n', 'file2.bam
^
SyntaxError: EOL while scanning string literal
Warning message:
In if (grepl("^\\{", output)) { :
the condition has length > 1 and only the first element will be used
I'm not sure if bash parsing of the lines either adds or removes special characters at the end of the line?