[Bioc-devel] VcfFile and VcfFileList
Robert Castelo
robert.castelo at upf.edu
Wed Jul 17 20:37:34 CEST 2013
oops!! i was forgetting the 'format="vcf"' argument in the call to
indexTabix. it works now, sorry for the noise!
robert.
On 7/17/13 8:24 PM, Robert Castelo wrote:
> hi Valerie,
>
> sounds great, and i think it will do, however, i've encountered a
> problem when trying to obtain the tabix index file, required to build
> this TabixFile object, with a toy VCF file i'm playing with:
>
> library(Rsamtools)
> indexTabix("x.vcf.gz")
> Error in value[[3L]](cond) : 'seq' must be integer(1)
> file: x.vcf.gz
>
> the message sounds to me complaining about the sequence names (?)
>
> library(VariantAnnotation)
> vcf <- readVcf("x.vcf.gz", genome="hg19")
> seqnames(vcf)
> factor-Rle of length 5000 with 5 runs
> Lengths: 704 993 1911 1370 22
> Values : 20 21 22 X Y
> Levels(5): 20 21 22 X Y
>
> so could the problem be that sequence names are not integers because
> of X and Y ?
>
> thanks!
> robert.
>
> On 7/17/13 6:56 PM, Valerie Obenchain wrote:
>> Hi Robert,
>>
>> Have you seen TabixFile and TabixFileList? Both scanVcf() and
>> readVcf() have methods for TabixFile.
>>
>> > showMethods("readVcf")
>> Function: readVcf (package VariantAnnotation)
>> file="character", genome="character", param="missing"
>> file="character", genome="character", param="ScanVcfParam"
>> file="character", genome="missing", param="missing"
>> file="TabixFile", genome="character", param="GRanges"
>> file="TabixFile", genome="character", param="GRangesList"
>> file="TabixFile", genome="character", param="missing"
>> file="TabixFile", genome="character", param="RangedData"
>> file="TabixFile", genome="character", param="RangesList"
>> file="TabixFile", genome="character", param="ScanVcfParam"
>>
>> Does this fit your need/use case?
>>
>> Valerie
>>
>> On 07/17/2013 03:22 AM, Robert Castelo wrote:
>>> hi,
>>>
>>> i'm interested in having classes 'VcfFile' and 'VcfFileList', analogous
>>> to 'BamFile'/'BamFileList' or 'Bcf/BcfFileList,' with their
>>> corresponding functionality to ease manipulating, in this case, VCF
>>> files. i thought i could sort of copy&paste code from Rsamtools but the
>>> existing definitions of classes and methods rely on the Rsamtools
>>> internal functions '.RsamtoolsFile' and '.RsamtoolsFileList' which are
>>> not exported, and thus i cannot use them.
>>>
>>> i might be following the wrong path, so i'd like to ask how should i
>>> proceed to have this kind of functionality to handle VCF files,
>>> analogous to the existing one in Rsamtools to handle BAM or BCF files.
>>>
>>> thanks!
>>> robert.
>>>
>>> _______________________________________________
>>> Bioc-devel at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>>
>
More information about the Bioc-devel
mailing list