corearray / pyseqarray Goto Github PK
View Code? Open in Web Editor NEWPySeqArray: data manipulation of whole-genome sequencing variants with SeqArray files in Python (pre-release version)
License: GNU General Public License v3.0
PySeqArray: data manipulation of whole-genome sequencing variants with SeqArray files in Python (pre-release version)
License: GNU General Public License v3.0
I am trying to filter variants by chromosome and position.
Here's my code:
fn = ps.seqExample('1KG_autosomes_phase3_shapeit2_mvncall_integrated_v5_20130502_lzma.seq.gds')
f = ps.SeqArrayFile()
f.open(fn)
f.FilterReset()
# filter for chromosome
chrs_all = f.GetData('chromosome')
chrs_sel = chrs_all == '22'
f.FilterSet2(variant=chrs_sel)
# returns: # of selected variants: 1,103,547
pos_on_chrom = f.GetData('position')
# there are 3 variants with positions < 16050319
f.FilterSet2(variant=pos_on_chrom<16050319, intersect=True)
# returns: # of selected variants: 1,103,547
Given that there 3 variants with position < 16050319 shouldnt the last call to FilterSet2 return 3 variants?
Update
Of course some simple boolean slicing does the job, maybe I misunderstood the intention of intersect=True
?
sel = np.zeros_like(chrs_all, dtype=bool)
np.putmask(sel, chrs_sel, pos_on_chrom < 16050319) # there are 3 variants with positions < 16050319
f.FilterSet2(variant=sel)
# returns: # of selected variants: 3
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.