Skip to content

GenomeInfoDb::seqlevelsStyle(gr) <- GenomeInfoDb::seqlevelsStyle(genome) #82

@annecarolm

Description

@annecarolm

Hello,

I am trying to use your pipeline for a custom genome that I forged to BSgenome so I could use your pipeline. I am running into a problem with read_vcfs_as_granges. When I load my data :
grl <- read_vcfs_as_granges(vcf_files, sample_names, Bshel, change_seqnames=FALSE, group = "none")

I get the following error message
The style does not have a compatible entry for the species supported by Seqname. Please see genomeStyles() for supported species/style Error in purrr::map(): ℹ In index: 1. Caused by error: ! The seqlevelStyle of the vcf could not be changed to that of the reference. You can run this function with change_seqnames = Fandgroup = 'all', to prevent this error. However, you then have to make sure that the seqnames (chromosome names) are the same between your vcfs and the reference BSgenome object. (The message of the internal error causing this problem is shown above.)

I have tried running the code with the change_seqnames = F and group = 'all' options individually and simultaneously. I still get an error:
The style does not have a compatible entry for the species supported by Seqname. Please see genomeStyles() for supported species/style Error in purrr::map(): ℹ In index: 1. Caused by error: ! The vcf could not be filtered for the specific seqlevels group. You can run this function with group = 'all', to prevent this error. (The message of the internal error causing this problem is shown above.)

I modified my VCF headers to match the formatting of the examples you mention on the tutorial. I also run the example dataset and have no error with read_vcfs_as_granges. I also modified my sequence headers and VCF sequence identifiers by chr1-chr11 to match the identified in the databases.

I also double checked some functions in the read_vcfs_as_granges to try to pinpoint where the error could have be coming from. First, I tried to open my vcf with readVcf(vcf_test), no problem there. I also tried GenomicRanges::granges(VariantAnnotation::readVcf(vcf_test)) and everything looks good, no errors whatsoeverever. Therefore, I don't believe the problem is with my VCF.

However, I found that if I run GenomeInfoDb::seqlevelsStyle(gr) <- GenomeInfoDb::seqlevelsStyle(Bshel) I get the following error message:
Error in seqlevelsStyle(seqlevels) : The style does not have a compatible entry for the species supported by Seqname. Please see genomeStyles() for supported species/style
Since this later error message is the first displayed when I use the read_vcfs_as_granges function, I am assuming the problem comes from the part of the code that does GenomeInfoDb::seqlevelsStyle(gr) <- GenomeInfoDb::seqlevelsStyle(genome). I am assuming that this error is given because my genome is not from a model organism and it is still unpublished and, consequently, not identified by the GenomeInfoDb.

Could you help me tackle this issue? I don't really know if the problem is that or if it could be solved, but would you have any insights or tips on how to bypass this?

Thank you so very much in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions