Error in ngs.plot.r

369 views
Skip to first unread message

Federico Gaiti

unread,
Oct 30, 2014, 7:36:35 PM10/30/14
to ngsplot...@googlegroups.com
Hi,

I installed ngs.plot as per instructions and install the Aqu1 supported genome. This step worked fine. 

When using ngs.plot.r I get this:

ngs.plot.r -G Aqu1 -R tss -C H3K4me3_PE_fixed_sorted.bam -O H3K4me3_PE.tss -T H3K4me3_PE -FL 300 -RB 0.05
Configuring variables...
Using database:
/hox/u/uqfgaiti/Tools/ngsplot/database/Aqu1/Aqu1.ensembl.genebody.protein_coding.RData
Done
Loading R libraries.....Done
Analyze bam files and calculate coverage.Error in { :
task 1 failed - "no applicable method for 'within' applied to an object of class "NULL""
Calls: covMatrix -> %dopar% -> <Anonymous>
Execution halted

I already changed the chromosome name in the header bam file using samtools reheader from Contig1000 to chrContin1000 for example. 

I re-installed R and the required packages and re-installed ngs.plot again. Still getting the same error. 

Any clue on what's going on?

Thanks
Federico

Li Shen

unread,
Oct 30, 2014, 9:36:00 PM10/30/14
to ngsplot-discuss
This error is being reported a lot recently. It seems to be related with the Rsamtools package that ngs.plot depends. Some user reported that its folder is locked and is not upgraded with R. So you need to make sure it is upgraded with your R installation and then try again.

Li


--
You received this message because you are subscribed to the Google Groups "ngsplot-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngsplot-discu...@googlegroups.com.
To post to this group, send email to ngsplot...@googlegroups.com.
Visit this group at http://groups.google.com/group/ngsplot-discuss.
To view this discussion on the web visit https://groups.google.com/d/msgid/ngsplot-discuss/3265659a-5c9d-445d-ba42-4f52d16f10d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Li Shen, Ph.D. Computer Science
Assistant Professor
Department of Neuroscience
Icahn School of Medicine at Mount Sinai
New York, NY 10029
#################
ngs.plot - the coolest NGS plotting tool: https://code.google.com/p/ngsplot/
Want ChIP-seq differential analysis? Use: https://code.google.com/p/diffreps/

Federico Gaiti

unread,
Oct 30, 2014, 10:18:29 PM10/30/14
to ngsplot...@googlegroups.com
Hi Li,

so I tried to re-instelled Rsamtools (this should install the latest version I guess) and this is what I get at the end: 

* R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (Rsamtools)

The downloaded source packages are in
‘/tmp/Rtmp58C4Ln/downloaded_packages’
Warning message:
installed directory not writable, cannot update packages 'boot', 'class',
  'cluster', 'codetools', 'KernSmooth', 'MASS', 'mgcv', ‘nlme'

It seems I have the same problem as previous users, some packages cannot be updated. Do you think that is this the problem why ngs.plot.r is not working? 

Sorry I have really limited experience in bioinformatics.

Thanks for help
Federico

You received this message because you are subscribed to a topic in the Google Groups "ngsplot-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ngsplot-discuss/fkopYEhXUXw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ngsplot-discu...@googlegroups.com.

To post to this group, send email to ngsplot...@googlegroups.com.
Visit this group at http://groups.google.com/group/ngsplot-discuss.

Li Shen

unread,
Oct 30, 2014, 10:22:11 PM10/30/14
to ngsplot-discuss
Those packages are installed under system directory and you need administrative privilege to upgrade them. But I doubt it is related. Have you tried ngs.plot again?


For more options, visit https://groups.google.com/d/optout.

Federico Gaiti

unread,
Oct 30, 2014, 10:29:01 PM10/30/14
to ngsplot...@googlegroups.com
Yes. Got this again:

ngs.plot.r -G Aqu1 -R tss -C H3K4me3_PE_fixed_sorted.bam -O H3K4me3_PE.tss -T H3K4me3_PE -FL 300 -RB 0.05
Configuring variables...
Using database:
/hox/u/uqfgaiti/Tools/ngsplot/database/Aqu1/Aqu1.ensembl.genebody.protein_coding.RData
Done
Loading R libraries.....Done
Analyze bam files and calculate coverage.Error in { :
  task 1 failed - "no applicable method for 'within' applied to an object of class "NULL""
Calls: covMatrix -> %dopar% -> <Anonymous>
Execution halted

Federico

pranitha vangala

unread,
Oct 31, 2014, 2:29:00 PM10/31/14
to ngsplot...@googlegroups.com
Hi Li

I too get the same error as federico. Below is my command and error

ngs.plot.r -G hg19 -R bed -E ~/Desktop/xxx.bed-C ~/Desktop/input.bam -O output_ngs -RB 0.05 -P 1


Configuring variables...Done

Loading R libraries.....Done

Analyze bam files and calculate coverage..................................................................................................................................................................................................Error in { : 

  task 1 failed - "no applicable method for 'within' applied to an object of class "NULL""

Calls: covMatrix -> %dopar% -> <Anonymous>

Execution halted

ningyi shao

unread,
Oct 31, 2014, 2:31:09 PM10/31/14
to ngsplot...@googlegroups.com
Hi Federico and Pranitha,

Would you mind telling us the version of R, ngs.plot, and Rsamtools?

Bests,
Ning-Yi

pranitha vangala

unread,
Oct 31, 2014, 2:41:36 PM10/31/14
to ngsplot...@googlegroups.com
Hi Ning-Yi

Im using R 3.1.1,ngs.plot 2.41.3, Rsamtools 1.18.1

Li Shen

unread,
Oct 31, 2014, 3:47:02 PM10/31/14
to ngsplot-discuss
Could this be due to the newest version of Rsamtools? This is my R session info:

> sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] parallel  stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
[1] Rsamtools_1.16.1     Biostrings_2.32.0    XVector_0.4.0       
[4] GenomicRanges_1.16.3 GenomeInfoDb_1.0.2   IRanges_1.22.9      
[7] BiocGenerics_0.10.0 

loaded via a namespace (and not attached):
[1] bitops_1.0-6    stats4_3.1.1    zlibbioc_1.10.0

my Rsamtools is older than yours.


For more options, visit https://groups.google.com/d/optout.

pranitha vangala

unread,
Oct 31, 2014, 4:01:27 PM10/31/14
to ngsplot...@googlegroups.com
Im not sure how to install the same version Rsamtools. When i try i get the below error


package ‘Rsamtools_1.16.1’ is not available (for R version 3.1.1) 

Federico Gaiti

unread,
Oct 31, 2014, 8:04:04 PM10/31/14
to ngsplot...@googlegroups.com
Hi,

I’m too using R 3.1.1, ngs.plot 2.41.3 and Rsamtools 1.18.

Thanks
Federico

Federico Gaiti

unread,
Nov 2, 2014, 4:18:14 AM11/2/14
to ngsplot...@googlegroups.com
Do you have any suggestion on how to install an older version of Rsamtools than 1.18.1? 

Thanks
Federico

On 1 Nov 2014, at 06:01, pranitha vangala <pranitha...@gmail.com> wrote:

Yu Zhou

unread,
Nov 3, 2014, 6:39:09 PM11/3/14
to ngsplot...@googlegroups.com
Hi,

I now have the same problem as in this thread, after upgrading several packages.

Configuring variables...
Using database:
/home/y6zhou/soft/bio/NGSplot/ngsplot/database/hg18/hg18.refseq.genebody.protein_coding.RData
Done
Loading R libraries.....Done
Analyze bam files and calculate coverage............................................................................................................................................................................................Error in { : 
  task 1 failed - "no applicable method for 'within' applied to an object of class "NULL""
Calls: covMatrix -> %dopar% -> <Anonymous>
Execution halted

R3.1.1, Rsamtools_1.18.1 

Any suggestion to solve this problem? Thanks a lot!

Best,
Yu

Federico Gaiti

unread,
Nov 4, 2014, 6:03:21 PM11/4/14
to ngsplot...@googlegroups.com
I tried again to re-install everything from scratch but still getting the same error. If the problem might be in Rsamtools 1.18.1., does anyone know how to install a precedent version? It seems that version 1.18.1 get installed automatically when using Bioconductor 3.0.

Thanks for help
Federico

Li Shen

unread,
Nov 5, 2014, 12:20:11 AM11/5/14
to ngsplot-discuss
Hi all, 

The problem has now been solved. It is caused by some recent upgrade in Bioconductor packages that changed the chromosome names in their internal data structures. 

Download the 2.41.4 version to fix the problem.

- Li


--
You received this message because you are subscribed to the Google Groups "ngsplot-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngsplot-discu...@googlegroups.com.
To post to this group, send email to ngsplot...@googlegroups.com.
Visit this group at http://groups.google.com/group/ngsplot-discuss.

For more options, visit https://groups.google.com/d/optout.

Federico Gaiti

unread,
Nov 5, 2014, 3:47:22 AM11/5/14
to ngsplot...@googlegroups.com
Thanks a lot Li. 

I tested it and it’s now working. I was able to make all the average profile plots for my marks. Though, do you have any idea why the heat map doesn’t work? I have attached the pdf here. 

My command was: ngs.plot.r -G Aqu1 -R genebody -C H3K4me3_SE_October_fixed_sorted.bam -O H3K4me3_SE_October.genebody -T H3K4me3_SE_October -FL 250 -RB 0.05

Thanks a lot for all the help
Federico

H3K4me3_SE_October.genebody.heatmap.pdf

Li Shen

unread,
Nov 5, 2014, 9:33:29 AM11/5/14
to ngsplot-discuss
Your heatmap is fine. There are just very few genes. How many genes are there in this "Aqu1" genome? Can you check? There should be a program message indicating the R data file that is being used.

Li

--
You received this message because you are subscribed to the Google Groups "ngsplot-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngsplot-discu...@googlegroups.com.
To post to this group, send email to ngsplot...@googlegroups.com.
Visit this group at http://groups.google.com/group/ngsplot-discuss.

For more options, visit https://groups.google.com/d/optout.

You received this message because you are subscribed to a topic in the Google Groups "ngsplot-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ngsplot-discuss/fkopYEhXUXw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ngsplot-discu...@googlegroups.com.

To post to this group, send email to ngsplot...@googlegroups.com.
Visit this group at http://groups.google.com/group/ngsplot-discuss.

For more options, visit https://groups.google.com/d/optout.

Federico Gaiti

unread,
Nov 5, 2014, 6:12:06 PM11/5/14
to ngsplot...@googlegroups.com
Hi Li,

the Aqu1 has around 30000 genes. It seems weird that only very few genes show that histone marks. 

I can see the Rdata file but is there a way I could check how many genes have been used to generate the profile/heatmap?

Thanks for help
Federico


Li Shen

unread,
Nov 5, 2014, 7:56:06 PM11/5/14
to ngsplot-discuss
Of course, ngs.plot produces a zip file. Unzip it and you'll find an R data file that contains the coverage matrix.

Is it possible that your bam file's chromosome names are not compatible with the ngs.plot database. Use "ngsplotdb.py chrnames Aqu1" to list the chromosome names in the database.

Li



For more options, visit https://groups.google.com/d/optout.

Federico Gaiti

unread,
Nov 5, 2014, 8:54:49 PM11/5/14
to ngsplot...@googlegroups.com
Thanks. I previously used samtools reheader to modify the header of the bam files. They should match.

When I run the command you suggest, I got this:

ngsplotdb.py chrnames Aqu1
usage: ngsplotdb.py chrnames [-h] gn db
ngsplotdb.py chrnames: error: too few arguments

Am I missing anything? 
 
thanks
Federico

Li Shen

unread,
Nov 5, 2014, 9:03:54 PM11/5/14
to ngsplot-discuss
ngsplotdb.py chrnames Aqu1 ensembl (or refseq).

Li


For more options, visit https://groups.google.com/d/optout.

Federico Gaiti

unread,
Nov 5, 2014, 9:10:50 PM11/5/14
to ngsplot...@googlegroups.com
ngsplotdb.py chrnames Aqu1 ensembl 

chrContig100
chrContig10001
chrContig10002
chrContig10003
chrContig10005
chrContig10006
chrContig10007
chrContig10008
chrContig10009
chrContig1001

samtools view -H H3K4me3_SE_October_fixed_sorted.bam 

@HD VN:1.0 SO:unsorted
@SQ SN:chrContig1 LN:633
@SQ SN:chrContig3 LN:652
@SQ SN:chrContig4 LN:654
@SQ SN:chrContig5 LN:662
@SQ SN:chrContig6 LN:665
@SQ SN:chrContig7 LN:715
@SQ SN:chrContig8 LN:717
@SQ SN:chrContig9 LN:718
@SQ SN:chrContig10 LN:720

The chromosome names seem to match. It is really odd that only really few genes are present in the heat map…

Federico Gaiti

unread,
Nov 9, 2014, 8:15:03 PM11/9/14
to ngsplot...@googlegroups.com
Hi Li,

would have any other idea about why I would have so few genes in the heat map? 

My bam file’s chromosome names correspond with the nags.plot database and when I look at the peaks called by MACS2 on a genome browser I see a lot of genes showing that histone marks around the promoter region. 

Thanks for help
Federico
Reply all
Reply to author
Forward
0 new messages