Comments (4)
@danielemerico Is it correct that the goal is to annotate variants and ignore the non-variant segments?
If so, here is a workaround:
# Filter non-variant segments out
onlyVariants <- variants[lapply(variants, function(v){ v$alternateBases[[1]]}) != "<NON_REF>"]
granges <- variantsToGRanges(onlyVariants)
@ttriche here's the stack trace. Do you have any BioConductor-specific suggestions as to how we might work with data containing non-variant segments? Is filtering them out before hand the common approach? I would also imagine we would hit this if the alternate allele value was <DEL>
Thanks in advance for any pointers/advice!
> granges <- variantsToGRanges(variants)
Error in .Call2("new_XString_from_CHARACTER", classname, x, start(solved_SEW), :
key 60 (char '<') not in lookup table
Calls: variantsToGRanges ... XString -> XString -> .charToXString -> .Call2 -> .Call
> traceback()
19: .Call(.NAME, ..., PACKAGE = PACKAGE)
18: .Call2("new_XString_from_CHARACTER", classname, x, start(solved_SEW),
width(solved_SEW), get_seqtype_conversion_lookup("B", seqtype),
PACKAGE = "Biostrings")
17: .charToXString(seqtype, x, start, end, width)
16: XString(seqtype, x)
15: XString(seqtype, x)
14: .oneSeqToXStringSet(seqtype, x, start, end, width, use.names)
13: .charToXStringSet(seqtype, x, start, end, width, use.names)
12: XStringSet(seqtype, unlisted_y)
11: XStringSet(seqtype, unlisted_y)
10: .new_XStringSetList_from_list(seqtype, x)
9: XStringSetList("DNA", ..., use.names = use.names)
8: DNAStringSetList(v$alternateBases)
7: DataFrame(...)
6: newGRanges("GRanges", seqnames = seqnames, ranges = ranges, strand = strand,
mcols = DataFrame(...), seqlengths = seqlengths, seqinfo = seqinfo)
5: GRanges(seqnames = Rle(as.character(v$referenceName), 1), ranges = IRanges(start = position,
end = as.integer(v$end)), REF = DNAStringSet(v$referenceBases),
ALT = DNAStringSetList(v$alternateBases), QUAL = as.numeric(v$quality),
FILTER = as.character(v$filter))
4: FUN(X[[1L]], ...)
3: lapply(variants, variantsToGRangesHelper)
2: do.call("c", lapply(variants, variantsToGRangesHelper))
1: variantsToGRanges(variants)
from googlegenomics.
@deflaux, it's probably just easier to use FilterRules via VariantTools or directly from IRanges:
http://www.bioconductor.org/packages/release/bioc/html/VariantTools.html
http://www.bioconductor.org/packages/release/bioc/html/IRanges.html
~p
from googlegenomics.
Workaround works. I tried something similar, but this implementation does not break the object while mine did. More than sufficient for current purposes.
from googlegenomics.
Closing this issue in favor of #46
from googlegenomics.
Related Issues (20)
- genome reference assembly extraction from variants/reads objects? HOT 4
- seqlevelsStyle oddities HOT 10
- improve performance HOT 8
- coding style HOT 19
- getting started confusion HOT 13
- Example code motivating seqlevelsStyle() patch HOT 1
- Improve messaging and instructions around authentication. HOT 4
- add retrying to all api methods
- streamline authorization HOT 1
- submit this package to BioConductor HOT 3
- Problem authenticating with invokeBrowser=F HOT 2
- Document steps for new package releases HOT 4
- Port to native R support in Travis. HOT 19
- Might want to update to the new location... HOT 2
- Update Bioconductor converters to handle multi-allelic data and data with non-variant segments.
- Update Bioconductor variant converters to tolerate missing values.
- Update getVariants* calls to accept a variantSetId instead of datasetId HOT 1
- Add a method to reset the OAuth token. HOT 7
- variantsToVRanges loses sample/call information HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from googlegenomics.