WGLab / w4CSeq

web server of 4C-Seq data analysis pipeline
Other
3 stars 7 forks source link

Error in args[12] #1

Closed chadi-elfarran closed 8 years ago

chadi-elfarran commented 8 years ago

Greetings to you.

Thank you for creating this extremely useful tool.

I am using the 4C_enzyme_cmdline.R to do the analysis. The tool runs smoothly until it merges the bam files and creates the UCSC_view.bed. The following error appears:

Error in args[12] : object of type 'closure' is not subsettable Calls: system -> paste

I think the error is coming from this part of the code: system(paste("sed -i '1s/^/browser position ", bait_ch, ":", as.numeric(bait_st)-10000, "-", as.numeric(bait_en)+10000, "\nbrowser hide all\nbrowser pack refGene encodeRegions\ntrack type=bedGraph name=\"4C signal (raw reads) (", args[12], ")\" description=\"4C read counts\" db=", build, " visibility=2 color=0,0,0 useScore=1 alwaysZero=on\n/' UCSC_view.bed", sep=""))

Can you kindly help me rectify this error.

Thank you

nuoyazhou2 commented 8 years ago

Hi,

The error is fixed now, with code updated. Please download the latest version, or you can substitute the "args[12]" to "exp_name" in your local 4C_enzyme_cmdline.R code. Thanks a lot for your information.

Best.

On Mon, Aug 15, 2016 at 7:47 PM, chadi-elfarran notifications@github.com wrote:

Greetings to you.

Thank you for creating this extremely useful tool.

I am using the 4C_enzyme_cmdline.R to do the analysis. The tool runs smoothly until it merges the bam files and creates the UCSC_view.bed. The following error appears:

Error in args[12] : object of type 'closure' is not subsettable Calls: system -> paste

I think the error is coming from this part of the code: _system(paste("sed -i '1s/^/browser position ", bait_ch, ":", as.numeric(bait_st)-10000, "-", as.numeric(bait_en)+10000, "\nbrowser hide all\nbrowser pack refGene encodeRegions\ntrack type=bedGraph name=\"4C signal (raw reads) (", args[12], ")\" description=\"4C read counts\" db=", build, " visibility=2 color=0,0,0 useScore=1 alwaysZero=on\n/' UCSCview.bed", sep=""))

Can you kindly help me rectify this error.

Thank you

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_WGLab_w4CSeq_issues_1&d=DQMCaQ&c=clK7kQUTWtAVEOVIgvi0NU5BOUHhpN0H8p7CSfnc_gI&r=rmADQazHldllb-vF1IdPBw&m=t_bg3kyQkh3TG-U1_vhcWNU8jap9aPkUmpGZiAqG4Jg&s=Xw0w3iRGqoV5HQv6JaTiUtylnkrtb4lZb1ykvHey2h0&e=, or mute the thread https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AOhFi-2DxvvNxnuYf2hrKT3yaiJYIbtjHvks5qgSS9gaJpZM4Jk-2Dt4&d=DQMCaQ&c=clK7kQUTWtAVEOVIgvi0NU5BOUHhpN0H8p7CSfnc_gI&r=rmADQazHldllb-vF1IdPBw&m=t_bg3kyQkh3TG-U1_vhcWNU8jap9aPkUmpGZiAqG4Jg&s=489PvVhNs9JSKzDQJIr2GRacdh7T2e3EFXKmSy8QmG8&e= .

chadi-elfarran commented 8 years ago

Hi nuoyazhou2,

Thank you for your reply and all the effort. The pipeline is now working smoothly. I had to do the following additional steps (after downloading the latest version) to make it work completely:

1- I had to change the header in the file "count_sites_binomial.pl" into "#!/usr/bin/perl".

2- I had to change the path in line 6 of the "count_sites_binomial.pl" into the directory in which perl modules are installed.

3- I had to download the "cytoBands.txt.gz" manually from UCSC and place it in the corresponding lib folder.

It will be great if these issues could be rectified in the code itself or by noting the users in the documentation.

I would like to thank you once again for all the effort in creating this helpful tool for analyzing 4C-Seq data.

Best Regards,

nuoyazhou2 commented 8 years ago

Hi Chadi-elfarran,

Thanks a lot for your feedback. We have now added in the documentation, noting users to specify the interpreter and module directory (as different users might have their own interpreters and modules directories).

As for the 3rd point, you don't need to download the "cytoBands.txt.gz". We use function from R package "quantsmooth", which automatically includes the cytobands info for hg19/hg18/mm10. We have added "cytoBands.txt.gz" for mm9 manually. So you don't have to download files manually yourself.

Thanks a lot for helping us improve the tool.

Best regards,

On Tue, Aug 16, 2016 at 3:05 AM, chadi-elfarran notifications@github.com wrote:

Hi nuoyazhou2,

Thank you for your reply and all the effort. The pipeline is now working smoothly. I had to do the following few steps to make work completely:

1- I had to change the header in the file "count_sitesbinomial.pl" into "#!/usr/bin/perl"_.

2- I had to change the path in line 6 of the "count_sites_binomial.pl" into the directory in which perl modules are installed.

3- I had to download the "cytoBands.txt.gz" manually from UCSC and place it in the corresponding lib folder.

It will be great if these issues could be rectified in the code itself or by noting the users in the documentation.

I would like to thank you once again for all the effort in creating this helpful tool for analyzing 4C-Seq data.

Best Regards,

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_WGLab_w4CSeq_issues_1-23issuecomment-2D240060571&d=DQMFaQ&c=clK7kQUTWtAVEOVIgvi0NU5BOUHhpN0H8p7CSfnc_gI&r=rmADQazHldllb-vF1IdPBw&m=Qq-EZ7LSf6boSO5E4QFl3xMbCPhEKPjMliX9etMyoGM&s=z8bB1u4OaI1Zc26kzgUGsOYZ6t08tG6r_-PIzngqpaI&e=, or mute the thread https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AOhFi5sTsGLtQdNXzBZkCcM3A3suMxoEks5qgYuFgaJpZM4Jk-2Dt4&d=DQMFaQ&c=clK7kQUTWtAVEOVIgvi0NU5BOUHhpN0H8p7CSfnc_gI&r=rmADQazHldllb-vF1IdPBw&m=Qq-EZ7LSf6boSO5E4QFl3xMbCPhEKPjMliX9etMyoGM&s=4tzCRDgsr0wmVZpbpzZK96ttuVnQ3bVMMCD4w0dGwuU&e= .

tamerawwad commented 5 years ago

Hi nuoyazhou2, i am trying to run the code but sonehow it gives me an error message when running the following command:

if (grepl("^chr(\\d{1,2}|X|Y)$", bait_ch)) {
    system(paste("sed -i '1s/^/browser position", bait_ch, ":", as.numeric(bait_st)-10000, "-", as.numeric(bait_en)+10000, "\\nbrowser hide all\\nbrowser pack refGene encodeRegions\\ntrack type=bedGraph name=\"4C signal (raw reads) (", exp_name, ")\" description=\"4C read counts\" db=", build, " visibility=2 color=0,0,0 useScore=1 alwaysZero=on\\n/' UCSC_view.bed", sep=""))
} else {
    system(paste("sed -i '1s/^/browser position", "chr1", ":1-10000000\\nbrowser hide all\\nbrowser pack refGene encodeRegions\\ntrack type=bedGraph name=\"4C signal (raw reads) (", exp_name, ")\" description=\"4C read counts\" db=", build, " visibility=2 color=0,0,0 useScore=1 alwaysZero=on\\n/' UCSC_view.bed", sep=""))    
}

the error message says: sed: 1: "UCSC_view.bed": invalid command code U

what could possibly be wrong? many many thanks Tamer