Coder Social home page Coder Social logo

mutmap's Introduction

MutMap User Guide

version 2.3.4

Table of contents

What is MutMap?

Bulked segregant analysis, as implemented in MutMap (Abe et al., 2012), is a powerful and efficient method to identify agronomically important loci in crop plants. MutMap requires whole-genome resequencing of a single individual from the original cultivar and the pooled sequences of F2 progeny from a cross between the original cultivar and mutant. MutMap uses the sequence of the original cultivar to polarize the site frequencies of neighbouring markers and identifies loci with an unexpected site frequency, simulating the genotype of F2 progeny. The updated pipeline is approximately 5-8 times faster than the previous pipeline, are easier for novice users to use and can be easily installed through bioconda with all dependencies.

Citation

Installation

Dependencies

Softwares

Python (>=3.5) libraries

  • matplotlib
  • numpy
  • pandas
  • seaborn (optional)

Installation using bioconda

You can install MutMap using bioconda.

conda install -c bioconda mutmap

Alternatively, if you want to create MutMap specific environment with Python3.

conda create -n mutmap python=3 mutmap

Manual installation

If you got a error during installation, you can install MutMap, manually.

git clone https://github.com/YuSugihara/MutMap.git
cd MutMap
pip install -e .

Then you have to install other dependencies by yourself. We highly recommend you to install SnpEff and Trimmomatic using bioconda.

conda install -c bioconda snpeff
conda install -c bioconda trimmomatic

After installation, please check whether SnpEff and Trimmomatic work through the commands below.

snpEff --help
trimmomatic --help

Usage

If your reference genome has more than 50 contigs (or chromosomes), only significant contigs will be plotted.

mutmap -h

usage: mutmap -r <FASTA> -c <BAM|FASTQ> -b <BAM|FASTQ>
              -n <INT> -o <OUT_DIR> [-T] [-e <DATABASE>]

MutMap version 2.3.4

optional arguments:
  -h, --help         show this help message and exit
  -r , --ref         Reference fasta.
  -c , --cultivar    fastq or bam of cultivar. If you specify
                     fastq, please separate pairs by comma,
                     e.g. -c fastq1,fastq2. You can use this
                     optiion multiple times
  -b , --bulk        fastq or bam of mutnat bulk. If you specify
                     fastq, please separate pairs by comma,
                     e.g. -b fastq1,fastq2. You can use this
                     optiion multiple times
  -n , --N-bulk      Number of individuals in mutant bulk.
  -o , --out         Output directory. Specified name must not
                     exist.
  -t , --threads     Number of threads. If you specify the number
                     below one, then MutMap will use the threads
                     as many as possible. [2]
  -w , --window      Window size (kb). [2000]
  -s , --step        Step size (kb). [100]
  -D , --max-depth   Maximum depth of variants which will be used.
                     This cutoff will be applied in both of cultivar
                     and bulk. [250]
  -d , --min-depth   Minimum depth of variants which will be used.
                     This cutoff will be applied in both of cultivar
                     and bulk. [8]
  -N , --N-rep       Number of replicates for simulation to make 
                     null distribution. [5000]
  -T, --trim         Trim fastq using trimmomatic.
  -a , --adapter     FASTA of adapter sequences. This will be used
                     when you specify "-T" for trimming.
  --trim-params      Parameters for trimmomatic. Input parameters
                     must be separated by comma with following
                     order: phred, ILLUMINACLIP, LEADING, TRAILING,
                     SLIDINGWINDOW, MINLEN. If you want to remove
                     adapters of illumina, please specify FASTA of
                     the adapter sequences with "--adapter". Specified
                     name will be inserted into <ADAPTER_FASTA>. If you
                     don't specify it, adapter trimming will be skipped.
                     [33,<ADAPTER_FASTA>:2:30:10,20,20,4:15,75]
  -e , --snpEff      Predict causal variant using SnpEff. Please
                     check available databases in SnpEff.
  --mem              Maximum memory per thread when bam sorted;
                     suffix K/M/G recognized. [1G]
  -q , --min-MQ      Minimum mapping quality in mpileup. [40]
  -Q , --min-BQ      Minimum base quality in mpileup. [18]
  -C , --adjust-MQ   "adjust-MQ" in mpileup. Default parameter
                     is suited for BWA. [50]
  --species          Consider multiple test correction derived by
                     Huang et al. (2019). Please spesify a species name.
                     With this option. QTL-seq produces a theoretical threshold.
                     Currently, Arabidopsis, Cucumber, Maize, Rapeseed,
                     Rice, Tobacco, Tomato, Wheat, and Yeast are supported.
  -v, --version      show program's version number and exit

MutMap can run from FASTQ (without or with trimming) and BAM. If you want to run MutMap from VCF, please use MutPlot (example 5). Once you run MutMap, MutMap automatically complete the subprocesses.

Example 1 : run MutMap from FASTQ without trimming

mutmap -r reference.fasta \
       -c cultivar.1.fastq,cultivar.2.fastq \
       -b bulk.1.fastq,bulk.2.fastq \
       -n 20 \
       -o example_dir

-r : reference fasta

-c : FASTQs of cultivar. Please input pair-end reads separated by comma. FASTQs can be gzipped.

-b : FASTQs of bulk. Please input pair-end reads separated by comma. FASTQs can be gzipped.

-n : number of individuals in mutant bulk.

-o : name of output directory. Specified name should not exist.

Example 2 : run MutMap from FASTQ with trimming

mutmap -r reference.fasta \
       -c cultivar.1.fastq,cultivar.2.fastq \
       -b bulk.1.fastq,bulk.2.fastq \
       -n 20 \
       -o example_dir \
       -T

-r : reference fasta

-c : FASTQs of cultivar. Please input pair-end reads separated by comma. FASTQs can be gzipped.

-b : FASTQs of bulk. Please input pair-end reads separated by comma. FASTQs can be gzipped.

-n : number of individuals in mutant bulk.

-o : name of output directory. Specified name should not exist.

-T : trim your reads by trimmomatic.

Example 3 : run MutMap from BAM

mutmap -r reference.fasta \
       -c cultivar.bam \
       -b bulk.bam \
       -n 20 \
       -o example_dir

-r : reference fasta

-c : BAM of cultivar.

-b : BAM of bulk.

-n : number of individuals in mutant bulk.

-o : name of output directory. Specified name should not exist.

Example 4 : run MutMap from multiple FASTQs and BAMs

mutmap -r reference.fasta \
       -c cultivar_1.1.fastq,cultivar_1.2.fastq \
       -c cultivar_1.bam \
       -b bulk_1.1.fastq,bulk_1.2.fastq \
       -b bulk_2.bam \
       -b bulk_3.bam \
       -n 20 \
       -o example_dir

MutMap can automatically merge multiple FASTQs and BAMs. Of course, you can merge FASTQs or BAMs using cat or samtools merge before input them to MutMap. If you specify -c multiple times, please make sure that those files include only 1 individual. On the other hand, -b can include more than 1 individuals because those are bulked samples. MutMap can automatically classify FASTQs and BAMs from whether comma exits or not.

Example 5 : run MutPlot from VCF

mutplot -h

usage: mutplot -v <VCF> -o <OUT_DIR> -n <INT> [-w <INT>] [-s <INT>]
               [-D <INT>] [-d <INT>] [-N <INT>] [-m <FLOAT>]
               [-S <INT>] [-e <DATABASE>] [--igv] [--indel]

MutPlot version 2.3.4

optional arguments:
  -h, --help            show this help message and exit
  -v , --vcf            VCF file which contains cultivar and mutant bulk.
                        in this order. This VCF file must have AD field.
  -o , --out            Output directory. Specified name can exist.
  -n , --N-bulk         Number of individuals in mutant bulk.
  -w , --window         Window size (kb). [2000]
  -s , --step           Step size (kb). [100]
  -D , --max-depth      Maximum depth of variants which will be used.
                        This cutoff will be applied in both of cultivar
                        and bulk. [250]
  -d , --min-depth      Minimum depth of variants which will be used.
                        This cutoff will be applied in both of cultivar
                        and bulk. [8]
  -N , --N-rep          Number of replicates for simulation to make 
                        null distribution. [5000]
  -m , --min-SNPindex   Cutoff of minimum SNP-index for clear results. [0.3]
  -S , --strand-bias    Filter spurious homo genotypes in cultivar using
                        strand bias. If ADF (or ADR) is higher than this
                        cutoff when ADR (or ADF) is 0, that SNP will be
                        filtered out. If you want to supress this filtering,
                        please set this cutoff to 0. [7]
  -e , --snpEff         Predict causal variant using SnpEff. Please
                        check available databases in SnpEff.
  --igv                 Output IGV format file to check results on IGV.
  --species             Consider multiple test correction derived by
                        Huang et al. (2019). Please spesify a species name.
                        With this option. MutMap produces a theoretical threshold.
                        Currently, Arabidopsis, Cucumber, Maize, Rapeseed,
                        Rice, Tobacco, Tomato, Wheat, and Yeast are supported.
  --indel               Plot SNP-index with INDEL.
  --fig-width           Width allocated in chromosome figure. [7.5]
  --fig-height          Height allocated in chromosome figure. [4.0]
  --white-space         White space between figures. (This option
                        only affect vertical direction.) [0.6]
  -f , --format         Specifiy the format of an output image.
                        eps/jpeg/jpg/pdf/pgf/png/rgba/svg/svgz/tif/tiff
  --version             show program's version number and exit

MutPlot is included in MutMap. MutMap run MutPlot after making VCF. Then, MutPlot will work with default parameters. If you want to change some parameters, you can use VCF inside of (OUT_DIR/30_vcf/mutmap.vcf.gz) to retry plotting process like below.

mutplot -v OUT_DIR/30_vcf/mutmap.vcf.gz \
        -o ANOTHER_DIR_NAME \
        -n 20 \
        -w 2000 \
        -s 100

Use MutPlot for VCF which was made by yourself

In this case, please make sure that:

  1. Your VCF include AD format.
  2. Your VCF include two columns of cultivar and mutant bulk in this order.

If you got a error, please try to run MutMap from FASTQ or BAM before asking in issues.

Outputs

Inside of OUT_DIR is like below.

|-- 10_ref
|   |-- reference.fasta
|   |-- reference.fasta.amb
|   |-- reference.fasta.ann
|   |-- reference.fasta.bwt
|   |-- reference.fasta.fai
|   |-- reference.fasta.pac
|   `-- reference.fasta.sa
|-- 20_bam
|   |-- bulk.filt.bam
|   |-- bulk.filt.bam.bai
|   |-- cultivar.filt.bam
|   `-- cultivar.filt.bam.bai
|-- 30_vcf
|   |-- mutmap.vcf.gz
|   `-- mutmap.vcf.gz.tbi
|-- 40_mutmap
|   |-- snp_index.tsv
│   ├── snp_index.p95.tsv
│   ├── snp_index.p99.tsv
|   |-- sliding_window.tsv
│   ├── sliding_window.p95.tsv
│   ├── sliding_window.p99.tsv
|   `-- mutmap_plot.png
`-- log
    |-- bcftools.log
    |-- bgzip.log
    |-- bwa.log
    |-- mutplot.log
    |-- samtools.log
    `-- tabix.log
  • If you run MutMap with trimming, you will get the directory of 00_fastq which includes FASTQs after trimming.
  • You can check the results in 40_mutmap.
    • snp_index.tsv : columns in this order.
      • CHROM : chromosome name
      • POSI : position in chromosome
      • VARIANT : SNP or INDEL
      • DEPTH : depth of bulk
      • p99 : 99% confidence interval of simulated SNP-index
      • p95 : 95% confidence interval of simulated SNP-index
      • SNP-index : real SNP-index
    • sliding_window.tsv : columns in this order.
      • CHROM : chromosome name
      • POSI : central position of window
      • MEAN p99 : mean of p99
      • MEAN p95 : mean of p95
      • MEAN SNP-index : mean SNP-index
    • mutmap_plot.png : resulting plot (like below)
      • BLUE dot : variant
      • RED line : mean SNP-index
      • ORANGE line : mean p99
      • GREEN line : mean p95

About multiple testing correction

We implemented multiple testing correction in MutMap v2. However, since multiple testing correction changes the threshold from the original MutMap threshold, we highly recommend users, who expect original MutMap algorism identifying a lot of causal mutations in many researches, to try MutMap v2 without multiple testing correction at first. You can use multiple testing correction with the option --species like below:

mutmap -r reference.fasta \
       -c cultivar.1.fastq,cultivar.2.fastq \
       -b bulk.1.fastq,bulk.2.fastq \
       -n 20 \
       -o example_dir \
       --species Rice

Currently, only nine species (Arabidopsis, Cucumber, Maize, Rapeseed, Rice, Tobacco, Tomato, Wheat, and Yeast) are supported, following the parameters defined in Huang et al. (2019).

Built and use your own database for snpEff

If you want to use your own database for snpEff, you need additional steps. Here we assume that you installed MutMap via anaconda distribution, creating new environment with conda create.

  1. Find the directory of snpEff that includes snpEff script, configuration file and database. You can find it in /home/anaconda3/envs/{your_env_name_installed_mutmap}/share/snpeff-5.0-0/. anaconda3 may be miniconda3. Also, the version of snpeff may be different.

  2. Go to this directory and follow the snpEff manual to build the database. Don't forget to add your database info to the snpEff configuration file. https://pcingola.github.io/SnpEff/se_buildingdb/#add-a-genome-to-the-configuration-file

  3. Run MutMap with option -e {your_database_name}

mutmap's People

Contributors

yusugihara avatar

Stargazers

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

Watchers

 avatar

mutmap's Issues

40_mutmap is missing. ModuleNotFoundError: No module named 'qtlseq'

mutmap -r mutmap_ref.fasta -c mutmap_cultivar.1.fastq,mutmap_cultivar.2.fastq -b mutmap_bulk.1.fastq,mutmap_bulk.2.fastq -n 20 -o output
[MutMap:2020-08-18 01:26:01] start to run MutMap.
[MutMap:2020-08-18 01:26:01] maximum number of threads which you can use is up to 8.
[MutMap:2020-08-18 01:26:01] start to index reference fasta.
[MutMap:2020-08-18 01:26:03] indexing of reference successfully finished.
[MutMap:2020-08-18 01:26:03] start to align reads of cultivar.0000 by BWA.
[MutMap:2020-08-18 01:26:17] alignment cultivar.0000 successfully finished.
[MutMap:2020-08-18 01:26:17] start to align reads of bulk.0000 by BWA.
[MutMap:2020-08-18 01:26:30] alignment bulk.0000 successfully finished.
[MutMap:2020-08-18 01:26:30] start to filter reads.
[MutMap:2020-08-18 01:26:49] filtering process successfully finished.
[MutMap:2020-08-18 01:26:49] start to merge BAMs.
[MutMap:2020-08-18 01:27:01] merging process successfully finished.
[MutMap:2020-08-18 01:27:01] start to call variants.
[MutMap:2020-08-18 01:27:23] variant calling successfully finished.
[MutMap:2020-08-18 01:27:23] start to index VCF.
[MutMap:2020-08-18 01:27:23] indexing VCF successfully finished.
Traceback (most recent call last):
File "/home/priyanka/miniconda3/bin/mutplot", line 11, in
load_entry_point('mutmap', 'console_scripts', 'mutplot')()
File "/home/priyanka/miniconda3/lib/python3.6/site-packages/pkg_resources/init.py", line 488, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/home/priyanka/miniconda3/lib/python3.6/site-packages/pkg_resources/init.py", line 2872, in load_entry_point
return ep.load()
File "/home/priyanka/miniconda3/lib/python3.6/site-packages/pkg_resources/init.py", line 2472, in load
return self.resolve()
File "/home/priyanka/miniconda3/lib/python3.6/site-packages/pkg_resources/init.py", line 2478, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/home/priyanka/MutMap/mutmap/mutplot.py", line 12, in
from mutmap.plot import Plot
File "/home/priyanka/MutMap/mutmap/plot.py", line 8, in
from qtlseq.utils import time_stamp
ModuleNotFoundError: No module named 'qtlseq'
[MutMap:2020-08-18 01:27:24] MutMap successfully finished.

bcftools mpileup Error !!

after starting to call variants, I found this error even through using fastq or bam files

-r IRGSP-1.0_genome.fasta
-c cultivar.bam
-b bulk.bam
-n 24
-o result

[MutMap:2020-08-08 21:10:53] start to run MutMap.
[MutMap:2020-08-08 21:10:53] maximum number of threads which you can use is up to 12.
[MutMap:2020-08-08 21:10:53] start to index reference fasta.
[MutMap:2020-08-08 21:14:41] indexing of reference successfully finished.
[MutMap:2020-08-08 21:14:41] start to filter reads.
[MutMap:2020-08-08 21:34:36] filtering process successfully finished.
[MutMap:2020-08-08 21:34:36] start to merge BAMs.
[MutMap:2020-08-08 21:46:14] merging process successfully finished.
[MutMap:2020-08-08 21:46:14] start to call variants.
[MutMap:2020-08-08 21:46:16] !!ERROR!! bcftools mpileup -a AD,ADF,ADR -B -q 40 -Q 18 -C 50 -O u -r chr03 -f result/10_ref/IRGSP-1.0_genome.fasta result/20_bam/cultivar.filt.bam result/20_bam/bulk.filt.bam | bcftools call -vm -f GQ,GP -O u | bcftools filter -i "INFO/MQ>=40" -O z -o result/30_vcf/mutmap.chr03.vcf.gz >> result/log/bcftools.chr03.log 2>&1
[MutMap:2020-08-08 21:46:16] !!ERROR!! bcftools mpileup -a AD,ADF,ADR -B -q 40 -Q 18 -C 50 -O u -r chr01 -f result/10_ref/IRGSP-1.0_genome.fasta result/20_bam/cultivar.filt.bam result/20_bam/bulk.filt.bam | bcftools call -vm -f GQ,GP -O u | bcftools filter -i "INFO/MQ>=40" -O z -o result/30_vcf/mutmap.chr01.vcf.gz >> result/log/bcftools.chr01.log 2>&1

please check below:

[MutMap:2020-08-08 21:46:16] !!ERROR!! bcftools mpileup -a AD,ADF,ADR -B -q 40 -Q 18 -C 50 -O u -r chr05 -f result/10_ref/IRGSP-1.0_genome.fasta result/20_bam/cultivar.filt.bam result/20_bam/bulk.filt.bam | bcftools call -vm -f GQ,GP -O u | bcftools filter -i "INFO/MQ>=40" -O z -o result/30_vcf/mutmap.chr05.vcf.gz >> result/log/bcftools.chr05.log 2>&1
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/...../opt/anaconda3/lib/python3.7/multiprocessing/pool.py", line 121, in worker
result = (True, func(*args, **kwds))

Role of cultivar in MutMap analysis

Dear developers,
I'm using Mutmap to perform some analysis on a set of 4 F2 bulk (2 mutant and 2 wild type) and 2 parentals (1 mutant and 1 wild type).
I was running the MutMap command with bam files:

mutmap -r genome.fasta -c Wild_type/alignment.bam -b Pool_1_Mut/alignment.bam -n 11 -o Pool_1_Mut

but what is not clear to me is the role of the cultivar (parental) in the final results. How does it affect the alignment and the variant calling of the bulk?
Moreover, I've tried to run each bulk with the opposite parental as cultivar, but I'm not sure if it was correct.

Thanks,
Leonardo

question about mutmap plot

Dear Yu,

I use the mutmap v2.3.3 with snpeff. The mutmap_plot were showed in the attached file. The the "red cross (❌)" made me confused. I didn't find any information from the readme. I thought it should be from the snpeff analysis. The plot will have no red cross if I run mutmap without the snpeff. But I could not link the snpeff analysis data with the red cross. Please update more explanation for the plot.

This pipeline helps me a lot. Many thanks to the developers.

All best,
Xizhe

Snipaste_2022-05-05_21-07-55

Usage question

Hi!

Say for example that I have parental lines- 2 samples and a bulk sequenced the progenies, 2 datasets that I know are phenotypically different (based on observations). Is there a way that I can apply MutMap to this situation?

Any suggestions would be really great!

Thanks!

Question about mutmap plot

Hi,
Many thanks to the developers.
I used use the mutmap v2.3.3 and showed "MutMap successfully finished". But the message "SystemError: tile cannot extend outside image" showed in the last line. I don't know how to deal with it.

Could you help me?

Best wishes!

SystemError: tile cannot extend outside image

Dear Yu,
Thank you for MutMap. I've had some problems with it. When I use mutmap with BAM file, I found I can obtain the file of mutmap.vcf.gz, but I can not obtain the result files in 40_mutmap. I guess the problem is mutplot. Could you help me see how to solve this problem. The details of error are as follows:
(mutmap) root@ecs-75cc:~/snp2# mutmap -r /root/snp/genome/Fragaria_vesca_v4.0.a1.fasta -c /root/snp/mapping/wt.MarkDup.bam -b /root/snp/mapping/mut.sorted.bam -n 33 -o example_dir
[MutMap:2021-12-12 17:26:17] start to run MutMap.
[MutMap:2021-12-12 17:26:17] maximum number of threads which you can use is up to 8.
[MutMap:2021-12-12 17:26:17] start to index reference fasta.
[MutMap:2021-12-12 17:29:19] indexing of reference successfully finished.
[MutMap:2021-12-12 17:29:19] start to merge BAMs.
[MutMap:2021-12-12 17:41:48] merging process successfully finished.
[MutMap:2021-12-12 17:41:48] start to call variants.
[MutMap:2021-12-12 17:52:56] variant calling successfully finished.
[MutMap:2021-12-12 17:52:56] start to index VCF.
[MutMap:2021-12-12 17:52:56] indexing VCF successfully finished.
[MutMap:2021-12-12 17:52:57] start to run MutPlot.
[MutMap:2021-12-12 17:52:57] start to calculate SNP-index.
[MutMap:2021-12-12 17:52:58] SNP-index successfully finished.
[MutMap:2021-12-12 17:52:58] start to smooth SNP-index.
[MutMap:2021-12-12 17:52:58] smoothing process successfully finished.
[MutMap:2021-12-12 17:52:58] plotting now...
Traceback (most recent call last):
File "/root/BSA/enter/envs/mutmap/lib/python3.10/site-packages/PIL/ImageFile.py", line 504, in _save
fh = fp.fileno()
AttributeError: '_idat' object has no attribute 'fileno'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/root/BSA/enter/envs/mutmap/bin/mutplot", line 10, in
sys.exit(main())
File "/root/BSA/enter/envs/mutmap/lib/python3.10/site-packages/mutmap/mutplot.py", line 189, in main
mp.run()
File "/root/BSA/enter/envs/mutmap/lib/python3.10/site-packages/mutmap/mutplot.py", line 178, in run
pt.run()
File "/root/BSA/enter/envs/mutmap/lib/python3.10/site-packages/mutmap/plot.py", line 143, in run
plt.savefig('{}/mutmap_plot.{}'.format(self.out, self.args.format))
File "/root/BSA/enter/envs/mutmap/lib/python3.10/site-packages/matplotlib/pyplot.py", line 958, in savefig
res = fig.savefig(*args, **kwargs)
File "/root/BSA/enter/envs/mutmap/lib/python3.10/site-packages/matplotlib/figure.py", line 3012, in savefig
self.canvas.print_figure(fname, **kwargs)
File "/root/BSA/enter/envs/mutmap/lib/python3.10/site-packages/matplotlib/backend_bases.py", line 2314, in print_figure
result = print_method(
File "/root/BSA/enter/envs/mutmap/lib/python3.10/site-packages/matplotlib/backend_bases.py", line 1643, in wrapper
return func(*args, **kwargs)
File "/root/BSA/enter/envs/mutmap/lib/python3.10/site-packages/matplotlib/_api/deprecation.py", line 412, in wrapper
return func(*inner_args, **inner_kwargs)
File "/root/BSA/enter/envs/mutmap/lib/python3.10/site-packages/matplotlib/backends/backend_agg.py", line 541, in print_png
mpl.image.imsave(
File "/root/BSA/enter/envs/mutmap/lib/python3.10/site-packages/matplotlib/image.py", line 1675, in imsave
image.save(fname, **pil_kwargs)
File "/root/BSA/enter/envs/mutmap/lib/python3.10/site-packages/PIL/Image.py", line 2240, in save
save_handler(self, fp, filename)
File "/root/BSA/enter/envs/mutmap/lib/python3.10/site-packages/PIL/PngImagePlugin.py", line 1348, in _save
ImageFile._save(im, _idat(fp, chunk), [("zip", (0, 0) + im.size, 0, rawmode)])
File "/root/BSA/enter/envs/mutmap/lib/python3.10/site-packages/PIL/ImageFile.py", line 512, in _save
e.setimage(im.im, b)
SystemError: tile cannot extend outside image
[MutMap:2021-12-12 17:52:59] MutMap successfully finished.

Best wishes.

Pengbo Xu

MutMap plus

Hello,
I found MutMap+ while doing research, and I really found it useful. But I only find the latest version (2.3.3) of MutMap on GitHub. Would it be possible for you to tell me where to download Mutmap+ ?

License?

Is there a license? Is this open source, unrestricted?

FileNotFoundError with bcftools log

Dear Yu,
Thank you for MutMap. I bumped into a weird mistake. My guess is that it is due to the split of the genome reference into chromosomes. Don't really know.

This is my OS Linux x86_64 GNU/Linux and my conda environment:

name: bsaseq
channels:
  - bioconda
  - conda-forge
  - defaults
dependencies:
  - mutmap = 2.3.2
  - snakemake = 5.20.0
  - fastp = 0.19.5
  - multiqc = 1.9
  - yaml = 0.2.5
  - snpeff = 5.0
  - parallel-fastq-dump = 0.6.7 
  - samtools = 1.14
  - bcftools = 1.14

Finally, here is the error message I got:

(bsaseq) bash-4.2$ mutmap --ref Oy-0DeNovo.fa -c D_Oy_0.final.sorted.bam  -b trimmed/bulk_R1_trimmed.fq.gz,trimmed/bulk_R2_trimmed.fq.gz        -n 51        --out run1/ -t 30
[MutMap:2021-11-22 17:20:16] start to run MutMap.
[MutMap:2021-11-22 17:20:16] maximum number of threads which you can use is up to 64.
[MutMap:2021-11-22 17:20:16] start to index reference fasta.
[MutMap:2021-11-22 17:21:39] indexing of reference successfully finished.
[MutMap:2021-11-22 17:21:39] start to align reads of bulk.0000 by BWA.
[MutMap:2021-11-22 17:41:24] alignment bulk.0000 successfully finished.
[MutMap:2021-11-22 17:41:24] start to merge BAMs.
[MutMap:2021-11-22 17:42:44] merging process successfully finished.
[MutMap:2021-11-22 17:42:44] start to call variants.
[MutMap:2021-11-22 17:42:45] !!ERROR!! bcftools mpileup -a AD,ADF,ADR -B -q 40 -Q 18 -C 50 -O u -r Chr5 -f run1//10_ref/Oy-0DeNovo.fa run1//20_bam/cultivar.bam run1//20_bam/bulk.bam | bcftools call -vm -f GQ,GP -O u | bcftools filter -i "INFO/MQ>=40" -O z -o run1//30_vcf/mutmap.Chr5.vcf.gz >> run1//log/bcftools.Chr5.log 2>&1

please check below:

[MutMap:2021-11-22 17:42:45] !!ERROR!! bcftools mpileup -a AD,ADF,ADR -B -q 40 -Q 18 -C 50 -O u -r Chr2 -f run1//10_ref/Oy-0DeNovo.fa run1//20_bam/cultivar.bam run1//20_bam/bulk.bam | bcftools call -vm -f GQ,GP -O u | bcftools filter -i "INFO/MQ>=40" -O z -o run1//30_vcf/mutmap.Chr2.vcf.gz >> run1//log/bcftools.Chr2.log 2>&1

please check below:

[MutMap:2021-11-22 17:42:45] !!ERROR!! bcftools mpileup -a AD,ADF,ADR -B -q 40 -Q 18 -C 50 -O u -r Chr4 -f run1//10_ref/Oy-0DeNovo.fa run1//20_bam/cultivar.bam run1//20_bam/bulk.bam | bcftools call -vm -f GQ,GP -O u | bcftools filter -i "INFO/MQ>=40" -O z -o run1//30_vcf/mutmap.Chr4.vcf.gz >> run1//log/bcftools.Chr4.log 2>&1

please check below:

[MutMap:2021-11-22 17:42:45] !!ERROR!! bcftools mpileup -a AD,ADF,ADR -B -q 40 -Q 18 -C 50 -O u -r Chr3 -f run1//10_ref/Oy-0DeNovo.fa run1//20_bam/cultivar.bam run1//20_bam/bulk.bam | bcftools call -vm -f GQ,GP -O u | bcftools filter -i "INFO/MQ>=40" -O z -o run1//30_vcf/mutmap.Chr3.vcf.gz >> run1//log/bcftools.Chr3.log 2>&1

please check below:

[MutMap:2021-11-22 17:42:45] !!ERROR!! bcftools mpileup -a AD,ADF,ADR -B -q 40 -Q 18 -C 50 -O u -r Chr1 -f run1//10_ref/Oy-0DeNovo.fa run1//20_bam/cultivar.bam run1//20_bam/bulk.bam | bcftools call -vm -f GQ,GP -O u | bcftools filter -i "INFO/MQ>=40" -O z -o run1//30_vcf/mutmap.Chr1.vcf.gz >> run1//log/bcftools.Chr1.log 2>&1

please check below:

multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/home/mgallan1/miniconda3/envs/bsaseq/lib/python3.10/site-packages/mutmap/mpileup.py", line 139, in mpileup
    sbp.run(cmd1,
  File "/home/mgallan1/miniconda3/envs/bsaseq/lib/python3.10/subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'bcftools mpileup -a AD,ADF,ADR -B -q 40 -Q 18 -C 50 -O u -r Chr5 -f run1//10_ref/Oy-0DeNovo.fa run1//20_bam/cultivar.bam run1//20_bam/bulk.bam | bcftools call -vm -f GQ,GP -O u | bcftools filter -i "INFO/MQ>=40" -O z -o run1//30_vcf/mutmap.Chr5.vcf.gz >> run1//log/bcftools.Chr5.log 2>&1' returned non-zero exit status 255.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/mgallan1/miniconda3/envs/bsaseq/lib/python3.10/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/home/mgallan1/miniconda3/envs/bsaseq/lib/python3.10/multiprocessing/pool.py", line 48, in mapstar
    return list(map(*args))
  File "/home/mgallan1/miniconda3/envs/bsaseq/lib/python3.10/site-packages/mutmap/mpileup.py", line 145, in mpileup
    call_log(self.out, 'bcftools', cmd1)
  File "/home/mgallan1/miniconda3/envs/bsaseq/lib/python3.10/site-packages/mutmap/utils.py", line 19, in call_log
    with open('{}/log/{}.log'.format(out_dir, name)) as log:
FileNotFoundError: [Errno 2] No such file or directory: 'run1//log/bcftools.log'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/mgallan1/miniconda3/envs/bsaseq/bin/mutmap", line 10, in <module>
    sys.exit(main())
  File "/home/mgallan1/miniconda3/envs/bsaseq/lib/python3.10/site-packages/mutmap/mutmap.py", line 146, in main
    MutMap(args).run()
  File "/home/mgallan1/miniconda3/envs/bsaseq/lib/python3.10/site-packages/mutmap/mutmap.py", line 141, in run
    self.mpileup()
  File "/home/mgallan1/miniconda3/envs/bsaseq/lib/python3.10/site-packages/mutmap/mutmap.py", line 102, in mpileup
    mp.run()
  File "/home/mgallan1/miniconda3/envs/bsaseq/lib/python3.10/site-packages/mutmap/mpileup.py", line 227, in run
    p.map(self.mpileup, chr_names)
  File "/home/mgallan1/miniconda3/envs/bsaseq/lib/python3.10/multiprocessing/pool.py", line 364, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/home/mgallan1/miniconda3/envs/bsaseq/lib/python3.10/multiprocessing/pool.py", line 771, in get
    raise self._value
FileNotFoundError: [Errno 2] No such file or directory: 'run1//log/bcftools.log'

Any clue why?
Thank you in advance,
Marc

Add a license file

Please add a license file so that people can understand whether they can redistribute the tool

ERROR: Could not load index.

I use mutmap to mapping gene from begining.

when calling variants, the following error was generated :
bcftools concat -a -o z mutmap.vcf.gz mutmap.*.vcf.gz >> log/bcftools.log 2>&1
Please check below :
Failed to open 30_vcf/mutmap.AAAA02040040.1.vcf.gz : could not load index .

Any ideas what I might be missing or overlooking?

subprocess.CalledProcessError

Hi there,

A subprocess.CalledProcessError occurred when starting to call variants. Python version 3.8 and 3.7 did not make any difference. The jobs were submitted with LSF to a cluster (see blow script). I also forced the CPU number to 1, still the same error.

Any solutions fort that?

Thank you in advance,
Shawn


By the way, "conda install -c bioconda mutmap" doesn't work, as 'samtools' and/or 'bcftools' keep giving the following error
samtools: error while loading shared libraries: libcrypto.so.1.0.0: cannot open shared object file: No such file or directory

So I installed mutmap and dependencies manually. Version info as below:

(python3.7) [qtclab1@loginview03 MutMap-master]$ bcftools --version
bcftools 1.3.1
Using htslib 1.3.1
Copyright (C) 2016 Genome Research Ltd.
License Expat: The MIT/Expat license
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

(python3.7) [qtclab1@loginview03 MutMap-master]$ samtools --version
samtools 1.3.1
Using htslib 1.3.1
Copyright (C) 2016 Genome Research Ltd.

The stout was like:

[MutMap:2020-09-21 09:45:08] start to run MutMap.
[MutMap:2020-09-21 09:45:08] maximum number of threads which you can use is up to 16.
[MutMap:2020-09-21 09:45:08] start to index reference fasta.
[MutMap:2020-09-21 09:47:07] indexing of reference successfully finished.
[MutMap:2020-09-21 09:47:07] start to filter reads.
[MutMap:2020-09-21 10:06:36] filtering process successfully finished.
[MutMap:2020-09-21 10:06:36] start to merge BAMs.
[MutMap:2020-09-21 10:18:37] merging process successfully finished.
[MutMap:2020-09-21 10:18:37] start to call variants.
[MutMap:2020-09-21 10:18:38] !!ERROR!! bcftools mpileup -a AD,ADF,ADR -B -q 40 -Q 18 -C 50 -O u -r 4 -f /
Share2/home/qtclab1/00.users/shang_gao/01.SongSS/01.mutmap/CNUsongA11C3G337_new_python3.7/10_ref/Arabidop
sis_thaliana.TAIR10.dna.toplevel.fa /Share2/home/qtclab1/00.users/shang_gao/01.SongSS/01.mutmap/CNUsongA1
1C3G337_new_python3.7/20_bam/cultivar.filt.bam /Share2/home/qtclab1/00.users/shang_gao/01.SongSS/01.mutma
p/CNUsongA11C3G337_new_python3.7/20_bam/bulk.filt.bam | bcftools call -vm -f GQ,GP -O u | bcftools filter
-i "INFO/MQ>=40" -O z -o /Share2/home/qtclab1/00.users/shang_gao/01.SongSS/01.mutmap/CNUsongA11C3G337_ne
w_python3.7/30_vcf/mutmap.4.vcf.gz >> /Share2/home/qtclab1/00.users/shang_gao/01.SongSS/01.mutmap/CNUsong
A11C3G337_new_python3.7/log/bcftools.4.log 2>&1

The sterr was like:

multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/Share2/home/qtclab1/apps/MutMap-master/mutmap/mpileup.py", line 143, in mpileup
check=True)
File "/Share2/home/qtclab1/anaconda3/envs/python3.7/lib/python3.7/subprocess.py", line 512, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command 'bcftools mpileup -a AD,ADF,ADR -B -q 40 -Q 18 -C 50 -O u -r 1 -f /Share2/home/qtclab1/00.users/shang_gao/01.SongSS/01.mutmap/CNUsongA11C3G337_new_python3.7/10_ref/Arabidopsis_thaliana.TAIR10.dna.toplevel.fa /Share2/home/qtclab1/00.users/shang_gao/01.SongSS/01.mutmap/CNUsongA11C3G337_new_python3.7/20_bam/cultivar.filt.bam /Share2/home/qtclab1/00.users/shang_gao/01.SongSS/01.mutmap/CNUsongA11C3G337_new_python3.7/20_bam/bulk.filt.bam | bcftools call -vm -f GQ,GP -O u | bcftools filter -i "INFO/MQ>=40" -O z -o /Share2/home/qtclab1/00.users/shang_gao/01.SongSS/01.mutmap/CNUsongA11C3G337_new_python3.7/30_vcf/mutmap.1.vcf.gz >> /Share2/home/qtclab1/00.users/shang_gao/01.SongSS/01.mutmap/CNUsongA11C3G337_new_python3.7/log/bcftools.1.log 2>&1' returned non-zero exit status 255.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Share2/home/qtclab1/anaconda3/envs/python3.7/lib/python3.7/multiprocessing/pool.py", line 121, in worker
result = (True, func(*args, **kwds))
File "/Share2/home/qtclab1/anaconda3/envs/python3.7/lib/python3.7/multiprocessing/pool.py", line 44, in mapstar
return list(map(*args))
File "/Share2/home/qtclab1/apps/MutMap-master/mutmap/mpileup.py", line 145, in mpileup
call_log(self.out, 'bcftools', cmd1)
File "/Share2/home/qtclab1/apps/MutMap-master/mutmap/utils.py", line 19, in call_log
with open('{}/log/{}.log'.format(out_dir, name)) as log:
FileNotFoundError: [Errno 2] No such file or directory: '/Share2/home/qtclab1/00.users/shang_gao/01.SongSS/01.mutmap/CNUsongA11C3G337_new_python3.7/log/bcftools.log'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/Share2/home/qtclab1/anaconda3/envs/python3.7/bin/mutmap", line 33, in
sys.exit(load_entry_point('mutmap', 'console_scripts', 'mutmap')())
File "/Share2/home/qtclab1/apps/MutMap-master/mutmap/mutmap.py", line 152, in main
MutMap(args).run()
File "/Share2/home/qtclab1/apps/MutMap-master/mutmap/mutmap.py", line 147, in run
self.mpileup()
File "/Share2/home/qtclab1/apps/MutMap-master/mutmap/mutmap.py", line 107, in mpileup
mp.run()
File "/Share2/home/qtclab1/apps/MutMap-master/mutmap/mpileup.py", line 228, in run
p.map(self.mpileup, chr_names)
File "/Share2/home/qtclab1/anaconda3/envs/python3.7/lib/python3.7/multiprocessing/pool.py", line 268, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "/Share2/home/qtclab1/anaconda3/envs/python3.7/lib/python3.7/multiprocessing/pool.py", line 657, in get
raise self._value
FileNotFoundError: [Errno 2] No such file or directory: '/Share2/home/qtclab1/00.users/shang_gao/01.SongSS/01.mutmap/CNUsongA11C3G337_new_python3.7/log/bcftools.log'

The job submission script:

 15 #BSUB -J Mutmap
 16 #BSUB -q TEST-A
 17 #BSUB -e /Share2/home/qtclab1/00.users/shang_gao/01.SongSS/01.mutmap/00.log/%J.err
 18 #BSUB -o /Share2/home/qtclab1/00.users/shang_gao/01.SongSS/01.mutmap/00.log/%J.out
 19 #BSUB -n 4
 20 #BSUB -R "span[hosts=1]"
 21
 22 source /Share2/home/qtclab1/.bashrc
 23 conda deactivate
 24 conda activate python3.7
 25 conda env list
 26
 27
 28 REF="/Share2/home/qtclab1/00.users/shang_gao/00.reference"
 29 INPUT="/Share2/home/qtclab1/00.users/shang_gao/01.SongSS/01.mutmap"
 30 OUTPUT="/Share2/home/qtclab1/00.users/shang_gao/01.SongSS/01.mutmap"
 31
 32 mutmap \
 33 -t 4 \
 34 -r $REF/Arabidopsis_thaliana.TAIR10.dna.toplevel.fa \
 35 -c $INPUT/CNUsongA11C3G337/20_bam/cultivar.filt.bam \
 36 -b $INPUT/CNUsongA11C3G337/20_bam/bulk.filt.bam \
 37 -n 20 \
 38 -o $OUTPUT/CNUsongA11C3G337_new_python3.7

Mutplot error

i experienced this error when i am running Mutmap as well as Mutplot also

Traceback (most recent call last):
File "/home/priyanka/miniconda3/bin/mutplot", line 11, in
load_entry_point('mutmap', 'console_scripts', 'mutplot')()
File "/home/priyanka/miniconda3/lib/python3.6/site-packages/pkg_resources/init.py", line 490, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/home/priyanka/miniconda3/lib/python3.6/site-packages/pkg_resources/init.py", line 2853, in load_entry_point
return ep.load()
File "/home/priyanka/miniconda3/lib/python3.6/site-packages/pkg_resources/init.py", line 2453, in load
return self.resolve()
File "/home/priyanka/miniconda3/lib/python3.6/site-packages/pkg_resources/init.py", line 2459, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/home/priyanka/MutMap/mutmap/mutplot.py", line 12, in
from mutmap.plot import Plot
File "/home/priyanka/MutMap/mutmap/plot.py", line 8, in
from qtlseq.utils import time_stamp
ModuleNotFoundError: No module named 'qtlseq'

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.