Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremymcrae committed May 21, 2020
1 parent c132193 commit 6fccb17
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ and compression schemes have also been tested using example bgen files).
#### Usage
```python
from bgen import BgenFile
bfile = BgenFile(BGEN_PATH, SAMPLE_PATH=None)
bfile = BgenFile(BGEN_PATH, sample_path=None)
rsids = bfile.rsids()

# select a variant by indexing
var = bfile[1000]

# pull out genotype probabilities
probs = var.probabilities() # returns 2D numpy array
dosage = var.alt_dosage() # requires biallelic variant, returns numpy array
probs = var.probabilities # returns 2D numpy array
dosage = var.minor_allele_dosage # requires biallelic variant, returns numpy array

# exclude variants from analyses by passing in indices
to_drop = [1, 3, 500]
Expand All @@ -37,9 +37,9 @@ dumped = pickle.dumps(var)
var = pickle.loads(dumped)

# iterate through every variant in the file, without preloading every variant
with BgenFile(BGEN_PATH, SAMPLE_PATH=None, delay_parsing=True) as bfile:
with BgenFile(BGEN_PATH, sample_path=None, delay_parsing=True) as bfile:
for var in bfile:
probs = var.probabilities()
dosage = var.alt_dosage()
probs = var.probabilities
dosage = var.minor_allele_dosage
ploidy = var.ploidy
```

0 comments on commit 6fccb17

Please sign in to comment.