Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用VariantNotation软件包将VariantCallFormat(VCF)文件保存到R中的磁盘_R_Bioinformatics_Bioconductor_Genome_Vcf Variant Call Format - Fatal编程技术网

如何使用VariantNotation软件包将VariantCallFormat(VCF)文件保存到R中的磁盘

如何使用VariantNotation软件包将VariantCallFormat(VCF)文件保存到R中的磁盘,r,bioinformatics,bioconductor,genome,vcf-variant-call-format,R,Bioinformatics,Bioconductor,Genome,Vcf Variant Call Format,我在网上搜索过这个,运气不好。或多或少,您总是可以从VariantAnotation包获得示例。由于这个例子在我的计算机上运行良好,我不知道为什么我创建的VCF不能运行 问题:我想确定所选基因中SNP的数量和位置。我有一个很大的VCF文件(超过5GB),其中包含了一些小鼠品系所有染色体上所有SNP的信息。显然,如果我试图在整个基因组范围内做任何事情,我的计算机就会冻结,所以我首先确定了感兴趣的基因在1号染色体上的基因组位置。然后,我使用VariantNotation包从VCF文件中仅获取与我感兴

我在网上搜索过这个,运气不好。或多或少,您总是可以从VariantAnotation包获得示例。由于这个例子在我的计算机上运行良好,我不知道为什么我创建的VCF不能运行

问题:我想确定所选基因中SNP的数量和位置。我有一个很大的VCF文件(超过5GB),其中包含了一些小鼠品系所有染色体上所有SNP的信息。显然,如果我试图在整个基因组范围内做任何事情,我的计算机就会冻结,所以我首先确定了感兴趣的基因在1号染色体上的基因组位置。然后,我使用VariantNotation包从VCF文件中仅获取与我感兴趣的基因相关的数据:

library(VariantAnnotation)
param<-ScanVcfParam(
  info=c("AC1","AF1","DP","DP4","INDEL","MDV","MQ","MSD","PV0","PV1","PV2","PV3","PV4","QD"), 
  geno=c("DP","GL","GQ","GT","PL","SP","FI"),
  samples=strain, 
  fixed="FILTER",
  which=gnrng
  )
#This is the example:
out1.vcf<-tempfile()
in1<-readVcf(fl,"hg19")
writeVcf(in1,out1.vcf)
库(VariantAnotation)

param这是一个可重复的示例

library(VariantAnnotation)
fl <- system.file("extdata", "chr22.vcf.gz", package="VariantAnnotation")
param <- ScanVcfParam(fixed="FILTER")
writeVcf(readVcf(fl, "hg19", param=param), tempfile())

## Error in .pasteCollapse(ALT, ",") : 'x' must be a CharacterList
库(VariantAnotation)

fl感谢您报告此错误。该问题已在1.9.47版(devel分支)中修复。该修复程序将在4月14日后在发布分支中提供

问题是您有选择地从“固定”字段导入了“筛选器”,而不是从“ALT”字段导入。writeVcf()引发错误,因为没有可写入的ALT值。如果您没有使用修复程序访问该版本,一个解决方法是导入ALT字段

ScanVcfParam(fixed = c("ALT", "FILTER"))
您可以看到使用fixed()访问器输入了哪些值:

fixed(vcf)
请在马丁引用的Bioconductor邮件列表中报告错误或问题。更多的Bioc用户将看到这个问题,您将更快地获得帮助

Valerie

请询问有关Bioconductor包装的问题(无需订阅)。确保提供
sessionInfo()
的输出,因为这听起来像是包中的一个bug。
param <- ScanVcfParam(fixed="ALT")
writeVcf(readVcf(fl, "hg19", param=param), tempfile())
ScanVcfParam(fixed = c("ALT", "FILTER"))
fixed(vcf)