user3234810 user3234810 - 6 months ago 62
Perl Question

command line compliation error

Running into some problems with a one liner....

ls *.fq.gz | cut -f 1 -d . | uniq | perl -pe 'chomp; system "bwa-0.7.9a mem -M /refs/GATK_bundle_2.3//human_g1k_v37.fasta -R'@RG\tID:Foo\tSM:bar' $_.1.fq.gz $_.2.fq.gz > $_.sam"'


Output is

[E::bwa_set_rg] the read group line is not started with @RG
CLMP10920-1[E::bwa_set_rg] the read group line is not started with @RG
CLMP10920-2[E::bwa_set_rg] the read group line is not started with @RG
CLMP10920-3[E::bwa_set_rg] the read group line is not started with @RG
CLMP10920-4W[E::bwa_set_rg] the read group line is not started with @RG
COL1A110908-1[E::bwa_set_rg] the read group line is not started with @RG
COL1A110908-2[E::bwa_set_rg] the read group line is not started with @RG
COL1A110908-3[E::bwa_set_rg] the read group line is not started with @RG
COL1A110908-4Wgleadalln@mgcl01:~/testing/analysis$


Done some reading around but struggling to find a solution for running this command - think it has something to do with the nested ' in the -R option part of the command.... is there any way to escape these?

Answer

Perl doesn't have a sys function. Did you mean system?

Also, the syntax highlighter is correct about quotes. The signle quote in R'@RG ends the first single quoted string, which doesn't seem right.

Comments