Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coverage 0 for entire chr when using --by #156

Open
elleira opened this issue Sep 1, 2021 · 7 comments
Open

Coverage 0 for entire chr when using --by #156

elleira opened this issue Sep 1, 2021 · 7 comments

Comments

@elleira
Copy link

elleira commented Sep 1, 2021

Hi,
I'm trying to run mosdepth (mosdepth --threads {threads} -b {input.bed} qc/{wildcards.sample}_{wildcards.seqID}/{wildcards.sample}_{wildcards.seqID} {input.bam}) on our new panel and 16/20 samples keep on "losing" a chr. Mosdepth claims the coverage is 0 over all regions on that chromosome, despite samtools depth clearly finding a coverage of 100-200x. The chromosome varies between samples but the same sample always loses the same chromosome.

I've tried both v.0.3.2 and v.0.3.1 (quay.io/biocontainers/mosdepth:0.3.2--h01d7912_0 and quay.io/biocontainers/mosdepth:0.3.1--h01d7912_2), with both 1 and 5 threads, always with the same result.

Thanks!

@brentp
Copy link
Owner

brentp commented Sep 1, 2021

Hi, this is hard to diagnose with this info. Must be something peculiar about your input data.
what is the chromosome? and what are the entries in input.bed for that chromosome?

@elleira
Copy link
Author

elleira commented Sep 1, 2021

Hi,
Since which chromosome "fails" depends on which sample (same chromosome works for the other samples) I have a hard time seeing that the issue is in the bedfile. For this dataset it fails for chromosomes 2, 3, 7, 13, 16, 19 and 22 while the rest of the design (on chr 1, 5, 9, 10-12, 17 and 18) is fine.

@brentp
Copy link
Owner

brentp commented Sep 1, 2021

for the sample that fails on chr2, can you run mosdepth -c 2 ... where ... is the same arguments you used before. then see if the output is still 0.
also, how did you run samtools depth? was it with a region? or on the whole bam file?

@elleira
Copy link
Author

elleira commented Sep 1, 2021

So when I just tried it with a different container, and now it works. It seems like the containers on quay are the issue. The container I used was created with (v0.3.1):

FROM ubuntu:18.04
ARG VERSION
RUN apt-get update && \
    apt-get install -y --no-install-recommends wget=1.19.4-1ubuntu2.2 ca-certificates=20210119~18.04.1 && \
    rm -rf /var/lib/apt/lists/*
WORKDIR /usr/local/bin
RUN wget "https://github.com/brentp/mosdepth/releases/download/${VERSION}/mosdepth"
RUN chmod a+x mosdepth

And to answer you question for samtools depth i ran both just chr2 and the entire bamfile. Running mosdepth -c chr2 still gives 0 in both quay-containers.

@brentp
Copy link
Owner

brentp commented Sep 1, 2021

well, that is worrisome. I'm not sure how those are created.

@lmtani
Copy link

lmtani commented Oct 4, 2021

I just faced the same problem with quay-containers and bioconda. The version seems to be correct (v0.3.2), but the --d4 parameter is missing.

When downloading the binary directly from your repository, things went right.

Edit to include this minimal example:

sample-data.zip

# ------ Download sample data ------ #
mkdir /tmp/test-mosdepth && cd /tmp/test-mosdepth
wget https://github.com/brentp/mosdepth/files/7293538/sample-data.zip && unzip sample-data.zip 

# ------  Using release from this repository (OK) ------ #
wget https://github.com/brentp/mosdepth/releases/download/v0.3.2/mosdepth && chmod +x mosdepth
./mosdepth --version
# mosdepth 0.3.2
./mosdepth --by sample-data/intervals-chr8.bed \
           --thresholds 10 \
           --fast-mode \
           from-repo-release sample-data/NA12878_chr8-41767341-41980927.bam
zcat from-repo-release.thresholds.bed.gz | head -n 10
##chrom  start   end     region  10X
#chr8    41767341        41767380        unknown 39
#chr8    41797511        41797538        unknown 27
#chr8    41896354        41896480        unknown 126
#chr8    41932204        41934867        unknown 2663
#chr8    41937255        41937568        unknown 313
#chr8    41940841        41941444        unknown 603
#chr8    41942780        41943000        unknown 220
#chr8    41943747        41943979        unknown 232
#chr8    41946590        41946684        unknown 94

# ------  From quay biocontainer (and conda) ------ #
docker run -v "$(pwd):/work" -w /work quay.io/biocontainers/mosdepth:0.3.2--h01d7912_0 \
    bash -c "
    mosdepth --version && \
    mosdepth --by sample-data/intervals-chr8.bed \
             --thresholds 10 \
             --fast-mode \
             from-biocontainer sample-data/NA12878_chr8-41767341-41980927.bam"
# mosdepth 0.3.2
zcat from-biocontainer.thresholds.bed.gz | head -n 10
##chrom  start   end     region  10X
#chr8    41767341        41767380        unknown 0
#chr8    41797511        41797538        unknown 0
#chr8    41896354        41896480        unknown 0
#chr8    41932204        41934867        unknown 0
#chr8    41937255        41937568        unknown 0
#chr8    41940841        41941444        unknown 0
#chr8    41942780        41943000        unknown 58
#chr8    41943747        41943979        unknown 232
#chr8    41946590        41946684        unknown 94

@ggabriel96
Copy link

well, that is worrisome. I'm not sure how those are created.

AFAIK, the build definitions are here: https://github.com/bioconda/bioconda-recipes/tree/master/recipes/mosdepth. That might help. It seems to me that they just grab the sources from GitHub and compile them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants