R 包 methylKit(GitHub - al2na/methylKit: R package for DNA methylation analysis) 是基于bisulfite sequencing 开发的DNA 甲基化和注释的工具.

image.png
最近下载的时候老是遇到报错
methCall.cpp:925:42: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
c = std::snprintf(cigar_buffer.data(), cigar_buffer.size(), "%i%c", bam_cigar_oplen(cigar_pointer[i]), bam_cigar_opchr(cigar_pointer[i]));
~~~~~~~~~~~~~~~~~^~
In file included from methCall.cpp:4:
/usr/include/stdio.h:354:39: note: initializing argument 1 of ‘int snprintf(char*, size_t, const char*, ...)’
extern int snprintf (char *__restrict __s, size_t __maxlen,
~~~~~~~~~~~~~~~~~^~~
methCall.cpp:934:38: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
std::snprintf(cigar_buffer.data(), c + 1, "%i%c", bam_cigar_oplen(cigar_pointer[i]), bam_cigar_opchr(cigar_pointer[i]));
~~~~~~~~~~~~~~~~~^~
In file included from methCall.cpp:4:
/usr/include/stdio.h:354:39: note: initializing argument 1 of ‘int snprintf(char*, size_t, const char*, ...)’
extern int snprintf (char *__restrict __s, size_t __maxlen,
~~~~~~~~~~~~~~~~~^~~
make: *** [/opt/share/Debian-Buster/CRAN-R/R-3.6.1/lib/R/etc/Makeconf:176: methCall.o] Error 1
ERROR: compilation failed for package ‘methylKit’
解决办法:
首先用conda 安装
conda install bioconda/label/gcc7::bioconductor-methylkit
然后降低R版本到3.5.2
成功加载:
> library(methylKit)
Le chargement a nécessité le package : GenomicRanges
Le chargement a nécessité le package : stats4
Le chargement a nécessité le package : BiocGenerics
Le chargement a nécessité le package : parallel
Attachement du package : ‘BiocGenerics’
The following objects are masked from ‘package:parallel’:
clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
clusterExport, clusterMap, parApply, parCapply, parLapply,
parLapplyLB, parRapply, parSapply, parSapplyLB
The following objects are masked from ‘package:stats’:
IQR, mad, sd, var, xtabs
The following objects are masked from ‘package:base’:
anyDuplicated, append, as.data.frame, basename, cbind, colMeans,
colnames, colSums, dirname, do.call, duplicated, eval, evalq,
Filter, Find, get, grep, grepl, intersect, is.unsorted, lapply,
lengths, Map, mapply, match, mget, order, paste, pmax, pmax.int,
pmin, pmin.int, Position, rank, rbind, Reduce, rowMeans, rownames,
rowSums, sapply, setdiff, sort, table, tapply, union, unique,
unsplit, which, which.max, which.min
Le chargement a nécessité le package : S4Vectors
Attachement du package : ‘S4Vectors’
The following object is masked from ‘package:base’:
expand.grid
Le chargement a nécessité le package : IRanges
Le chargement a nécessité le package : GenomeInfoDb