I'm trying to modify a perl script. Here is the part I am trying to modify:
Original:
system ("tblastn -db $BLASTDB -query $TMP/prot$$.fa \\
-word_size 6 -max_target_seqs 5 -seg yes -num_threads $THREADS -lcase_masking \\
-outfmt \"7 sseqid sstart send sframe bitscore qseqid\"\\
> $TMP/blast$$") && die "Can't run tblastn\n";
I am trying to replace the system ("tblastn.....") with the following:
system ("cat $TMP/prot$$.fa | parallel --block 50k --recstart '>' --pipe \\ tblastn -db $BLASTDB -query - -word_size 6 -outfmt \'7 sseqid sstart send sframe bitscore qseqid\' -max_target_seqs 5 -seg yes -lcase_masking > $TMP/blast$$") && die "Can't run tblastn\n";
This replaces the normal tblastx program with GNU parallel, which pipes the tblastx command. Running the above command in bash (replacing the temp inputs with actual files) works perfectly, but when the perl script tries executing it, the error log (for tblastx) says it terminated too soon, after sseqids. The same error happens if you run the same command without the escape characters in bash.
Because of this I'm assuming the error is due to the single quote around the "7 ssequids sstart..." is not being parsed properly. I'm not sure how to do nested quotes properly in perl. I thought I was doing it right since it works via bash but not via the perl script. I looked at alot of perl documentation and everything says that the escape character \ should work with quotes or double quotes., yet for my instance it doesn't work.
Can someone provide input on why the quotes are not being processed?