Coder Social home page Coder Social logo

copy-number-analysis's Introduction

BiocManager

CRAN status CRAN release CRAN downloads

Overview

The BiocManager package, as the modern successor package to BiocInstaller, allows users to install and manage packages from the Bioconductor project. Bioconductor focuses on the statistical analysis and comprehension of high-throughput genomic data.

Current Bioconductor packages are available on a ‘release’ version intended for every-day use, and a ‘devel’ version where new features are continually introduced. A new release version is created every six months. Using the BiocManager package helps users accurately install packages from the appropriate release.

  • available() shows all packages associated with a search pattern
  • install() installs and/or updates packages either CRAN or Bioconductor
  • repositories() shows all package repository URL endpoints
  • valid() checks and returns packages that are out-of-date or too new
  • version() returns the current Bioconductor version number

Installation

if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

Usage

Checking Bioconductor version currently installed

BiocManager::version()
#> [1] '3.15'

Installing Bioconductor packages

BiocManager::install(c("GenomicRanges", "SummarizedExperiment"))

Verifying a valid Bioconductor installation

BiocManager::valid()
#> [1] TRUE

More information

Please see the package vignette for more detailed information such as changing Bioconductor version, offline use, and other advanced usage.

Getting help

To report apparent bugs, create a minimal and reproducible example on GitHub.

copy-number-analysis's People

Contributors

pshannon-bioc avatar sonali-bioc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

copy-number-analysis's Issues

Installation

Hello,

I am trying to simply install the cp.mops. I tried in different R version - 3.2.1, 3.4.1, 3.6.1. It doesn't support any of it? What R version can I use to install it?

Thank you.

Exploring and Understanding how to use "cn.mops"

Hi Gunter,

Can you please share how you normalized the data?
(Ans provided by email) - The R code can be found at -
https://gist.github.com/gklambauer/8955203

Can you also explain to me about the classes used by cn.mops?
eg: (CN0,CN1,...CN8)

For the output of cnvs(resCNMOPS), we get 4 metadata columns in the GRanges object.
Can you elaborate about the mediate and mean columns here?
How should one best interpret these?

Thanks and Regards
Sonali Arora.

singlecn.mops

Hello,

I am using cnMOPS for Exome cnv analyse which is working fine, since i have multiple samples.
However i want to use the function singlecn.mops to detect cnvs in WGS data, where i only have one sample. Unfortunatly i get an Error message:

Starting segmentation algorithm...
Using "fastseg" for segmentation.
Error in checkForRemoteErrors(val) :
one node produced an error: missing value, where TRUE/FALSE needed.
In addition: Warning messages:
1: In valid.GenomicRanges.seqinfo(x, suggest.trim = TRUE) :
GRanges object contains 1 out-of-bound range located on sequence chrMT. Note that ranges located on a sequence
whose length is unknown (NA) or on a circular sequence are not considered out-of-bound (use seqlengths() and
isCircular() to get the lengths and circularity flags of the underlying sequences). You can use trim() to trim
these ranges. See ?trim,GenomicRanges-method for more information.
2: In valid.GenomicRanges.seqinfo(x, suggest.trim = TRUE) :
GRanges object contains 1 out-of-bound range located on sequence chrMT. Note that ranges located on a sequence
whose length is unknown (NA) or on a circular sequence are not considered out-of-bound (use seqlengths() and
isCircular() to get the lengths and circularity flags of the underlying sequences). You can use trim() to trim
these ranges. See ?trim,GenomicRanges-method for more information.

My code looks like this:
#######

library(cn.mops)

bams = "*******.bam"

bam_counts = getReadCountsFromBAM(bams, parallel=2)

res = singlecn.mops(bam_counts, parallel=2)

final_genome_cnv = calcIntegerCopyNumbers(res)

#######

Do you have any suggestions what i am doing wrong?
Thanks in Advance!

there is no package called ‘BiocParallel’

When I try to start cn.mops with library(cn.mops) I get this error

Error: package or namespace load failed for ‘cn.mops’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘BiocParallel’

R version 3.4.1
Bioconductor version 3.6 (BiocInstaller 1.28.0)

Thanks in advanced

'Error in as.vector(x, "character")' - RCNV_seq.R and RCNV_seq-helper.R

Hello,

I'm currently trying to replicate the example code for getting a CNV plot, using both the RCNV_seq.R and RCNV_seq-helper.R scripts with the tumor and normal bam files of chromosome 4 that were provided for testing. My goal is to use this tool to visualize genomic data of crops and detect CNVs.

While using RCNV_seq.R, I would run cnv <- cnv.cal(as.countsfile(chr4), log2=log2, annotate=annotate) and get the following error:

asCountsFileError

I noticed that the as.countsfile( ) function was defined in the RCNV_seq-helper.R file. After some troubleshooting, I understood that the chr4 object in RCNV_seq.R is an S4 object that is been tried to be converted into a tabulated file using the as.countsfile( ) function. This tab file is in turn needed as a parameter/input in the cnv.cal( ) function from the cnv.R file.

In order to get around this error and replicate the CNV plot, I had to edit the as.countsfile( ) function in RCNV_seq-helper.R as follows:

Original as.countsfile( ) code:

as.countsfile <- function(hits, file=tempfile()) {
    df <- with(rowData(hits), {
        cbind(data.frame(chromosome=as.character(seqnames),
                         start=start, end=end),
              assay(hits))
    })
    write.table(df, file, quote=FALSE, row.names=FALSE, sep="\t")
    file
}

Edited as.countsfile( ) code:

as.countsfile <- function(hits, fileNameAndLocation) {
    df <- with(rowData(hits), {
        chrome = hits@rowRanges@seqnames
        start = hits@rowRanges@ranges
        end = hits@rowRanges@ranges@start + hits@rowRanges@ranges@width
            cbind(data.frame(chromosome=chrome,
                             start=start,
                             end=end),
                             assay(hits))
    })

    df = subset(df, select = -c(end))
    names(df)[names(df) == "start.start"] <- "start"
    names(df)[names(df) == "start.end"] <- "end"
    names(df)[names(df) == "start.width"] <- "width"

    write.table(df, file = fileNameAndLocation, quote=FALSE, row.names=FALSE, sep="\t")
    return(fileNameAndLocation)
}

With the custom edits, I was able to replicate the CNV plot, but my wish is to not use a custom-edited R script of an established tool when it comes to publishing. I am fairly new to R and do not know how I may be affecting the functionality/robustness of the tool. This leads to my two requests:

  1. Can the as.countsfile( ) function in RCNV_seq-helper.R file be fixed to handle the extraction from S4 objects and convert the data into a tab file?
  2. What would be the proper way to cite this tool in a publication?

Thank you ahead of time for your help. Have a good one!

In valid.GenomicRanges.seqinfo

Dear:
Could you tell me how I correct the errors?

library(cn.mops)

BAMFiles <- list.files(pattern=".bam$")
bamDataRanges <- getReadCountsFromBAM(BAMFiles)

res <- cn.mops(bamDataRanges)

Warning message:
In valid.GenomicRanges.seqinfo(x, suggest.trim = TRUE) :
GRanges object contains 4 out-of-bound ranges located on sequences
chrM, chr18_gl000207_random, chrUn_gl000226, and chrUn_gl000229. Note
that ranges located on a sequence whose length is unknown (NA) or on a
circular sequence are not considered out-of-bound (use seqlengths() and
isCircular() to get the lengths and circularity flags of the underlying
sequences). You can use trim() to trim these ranges. See
?trim,GenomicRanges-method for more information.

Starting segmentation algorithm...
Using "fastseg" for segmentation.
Error in if (all(segMedianT == 0)) { :
missing value where TRUE/FALSE needed
Calls: cn.mops -> apply -> FUN
In addition: Warning messages:
1: In valid.GenomicRanges.seqinfo(x, suggest.trim = TRUE) :
GRanges object contains 4 out-of-bound ranges located on sequences
chrM, chr18_gl000207_random, chrUn_gl000226, and chrUn_gl000229. Note
that ranges located on a sequence whose length is unknown (NA) or on a
circular sequence are not considered out-of-bound (use seqlengths() and
isCircular() to get the lengths and circularity flags of the underlying
sequences). You can use trim() to trim these ranges. See
?trim,GenomicRanges-method for more information.
2: In normalizeChromosomes(X, chr = chr, normType = normType, qu = normQu, :
Normalization for reference sequence chrM not applicable, because of low number of segments
3: In normalizeChromosomes(X, chr = chr, normType = normType, qu = normQu, :
Normalization for reference sequence chr9_gl000200_random not applicable, because of low number of segments
4: In normalizeChromosomes(X, chr = chr, normType = normType, qu = normQu, :
Normalization for reference sequence chr18_gl000207_random not applicable, because of low number of segments
5: In normalizeChromosomes(X, chr = chr, normType = normType, qu = normQu, :
Normalization for reference sequence chrUn_gl000226 not applicable, because of low number of segments
6: In normalizeChromosomes(X, chr = chr, normType = normType, qu = normQu, :
Normalization for reference sequence chrUn_gl000229 not applicable, because of low number of segments
Execution halted

one CNV was split into multiple parts,how to tune it

cn.mops is helpful for me

i met that one CNV record (validated by other golden standard) was split into multiple parts, the result confused the clinical interpretation, is there some parameters could change this situation?

chr15:23679001-28547200
image

while we plot it by depth, we can see it is sure a long CNV, not many parts
image

any advice, i appreciate it very much, thank you !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.