constructBin error (due to bowtie2 format?)

144 views
Skip to first unread message

John

unread,
Jul 3, 2015, 5:40:50 AM7/3/15
to mosaics_u...@googlegroups.com
Hello,

I get an error message when using a sam file that looks like the header (see below) is not being accepted.  The alignement is the default output of bowtie 2.  More details are below but any help in fixing this would be greatly appreciated.



Using this command:



constructBins( infile="/Users/mahmoud/
Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam", fileFormat="bowtie", outfileLoc="/Users/mahmoud/Desktop/John_Work/ChIP-seq/mosaic/", byChr=FALSE, useChrfile=FALSE, chrfile=NULL, excludeChr="chrM", PET=FALSE, fragLen=200, binSize=200, capping=0 )



With the file format set to either sam or bowtie, the input file being the default output from using bowtie2 (is this the issue, that its not bowtie?) the top few lines looking like this:



@HD     VN:1.0  SO:unsorted
@SQ     SN:gi|408675720|ref|NC_018750.1|        LN:8226158
@PG     ID:bowtie2      PN:bowtie2      VN:2.1.0
HWI-D00382:138:C40G6ANXX:7:1101:1359:2142       0       gi|408675720|ref|NC_018750.1|   5608269 42      51M     *       0       0       CAGATGTGGGCCGCCCACTTCATCGACTACGAGCGGCCGGCCACCTGGCTG     BBBBBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF     AS:i:0  XN:i:0  XM:i:0  XO:i:0  XG:i:0  NM:i:0  MD:Z:51 YT:Z:UU
HWI-D00382:138:C40G6ANXX:7:1101:1715:2029       0       gi|408675720|ref|NC_018750.1|   2421921 42      51M     *       0       0       NAGAGATCGTTCCGCCGGACCGCGGCCCTCGTGAAGGGCGGCGGCCCGTCA     #<BBBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF     AS:i:-1 XN:i:0  XM:i:1  XO:i:0  XG:i:0  NM:i:1  MD:Z



I get this output message:


> constructBins( infile="/Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam", fileFormat="sam", outfileLoc="/Users/mahmoud/Desktop/John_Work/ChIP-seq/mosaic/", byChr=FALSE, useChrfile=FALSE, chrfile=NULL, excludeChr="chrM", PET=FALSE, fragLen=200, binSize=200, capping=0 )
------------------------------------------------------------
Info: setting summary
------------------------------------------------------------
Name of aligned read file: /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam
Aligned read file format: SAM
Directory of processed bin-level files: /Users/mahmoud/Desktop/John_Work/ChIP-seq/mosaic/
Construct bin-level files by chromosome? N
Is file for chromosome info provided? N
List of chromosomes to be excluded: chrM
Data type: Single-end tag (SET)
Average fragment length: 200
Bin size: 200
------------------------------------------------------------
Info: reading the aligned read file and processing it into bin-level files...
Info: done!
------------------------------------------------------------
Info: processing summary
------------------------------------------------------------
Directory of processed bin-level files: /Users/mahmoud/Desktop/John_Work/ChIP-seq/mosaic/
Processed bin-level file: NsrR_18h_Flag.sam_fragL200_bin200.txt
------------------------------------------------------------
Warning message:
running command 'perl  /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam /Users/mahmoud/Desktop/John_Work/ChIP-seq/mosaic/ sam 200 200 0 N N - chrM  ' had status 255
Bareword found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 1, near "@HD    VN"
    (Missing operator before VN?)
Bareword found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 1, near "1.0    SO"
    (Missing operator before SO?)
Array found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 2, at end of line
    (Missing semicolon on previous line?)
Bareword found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 2, near "@SQ    SN"
    (Missing operator before SN?)
Array found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 3, at end of line
    (Missing semicolon on previous line?)
Bareword found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 3, near "@PG    ID"
    (Missing operator before ID?)
Semicolon seems to be missing at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 3.
Number found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 4, near "2142    0"
    (Missing operator before     0?)
Bareword found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 4, near "0    gi"
    (Missing operator before gi?)
Number found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 4, near "5608269    42"
    (Missing operator before     42?)
Number found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 4, near "42    51"
    (Missing operator before     51?)
Bareword found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 4, near "51M"
    (Missing operator before M?)
Number found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 4, near "0    0"
    (Missing operator before     0?)
Bareword found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 4, near "0    CAGATGTGGGCCGCCCACTTCATCGACTACGAGCGGCCGGCCACCTGGCTG"
    (Missing operator before CAGATGTGGGCCGCCCACTTCATCGACTACGAGCGGCCGGCCACCTGGCTG?)
Bareword found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 4, near "0    XN"
    (Missing operator before XN?)
Bareword found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 4, near "0    XM"
    (Missing operator before XM?)
Bareword found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 4, near "0    XO"
    (Missing operator before XO?)
Bareword found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 4, near "0    XG"
    (Missing operator before XG?)
Bareword found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 4, near "0    NM"
    (Missing operator before NM?)
Bareword found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 4, near "0    MD"
    (Missing operator before MD?)
Bareword found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 4, near "51    YT"
    (Missing operator before YT?)
Number found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 5, near "2029    0"
    (Missing operator before     0?)
Bareword found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 5, near "0    gi"
    (Missing operator before gi?)
Number found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 5, near "2421921    42"
    (Missing operator before     42?)
Number found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 5, near "42    51"
    (Missing operator before     51?)
Bareword found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 5, near "51M"
    (Missing operator before M?)
Number found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 5, near "0    0"
    (Missing operator before     0?)
Bareword found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 5, near "0    NAGAGATCGTTCCGCCGGACCGCGGCCCTCGTGAAGGGCGGCGGCCCGTCA"
    (Missing operator before NAGAGATCGTTCCGCCGGACCGCGGCCCTCGTGAAGGGCGGCGGCCCGTCA?)
Number found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 6, near "2147    16"
    (Missing operator before     16?)
Bareword found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 6, near "16    gi"
    (Missing operator before gi?)
Number found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 6, near "2438046    42"
    (Missing operator before     42?)
Number found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 6, near "42    51"
    (Missing operator before     51?)
Bareword found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 6, near "51M"
    (Missing operator before M?)
Number found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 6, near "0    0"
    (Missing operator before     0?)
Bareword found where operator expected at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 6, near "0    TTCCAGGGAGTGGGTGAGCCGGGTGCGGGGGCTGGCGTCCCAGGCGTGGCC"
    (Missing operator before TTCCAGGGAGTGGGTGAGCCGGGTGCGGGGGCTGGCGTCCCAGGCGTGGCC?)
syntax error at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 1, near "@HD    VN"
Unterminated <> operator at /Users/mahmoud/Desktop/John_Work/ChIP-seq/NsrR_18h_Flag.sam line 6.

Jeremy Davis-Turak

unread,
Jul 16, 2015, 6:46:03 PM7/16/15
to mosaics_u...@googlegroups.com
Hi John,

I just got this error as well.

Using the command debug(constructBins), I was able to narrow down the problem to this line:

system.file(file.path("Perl", script), package = "mosaics")


*no package 'mosaics2' exists on my system*.  I tested this line: 


system.file(file.path("Perl", script), package = "mosaics",mustWork=T)


and it works fine.  Seems like a bug for my version of R/Bioconductor .... is there a mosaics2 package for an older Bioconductor?


> sessionInfo()

R version 3.2.0 (2015-04-16)

Platform: x86_64-pc-linux-gnu (64-bit)

Running under: Ubuntu 14.04.2 LTS


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] BiocInstaller_1.18.3 mosaics_2.2.0        Rcpp_0.11.6         


loaded via a namespace (and not attached):

[1] MASS_7.3-40         IRanges_2.2.1       tools_3.2.0        

[4] splines_3.2.0       S4Vectors_0.6.0     grid_3.2.0         

[7] BiocGenerics_0.14.0 stats4_3.2.0        lattice_0.20-31



Jeremy Davis-Turak

Aayushi Jain

unread,
Feb 3, 2016, 9:19:20 PM2/3/16
to MOSAiCS User Group
Hi John & Jeremy!

I am having the exact same problem. Did you guys figure out the solution?

Thanks!
Aayushi

Peng

unread,
Mar 26, 2016, 2:30:35 PM3/26/16
to MOSAiCS User Group
Hi Aayushi, John, and Jeremy,

I think it is probably because mosaics cannot find one of its own perl scripts, most likely due to Bioconductor setup. Maybe you can try to re-install mosaics by:


and then under the same folder, run R and use:

library(devtools)
install('mosaics')

this will install the same source code of mosaics without using Bioconductor. Hope it is helpful

Best,
Peng

Jin-Rui Xu

unread,
Apr 1, 2017, 11:28:26 AM4/1/17
to MOSAiCS User Group
Hi Peng,
I tried your suggestion, but the installation failed. Could you help me on the problem?
Have you already reported the error to the biocoundctdor?
Thanks

> library(devtools)

> install('mosaics')

Installing mosaics

trying URL 'https://cran.rstudio.com/src/contrib/Rcpp_0.12.10.tar.gz'

Content type 'application/x-gzip' length 2446049 bytes (2.3 MB)

==================================================

downloaded 2.3 MB


Installing Rcpp

'/gpfs/apps/hpc/Apps/R/3.3.2-generic/lib/R/bin/R' --no-site-file --no-environ  \

  --no-save --no-restore --quiet CMD INSTALL  \

  '/tmp/RtmpPSjG41/devtools4bcf5300c6d2/Rcpp'  \

  --library='/gpfs/home/fas/gerstein/jx98/R' --install-tests 

* installing *source* package ‘Rcpp’ ...

** package ‘Rcpp’ successfully unpacked and MD5 sums checked

** libs

/gpfs/apps/hpc/Langs/GCC/4.8.2/bin/g++ -I/gpfs/apps/hpc/Apps/R/3.3.2-generic/lib/R/include -DNDEBUG -I../inst/include/ -I/usr/local/include    -fpic  -g -O2  -c Date.cpp -o Date.o

/gpfs/apps/hpc/Langs/GCC/4.8.2/bin/g++ -I/gpfs/apps/hpc/Apps/R/3.3.2-generic/lib/R/include -DNDEBUG -I../inst/include/ -I/usr/local/include    -fpic  -g -O2  -c Module.cpp -o Module.o

/gpfs/apps/hpc/Langs/GCC/4.8.2/bin/g++ -I/gpfs/apps/hpc/Apps/R/3.3.2-generic/lib/R/include -DNDEBUG -I../inst/include/ -I/usr/local/include    -fpic  -g -O2  -c Rcpp_init.cpp -o Rcpp_init.o

/gpfs/apps/hpc/Langs/GCC/4.8.2/bin/g++ -I/gpfs/apps/hpc/Apps/R/3.3.2-generic/lib/R/include -DNDEBUG -I../inst/include/ -I/usr/local/include    -fpic  -g -O2  -c api.cpp -o api.o

/gpfs/apps/hpc/Langs/GCC/4.8.2/bin/g++ -I/gpfs/apps/hpc/Apps/R/3.3.2-generic/lib/R/include -DNDEBUG -I../inst/include/ -I/usr/local/include    -fpic  -g -O2  -c attributes.cpp -o attributes.o

/gpfs/apps/hpc/Langs/GCC/4.8.2/bin/g++ -I/gpfs/apps/hpc/Apps/R/3.3.2-generic/lib/R/include -DNDEBUG -I../inst/include/ -I/usr/local/include    -fpic  -g -O2  -c barrier.cpp -o barrier.o

/gpfs/apps/hpc/Langs/GCC/4.8.2/bin/g++ -shared -L/gpfs/apps/hpc/Apps/R/3.3.2-generic/lib/R/lib -L/gpfs/apps/hpc/Libs/zlib/1.2.7/lib -L/gpfs/apps/hpc/Libs/bzip2/1.0.6/lib -L/gpfs/apps/hpc/Tools/XZ/5.0.7/lib -L/gpfs/apps/hpc/Tools/PCRE/8.40/lib -o Rcpp.so Date.o Module.o Rcpp_init.o api.o attributes.o barrier.o -L/gpfs/apps/hpc/Apps/R/3.3.2-generic/lib/R/lib -lR

installing to /gpfs/home/fas/gerstein/jx98/R/Rcpp/libs

** R

** inst

Warning in file.append(to[okay], from[okay]) :

  write error during file append

Warning in file.append(to[okay], from[okay]) :

  write error during file append

** tests

** preparing package for lazy loading

** help

*** installing help indices

** building package indices

** installing vignettes

** testing if installed package can be loaded

Error in readRDS(nsInfoFilePath) : error reading from connection

Error: loading failed

Execution halted

ERROR: loading failed

* removing ‘/gpfs/home/fas/gerstein/jx98/R/Rcpp’

* restoring previous ‘/gpfs/home/fas/gerstein/jx98/R/Rcpp’

Error: Command failed (1)


Jeremy Davis-Turak

unread,
Apr 6, 2017, 7:39:35 PM4/6/17
to mosaics_u...@googlegroups.com
Jin-Rui,

This installation error is mostly happening because you ran out of disk space.

Jeremy Davis-Turak

Director of Bioinformatics
OnRamp BioInformatics, Inc.
Big Data Insights for BioInformatics

office/fax: (855) 7ONRAMP / (855) 766-7267  Extension 701
email: 
jer...@onramp.bio
web: www.onrampbioinformatics.com

♻︎ Please consider the environment before printing

IMPORTANT: The contents of this email and any attachments are confidential. They are intended for the named recipient(s) only. If you have received this email by mistake, please notify the sender immediately and do not disclose the contents to anyone or make copies thereof.

--
You received this message because you are subscribed to a topic in the Google Groups "MOSAiCS User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mosaics_user_group/nlKpAG1PhHI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mosaics_user_group+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dongjun Chung

unread,
Apr 8, 2017, 2:08:02 PM4/8/17
to mosaics_u...@googlegroups.com
Hi all,

Some of them seem to be the errors that exist in older versions of mosaics package and they should not occur in recent versions. Note that the default bioconductor installation command lines might install older versions depending on your system.

source("https://bioconductor.org/biocLite.R")
biocLite("mosaics")

Can you check the up-to-date version of software and see whether they still occur? In the case of bioconductor, instead of using their installation command lines, you might want to just download tar.gz/zip/tgz and install it using your R directly.

http://www.bioconductor.org/packages/release/bioc/html/mosaics.html
http://dongjunchung.github.io/mosaics/

Hope it helps.

Thanks,
Dongjun


To unsubscribe from this group and all its topics, send an email to mosaics_user_group+unsubscribe@googlegroups.com.

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

--
You received this message because you are subscribed to the Google Groups "MOSAiCS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mosaics_user_group+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages